Win32 DPAPI - Drawbacks?

R

ryan.d.rembaum

I have an ASPX form (.net) that has a connection string in the
web.config file. I have been trying to figure out how to encrypt the
string and have stumbled across the Win32 DPAPI as the recommend tool
of choice since it does not require you store the keys anywhere. I
have a few questions though. If you plan to migrate to a new server,
change the account the the web service runs under, or if the server
were to crash requiring, say, the OS be reloaded, would all be lost or
would the system be able to get the decrypt/encrypt keys through some
sort of domain backup? If the keys are retreivable, then why do people
not recommend encrypting database passwords in this manner, since the
web server could request the encrypted password, unencrypt it and
compare it to the password entered.

Lastly, I was reading that a password might be reuqired to start the
encryption process off. If this is the case, doesn't that bring me
back to the problem of where to store the password?

Thanks,
Ryan
 
D

Dominick Baier [DevelopMentor]

Hello (e-mail address removed),

DPAPI in ASPX typically uses the machine key for enc/decryption. This key
is unique for every machine - and i don't know of an easy way to transfer
that key to another machine. So i would use DPAPI only to store stuff that
stays local on the machine.

Keep a backup of the OS around if you encrypt data with DPAPI that you need
back in cleartext, as opposed to connection strings which can be easily re-created.

My DPAPI tools - maybe interesting for you:
http://www.leastprivilege.com/dpapitools.aspx
 

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

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top