Encrypt Connection String in Asp.net

0
165

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.

HOW TO ENCRYPT CONNECTION STRING

1. First Create web project in asp.net, 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.

Previous article10 Latest Cydia Jailbreak Tweaks For Your Iphone 5
Next articleIs Jabong Strong Enough To Capitalize On Indiaplaza’s Weakness
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 : )

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.