Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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
?
128 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 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