Geeks With Blogs
Mayank Sharma

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)

Posted on Monday, January 17, 2011 10:44 AM Tips n Tricks | Back to top

Related Posts on Geeks With Blogs Matching Categories

Comments on this post: Encrypt / Decrypt Sections of App.Config file in Windows Application

# re: Encrypt / Decrypt Sections of App.Config file in Windows Application
Requesting Gravatar...
After you encrypt the connectionstring, how do you code it to work with connecting to database?
Left by carl on Sep 23, 2011 9:14 AM

Your comment:
 (will show your gravatar)


Copyright © bullpit | Powered by: GeeksWithBlogs.net