Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2016-10-19
3
Medium Priority
?
139 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 15

Accepted Solution

by:
Giovanni Heward earned 1000 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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

886 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