Friday , 22 September 2017
Home » .NET » Encrypt Connection String in

Encrypt Connection String in

How to encrypt Connection string in Web.Config file using Asp.Net

While developing web projects we generally keep our Connection String under the Web.config, which get stored in plain text format which anybody can read. Connection String contains database connections, username, password etc. which is threat to your secured data.

The best idea is to keep our connection string in encrypted format which is not easily readable and which makes your connection string safe.


1. First Create web project in, then add connection details to web.config file.

2. Go to Start >  All Programs >> Microsoft visual studio 2008 >> Visual Studio Tools >> Visual Studio 2012 Command Prompt

After Opening Command prompt type following command aspnet_regiis.exe -pef “connectionStrings” “C:\VisualStudio2008\Authorization”

After that you will get a message stating “Encrypting configuration section… Succeeded!”.

Now when you will open your web.config file you will find encrypted connection string.

About Vinayak Bamane

MCA from IMCOST College. Works as a Software Specialist with eClinicalWorks. Programming Worm, Trek lover, Rock Climber, Game Addict, Volleyball Player and happy to be with Amazing Things : )

Check Also

Asp.Net LogIn and CreateUserWizard Controls

 Title : Log In and CreateNewUser Control Description :  Whenever we wanted to develop …

Leave a Reply

Your email address will not be published. Required fields are marked *