To encrypt/ decrypt connection string information stored in the Web.config file.
how to encrypt the connectionStrings
section of the Web.config file for an application named SampleApplication:
At the Windows command line, run the below commands.
1-
cd \WINDOWS\Microsoft.Net\Framework\v2.0.
** (choose
the .net version, here I select v2.0)
2-
aspnet_regiis -pe "connectionStrings"
-app "/MyApplication"
·
The -pe option, passing it the string
"connectionStrings" to encrypt the connectionStrings element.
·
The -app option, passing it the name of
your application.
The aspnet_regiis.exe tool is located in
the %systemroot%\Microsoft.NET\Framework\versionNumber
folder.
how to grant the NETWORK SERVICE account access to the
machine-level "NetFrameworkConfigurationKey" RSA key container
At the Windows command line, run the below commands.
1-
Cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
2-
aspnet_regiis -pa
"NetFrameworkConfigurationKey" "NT Authority\Network
Service"
how to decrypt the connectionStrings element of
ASP.NET application SampleApplication.
At the Windows command line, run the below commands.
1-
Cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
2- aspnet_regiis
-pd "connectionStrings" -app "/SampleApplication"
Comments
Post a Comment