Wednesday, April 22, 2015

Encrypt connectionstring in web.config file

Suppose you have connectionstring as below.













To encrypt the connection string:


Open the command prompt and type the following to encrypt the connection string.


aspnet_regiis.exe -pef connectionStrings C:\inetpub\wwwroot\EncryptConnectionstring


where C:\inetpub\wwwroot\EncryptConnectionstring is the physical folder path where Web.config is located.


To decrypt the connectionstring type the following


aspnet_regiis.exe -pdf connectionStrings C:\inetpub\wwwroot\EncryptConnectionstring


Technorati Tags: ,

No comments:

Post a Comment