Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The parameter is incorrect. RRS feed

  • Question

  • Hi,

    I have encrypted "Connection String" section in my .NET 4.0 web application web.config file. "Connection String" section is encrypted using "Enterprise Library 5.0 Configuration Console" I created machine level Custom Keys to in the development machine and exported it to .xml file using the following lines.

    Create: aspnet_regiis -pc "CustomKeys" -exp 
    Export: aspnet_regiis -px "CustomKeys" "C:\CustomKeys.xml" -pri 
    Import: aspnet_regiis -pi "CustomKeys" "C:\CustomKeys.xml"
    And changed the web.config file referring to the key name as below.
          <remove name="RSAProtectedConfigurationProvider" />
          <add keyContainerName="CustomKeys" useMachineContainer="true" description="Uses RsaCryptoServiceProvider to encrypt and decrypt" name="RsaProtectedConfigurationProvider" type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    Now, my application works perfectly in my development machine. but when I deploy in my Test environment it's  not working.

    My Development machine is Windows server 2008 R2 but my Test server is Windows 2012 R2.

    I have imported the keys with the syntax explained above and have provided access to "everyone" but still not working.

    The error message is "Failed to decrypt using provider "RsaProtectedConfigutationProvider". Error message from the provider: The parameter is incorrect. 

    Request help in this forum. Kindly let me know if you need any additional information.

    Thursday, June 2, 2016 12:54 AM

All replies