RsaProtectedConfigurationProvider'. Error message from the provider: Bad Data

LT1415
LT1415 used Ask the Experts™
on
A few years ago I built a simple application with login form using asp.net 2.0

I recall running this encryption/description script on the server as noted in  this URL:

http://blogs.msdn.com/b/mosharaf/archive/2005/11/17/protectedconfiguration.aspx
ASPNet_regiis.exe

It placed a sizeable amount of auto generated coding in the application config file as shown in the blog post above.

I have had to move the application to another server and am receiving this error listed below.

I don’t know what to do.
Should I reintall the  ASPNet_regiis.exe?
Should I remove the auto coding that is allready there or will the process write over it.?

Will this impact other applications on the server? Or is it directory specific?




Parser Error Message: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: Bad Data.


Source Error:


Line 40:
Line 41:       <connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
Line 42:   <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
Line 43:    xmlns="http://www.w3.org/2001/04/xmlenc#">
Line 44:    <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />

thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
see if you use RSA provider, it uses two types of key containers, one are machine specific and other are user specific.

if you encrypt using machine specific key containers, it will only be decrypted by the same machine, if you copy the config to other machine, here the public/private key pair is different from the other machine, so technically it is not feasible to encrypt on one machine and decrypt on other.(It looks right as well as otherwise there is no fun encrypting the data, if it can be decrypted by just copying it to other machine)

Other option is user key containers, which restricts the keys to user.

So the solution is to re-encrypt the section using RSA provider on your new machine and it will work seamlessly.

Read here for more details:-

http://msdn.microsoft.com/en-us/library/ff650304.aspx
http://msdn.microsoft.com/en-us/library/53tyfkaw.aspx

Author

Commented:
Buggy coder-- should I delete the existing config sections on the config file or will the new execution of the script write over it.
Do I need to to anything with the existing config file?
create a new connection string section in your config file on new server and then encrypt it.......

Author

Commented:
The poster answered my question. Accepted answer. Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial