Bad Data failed to decrypt using provider 'CustomProvider' RRS feed

  • Question

  • The console application was working fine till I decided to encrypt the App.config file.
    I manually encryped the configuration file.

    Now when I run my application I get an exception:
    Complaint references a line in the config file:
    <EncryptedData Type=

    Any ideas on how to resolve this issue?

    Monday, August 1, 2011 7:33 PM

All replies

  • Hi Chuck,

    Could you please kindly elaborate how did you manually encryped the configuration file?


    Best regards,


    Min Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, August 5, 2011 9:20 AM
  • I added the <configProtectedData> block tag to my asp config file just below the ending </configSections> tag.

    I renamed my app.config file to Web.config.

    I then ran the aspnet_regiis in a command window to encode the Web.config file.

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pef "connectionStrings" %1 -prov "CustomProvider"

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pef "appSettings" %1 -prov "CustomProvider"
    (where %1 is the path to the Web.config file)

    I renamed the encoded Web.config file to <application.exe.config>.



    Monday, August 22, 2011 1:13 PM