Encrypting connectionStrings with CustomProvider


Chuck P

I am trying to encrypt the connectionStrings in Web.config with a
custom provider. Works great for me, anyone else tries it they get
errors. Note the error says "decrypt"

My statements I ran on the IIS server to create the key is:
aspnet_regiis -pz WebEncryptionKeys

aspnet_regiis -pc WebEncryptionKeys -exp

aspnet_regiis -px WebEncryptionKeys "%ALLUSERSPROFILE%\Application

aspnet_regiis -pa "WebEncryptionKeys" "NT Authority\Network Service"

The statements I run on the workstation to complie and encrypt is:
aspnet_compiler -v %virtualPath% -p %sourcePath% -f
%destinationPath% -c -nologo

aspnet_regiis -pi "WebEncryptionKeys" "%PublicKeyNameLocation%"

aspnet_regiis -pef "connectionStrings" %destinationPath% -prov

The Error Message is:
Encrypting configuration section...

Failed to decrypt using provider 'HrCustomProvider'. Error message
from the provider: Bad Data.

(\\myservername\wwwroot\CriticalSkills\web.config line 19)

The Web.config is:

<add name="HrCustomProvider"

Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

Any ideas on why I can do it and no one else can?
I gave server admin to another user and it still gave the same error.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question