Tuesday, August 2, 2011

Encryption and Decryption of Web.config in ASP.net

For security its recommended to encrypt web.config after deploy.

MSDN article is here
Encrypting and Decrypting Configuration Sections


cmd should run as Administrator in Windows Server 2008

Example:

Encrypt:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pe "connectionString" -app "/appname"

Decryption:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pd "connectionString" -app "/appname"

No comments:

Post a Comment