Encrypt / Decrypt Sections of App.Config file in Windows Application

Posted by bullpit on Geeks with Blogs See other posts from Geeks with Blogs or by bullpit
Published on Mon, 17 Jan 2011 16:44:38 GMT Indexed on 2011/01/17 17:54 UTC
Read the original article Hit count: 286

Filed under:

This is just a note to myself on how to Encrypt and Decrypt App.Config (or Web.Config if ASP.NET) in a Windows Application.

Encryption:
1. Rename App.Config to Web.Config
2. %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pef "connectionStrings" <Full Path to Web.Config>
3. Succeeded! implies Encryption was successful
4. Rename Web.Config to App.Config

Descryption:
1. Rename App.Config to Web.Config
2. %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pdf "connectionStrings" <Full Path to Web.Config>
3. Succeeded! implies Decryption was successful
4. Rename Web.Config to App.Config (if needed)

© Geeks with Blogs or respective owner