0

We have legacy ASP.NET application which uses Enterprise Library 4.1 Symmetric Key provider where key is stored on physical file as shown on config below. It uses machine key protection.

<symmetricCryptoProviders>
              <add algorithmType="System.Security.Cryptography.RijndaelManaged, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                protectedKeyFilename="F:\wwwroot2\MSEntLib3.1\key\EncryptionKey.key"
                protectedKeyProtectionScope="Machine" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.SymmetricAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                name="RijndaelManaged" />
            </symmetricCryptoProviders>

I deployed to Azure and application throws the error "EncryptionKey.key" is not found. Could someone please help how we keep using the Enterprise Library Crypto in azure?

Are there any option where we can create a key and use on any web servers including Azure Web Roles?

Thanks

Nil Pun
  • 17,035
  • 39
  • 172
  • 294

1 Answers1

1

The symmetric cryptography provider keys are stored in a file that is referenced using a full physical file path and name in the application configuration file and protected by DPAPI encryption, just like shown in your config. Because DPAPI is not available in Windows Azure, using the Enterprise Library symmetric cryptography providers out of the box won't work.

However, you can consider creating a custom symmetric algorithm provider for use with the Enterprise Library Crypto block. This provider could use the .NET Cryptographic Service Providers to implement encryption and as a best practice store the keys in encrypted format, performing the encryption offline, and storing them in Windows Azure Blob storage. For more information on this approach, see Using Certificate-Based Encryption in Windows Azure Applications and this post on securing connection strings in Windows Azure.

Grigori Melnik
  • 4,067
  • 2
  • 34
  • 40