Where to store UserID/Password

F

Fernandez

Hi,
Where can I store username password information my ASP.NET project.
I am not using any database.
I preferred to store in Application Configuration File.
Suggestions are welcome.
 
H

Hernan de Lahitte

Configuration files are definetly a bad place to store sensitive data like
user credentials. Here you have some guidelines about storing sensitive data
on config files:
http://msdn.microsoft.com/msdnmag/issues/03/11/ProtectYourData/default.aspx

You don't have a silver bullet here but you should add as many security
levels as you can (defense in deep).
One common approach is to store a regristry path in your config file and
save in that registry entry (with strong ACL) the encrypted data with DPAPI
(local machine mode). You just have a tool that do this here:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;329290

Then you have to decrypt this data and here you have this sample:

string decryptedData = Encoding.Unicode.GetString( ProtectedData.Decrypt(
registryBytes ) );

ProtectedData is the managed DPAPI wrapper in the Open Source NCrypto
proyect.
registryBytes is the byte array from the registry entry that create the tool
mentioned above.

You may get the NCrypto proyect from here:
http://sourceforge.net/projects/ncrypto/


--
Hernan de Lahitte
Lagash Systems S.A.
http://weblogs.asp.net/hernandl


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top