Friday, 16 January 2009

Asp.Net encrypt connection string in web config

Quick note on how to encrypt the Connection string in the web.config for future reference
Encrypt the Connection string :
aspnet_regiis -pef "ConnectionString" "c:\path\to\website"

Grant Access to IIS to the key
aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT Authority\Network Service"

note aspnet_regiis is in the .net framework directory for the version of .net that you are using