Encrypting Sections with the aspnet_regiis tool : Encrypt « Configuration « ASP.NET Tutorial






To encrypt a section in the web configuration file, use the aspnet_regiis command-line tool. 

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe

The following command encrypts the connectionStrings section of a configuration file located in a folder named MyWebApp:

aspnet_regiis -pef connectionStrings c:\Websites\MyWebApp


To use the virtual path. 
The following command encrypts the connectionStrings section of a configuration file located in a virtual directory named /MyApp:
-app option is used to specify the application's virtual path.

aspnet_regiis -pe connectionStrings -app /MyApp








16.17.Encrypt
16.17.1.Encrypt Config
16.17.2.Encrypting Sections Programmatically
16.17.3.Encrypting Sections with the aspnet_regiis tool
16.17.4.decrypt a configuration section by using the -pdf option.
16.17.5.Decrypt a configuration section by specifying a virtual directory.
16.17.6.Encrypt connectionStrings section with the DataProtectionConfigurationProvider