Win32 DPAPI - Drawbacks?

Discussion in 'ASP .Net Security' started by ryan.d.rembaum@kp.org, Nov 14, 2005.

  1. Guest

    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
     
    , Nov 14, 2005
    #1
    1. Advertising

  2. Hello ,

    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

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > 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
     
    Dominick Baier [DevelopMentor], Nov 15, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucas Tam
    Replies:
    2
    Views:
    2,393
    bruce barker
    Jul 15, 2004
  2. Logician
    Replies:
    6
    Views:
    1,915
    S. Justin Gengo
    Sep 19, 2005
  3. munni

    drawbacks of linux

    munni, Feb 8, 2006, in forum: C Programming
    Replies:
    1
    Views:
    359
    Chris Dollin
    Feb 8, 2006
  4. munni

    drawbacks of linux

    munni, Feb 8, 2006, in forum: C Programming
    Replies:
    0
    Views:
    351
    munni
    Feb 8, 2006
  5. munni

    drawbacks of linux

    munni, Feb 8, 2006, in forum: C Programming
    Replies:
    9
    Views:
    427
    santosh
    Feb 10, 2006
Loading...

Share This Page