Solved

How can I encrypt user name and password in the webcofig file of my ASP.Net application

Posted on 2016-10-19
3
71 Views
Last Modified: 2016-10-24
Hi Experts,
I need help encrypting user name and password for my SQL Server connection in the web.cofig file of my ASP.Net application.

How can this be done.  

The requirements are as follows:
1.  The user name and password cannot live anywhere within the application's code.
2.  The user and password must be encrypted within the web.config file's connection string.

How can I do this?

Thank you in advance,
mrotor
0
Comment
Question by:mainrotor
3 Comments
 
LVL 14

Accepted Solution

by:
Giovanni Heward earned 250 total points
ID: 41851259
I believe this is achievable with the aspnet_regiis.exe tool.

Here's a reference to demonstrate:
https://msdn.microsoft.com/en-us/library/dx0f3cf2(v=vs.85).aspx
0
 
LVL 21

Assisted Solution

by:Tapan Pattanaik
Tapan Pattanaik earned 250 total points
ID: 41854404
Hi mainrotor,

1. Open Command Prompt with "Run as administrator "
2. At the Command Prompt, enter: ( For .NET framework 4.0)

    cd C:\Windows\Microsoft.NET\Framework\v4.0.30319

In case your web Config is located in "D:\Project\EncryptWebConfig" directory path, then enter the following to encrypt the ConnectionString:

ASPNET_REGIIS -pef "connectionStrings" "D:\Project\EncryptWebConfig"

Use Aspnet_regiis.exe tool with the –pef option and specify the application path as shown above.

Similar  you can Decrypting the Connection String:

ASPNET_REGIIS -pdf "connectionStrings" "D:\Project\EncryptWebConfig"

For moredetails please check the below URL:

http://www.codeproject.com/Tips/795135/Encrypt-ConnectionString-in-Web-Config
0
 

Author Comment

by:mainrotor
ID: 41857869
Thanks for both of your help.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Check if number is currency 15 29
Round a string to two digits 12 24
Create XML 5 33
c# if statement weird reaction 3 29
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now