Encrypting web.config

There is a built-in tool that you can use to encrypt sections of your web.config file. This tool is aspnet_regiis.exe and it ships with the .NET Framework. It was introduced in .NET 2.0. This tool can be used for many different purposes; in this section we will limit the discussion to using it to encrypt the web.config file.

When a section of the web.config file, or machine.config for that matter, is encrypted using the aspnet_regiis.exe tool, it is done such that the section will be decrypted on the fly during the lifetime of the Web application. The encryption is transparent to the application code. When you use aspnet_regiis.exe to encrypt the configuration file, you will use the -pef switch to indicate what section needs ...

Get Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.