andrew4582

Encrypt Connectionstring in web.config file

Dec 4th, 2011
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. 5. Encrypt Connectionstring in web.config file
  2.  
  3. Never ever keep clear plain connectionstring in web.config file. The risk and consequences of this is self expalanatory.All you need to do is follow below steps and you are through with this.
  4.  
  5. Steps to be followed.
  6.  
  7. 1. Go to Visual Studio Command prompt in the “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\”path.
  8. 2. Install ASP.NET using aspnet_regiis –I command
  9. 3. Encrypt Web.Config connectionStrings using below command;
  10. 4. aspnet_regiis -pef "connectionStrings" path of the physical folder where web.config resides (e.g. aspnet_regiis -pef "connectionStrings" D:\Apps\NewBeeWebsite)
  11. 5. You will get the message “Encrypting configuration section... Succeeded!”
  12. 6. Run Following Commands;
  13. 7. aspnet_regiis -pa "NetFrameworkConfigurationKey" "ASPNET"
  14. 8. aspnet_regiis -pa "NetFrameworkConfigurationKey" "NETWORK SERVICE"
  15. 9. aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT AUTHORITY\NETWORK SERVICE"
  16. 10. Restart IIS
Advertisement
Add Comment
Please, Sign In to add comment