Solved

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

Posted on 2016-10-19
3
92 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASCX file or a newer alternative? 1 35
SqlDataBase 7 48
asp enable view state 1 24
ASP.NET MVC identity 6 26
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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 …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

770 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