>What is the best way to secure a password/secret key in this context?
the traditional way is not to store the literal or encrypted password,
just a digest of it. You can then check the password by computing the
digest as seeing if it matches the digest on file. See
http://mindprod.com/jgloss/digest.html
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Martin - 05 Mar 2004 07:41 GMT
Yes I'm using a hash to store the users web password- with JAAS and form
based authentication. I don't know how to get hold of this password in
clear text so I can use it for Password Based Encryption, leaving me to use
another password to form the key for encryption/decryption of other
sensitive data, and it's that second password I need to protect.
For the record I'm using JAAS DatabaseServerLoginModule from JBoss.
Martin
> >What is the best way to secure a password/secret key in this context?
>
[quoted text clipped - 7 lines]
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
nobody - 07 Mar 2004 19:34 GMT
>>What is the best way to secure a password/secret key in this context?
>
[quoted text clipped - 4 lines]
>
> --
He's looking for key storage, however (as opposed to authentication); a
digest can be used to verify knowledge of the correct password, but he
needs the actual password itself to derive a key for encryption/decryption.
At some point, this generally ends up "bubbling up" to storage of the
password (i.e., in a properties file or other configuration file). You
would want to isolate this as much as possible, but there isn't a
one-size-fits-all solution. WebLogic, for example, can encrypt the
passwords used for JDBC connections; this is based on a password entered
at startup of the application server. To start it up without manually
entering the password requires hardcoding the password in the startup
script -- which gets you back to your original problem (securely storing
the password).
Martin - 08 Mar 2004 14:51 GMT
Spot on, nobody.
I need a similar "bootstrap" for JBoss (3.2.3)
Thanks
Martin
> >>What is the best way to secure a password/secret key in this context?
> >
[quoted text clipped - 18 lines]
> script -- which gets you back to your original problem (securely storing
> the password).
Martin - 08 Mar 2004 18:43 GMT
I could set a system property from the command line, and read that in the
code, but how secure is that - presumably anyone could read it.
Am I chasing my tail?
Thanks
Martin
> Spot on, nobody.
>
[quoted text clipped - 26 lines]
> > script -- which gets you back to your original problem (securely storing
> > the password).
Shane Petroff - 09 Mar 2004 06:01 GMT
> Am I chasing my tail?
AFAIK, yes.
I'm just learning this stuff myself, but the only strategy I can imagine
is to try to mitigate the insecurity of a falliable password by using
another 'layer'. This is essentially what CA's do with their private
keys. Keep a master key on a tamper-resistant piece of hardware (e.g.
one of those $50 USB tokens) and use it to sign intermediate certs.
Those intermediate could be shorter duration and are more expendable
than the primary. The primary is held offline and can only be accessed
via interactive passwords submitted directly to the token. The
intermediate cert is then accessed by your application via a password
stored in a config file. The config file is protected via the OS's
permissions. Anyone who can get around the OS to read the config file
can access the intermediate cert, but not the primary.
I'd also like to see some 'best practices' for managing PKI.
Shane