473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

HOW TO: store keys?

I'm new to ASP.NET, so I'm trying to write a simple store front to get me
into things. Obviously with users and such, I need to encrypt the passwords.
No problem there. I wrote a little encryption / decryption routine to
provide a 2 way mechanism (to allow for emailing users the passwords). I'm
using TripleDESCryptoServiceProvider with the EncryptedXml class.

Anyways, I end up with a string (base-64 encoded version of the encrypted
password). I store the encrypted version of the string in a SQL database as
a varchar type.

Now the question is, where can I store the decryption key? I can't store it
in the Session or Application objects for obvious reasons. I need to have
the same key for decrypting even if the server is shut down.

I was storing it in the registry, under HKLM\Software\MyCompany, but somehow
while googling tonight, I stumbled onto the fact that in a deployed real
world environment, the web site is going to run under the ASPNET user which
wouldnt have access to the registry key, but the development server runs
under my own user account which does.

Should I be storing it in the registry? or in the database? or where? I kind
of frowned upon storing it in the same place as the encrypted passwords, so
if a hacker compromised one place or another, he wouldn't have the plaintext
passwords.

A file of some sort in the App_Data directory seems equally hokey.

NOTE: Basically the key is generated by the DES provider the first time a
string is encrypted. That key is stored in the registry and used from then
on.

Any insight on where the keys should be stored would be appreciated.
Nov 2 '06 #1
0 1169

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

Similar topics

4
by: Christopher Brandsdal | last post by:
Hi! I have a delicatg problem.... I have made a registration form for adding my friends information in a database. The problem is that I want to connect the persons with companies in the same...
2
by: Peter Rilling | last post by:
How does Windows store passwords that it uses? For instance, when you install a service, you can provide it the username and password. This information is stored somehow so that at a later date...
9
by: VMI | last post by:
I have two tables and I want to compare these two tables with a query( ie. "select * from A where B.key = A.key") and the result will be stored in a 3rd table (table C). is this possible? If...
8
by: JackRazz | last post by:
Is it possible to create a hashtable that doesn't store the key? I have a very large hashtable and I just want it to store the HashCode and the Value (two Int16s). Thanks - JackRazz
3
by: Darren Clark | last post by:
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...
1
by: David | last post by:
One thing that's always puzzled me about implementing encryption on remote asp.net apps is where to store the keys. The demo code indicate that you include them in a configuration file, but this...
2
by: sandeepkishanj | last post by:
please tell me which collection variable (or something else) should i use to store and retrieve the following sample data... i have the following in drop down list1.. Asia North America when...
3
blackstormdragon
by: blackstormdragon | last post by:
Here were our instructions: "My mother always took a little red counter to the grocery store. The counter was used to keep tally of the amount of money she would have spent so far on that visit to...
7
by: arnab0143 | last post by:
Hi All, I'm using Crypt::RSA module for generating public & private keys. Now the problem is that when I'm storing the keys in the database, and again bringing them to do the signature or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.