472,958 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Where to store the DB password in a asp.net app?

Basically i am curious as to where everyone stores there database details for ASP.NET apps?

When developing controls i usually stored it in the web.config file.
Then i move it to a internal private property that is only acessable from my DB classes.

What other methods do people use?

Encryption and then store in the webconfig? or registry? or encrypt then registry?
Nov 18 '05 #1
3 1357
Hi Darren,

If you use Integrated authentication, you'd be fairly safe in the
web.config.

Otherwise, people use the methods you outlined. This article shows some
ideas:

HOW TO: Use the ASP.NET Utility to Encrypt Credentials and Session State
Connection Strings

http://support.microsoft.com/default...b;en-us;329290

"Darren Clark" <dc******@hotmail.com> wrote in message
news:Gi*****************@news-server.bigpond.net.au...
Basically i am curious as to where everyone stores there database details
for ASP.NET apps?

When developing controls i usually stored it in the web.config file.
Then i move it to a internal private property that is only acessable from my
DB classes.

What other methods do people use?

Encryption and then store in the webconfig? or registry? or encrypt then
registry?
Nov 18 '05 #2
Hi Darren,

This is a little bit custom, but I use a special Configuration class that
supports encryption of specified fields (among other things). I can then
store an encryption key inside of the compiled code somewhere as the key to
decrypt the encoded configuration keys.

There's more info on this solution here:

http://www.west-wind.com/presentatio...ationclass.asp
+++ Rick

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Darren Clark" <dc******@hotmail.com> wrote in message
news:Gi*****************@news-server.bigpond.net.au...
Basically i am curious as to where everyone stores there database details
for ASP.NET apps?

When developing controls i usually stored it in the web.config file.
Then i move it to a internal private property that is only acessable from my
DB classes.

What other methods do people use?

Encryption and then store in the webconfig? or registry? or encrypt then
registry?

Nov 18 '05 #3
Personally, I have a 'webuser' account with limited privileges (can only run certain stored procedures necessary to run the web application, doesn't even need 'select' access to tables), the password for this is then stored in the connection string in the registry. Yes, admittedly, a user who had access to log onto the webserver could technically glean the password and log on through QA and run some stored procedures. But wa-hey! great. They'd have to know the name of the SP, and even then they'd only be able to see as much data as it showed them. Remember a user can have 'execute' permissions on stored procedure 'sp_X' that reads some of or all of table 't_Y', without having 'select' permissions on t_Y
This is in my opinion the best way to control access to data

For situations where people need to use their own username and password from a fat-client app, I have a DLL on a file server (Windows DLL, written in C++) that exposes APIs to encrypt the password to the registry and retrieve it, the encryption key being compiled into the DLL so it can't be known. It could probably be hacked by an experienced cryptographer, but not by the average layman who knows how to browse 'warez' sites for "vba crackers", etc.
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Pat A | last post by:
We have a dilemma. We are storing our database password in an include file that resides outside of the web root. The password is in plain text. So, no one can get that password because it can't...
0
by: Senthil Kannan | last post by:
Hi all, Currently i have a FORM_BASED Authentication of tomcat5.0 to store and retrieve passwords in my homepage.Now when i try to Store my password in a encrypted form i am having some problems,i...
3
by: faktujaa | last post by:
Hi, Currently im storing the connection info. in XML file on the C drive. the only problem with this is that anybody can open and check the database name. I know encryption can solve this problem...
5
by: Guadala Harry | last post by:
What are my options for *securely* storing/retrieving the ID and password used by an ASP.NET application for accessing a SQL Server (using SQL Server authentication)? Please note that this ID and...
3
by: Paul | last post by:
Hi, I've got a SQL Server backend where I'm testing a new app and I'm currently storing the DB name and password in a table. I suppose this is secure to some extent, but what would you recommend,...
2
by: Benny Ng | last post by:
The authentication code of enterprise libiary like the following: IAuthenticationProvider authenticationProvider = AuthenticationFactory.GetAuthenticationProvider(); IIdentity identity;...
4
by: Mark R. Dawson | last post by:
Hi all, I have a configuration file that is storing sensative data, like db passwords etc. I want to encrypt the file so that people can not see the contents. What are the standard practices for...
8
by: Merk | last post by:
I'm looking for a safe and maintainable way to store connection string info (connecting to SQL Server 2005 from .NET 2.0 Windows Forms client app); things like server name or IP address and...
3
by: eggie5 | last post by:
I'm looking for the best place to store a general password I use on my website. Short of hard coding it into one of my aspx.cs files, I'm trying to find a good place to store it. The only place I...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.