Re: Hashed PW's more secure than encrypted PW's?

From: Barry Margolin (barmar@genuity.net)
Date: 06/14/02


From: Barry Margolin <barmar@genuity.net>
Date: Fri, 14 Jun 2002 19:26:21 GMT

In article <ufrO8.34200$nZ3.6595@rwcrnsc53>,
sakky <sakhalinrf@hotmail.com> wrote:
>Can anybody explain how is it that hashing is more secure than encrypting?
>The books I've read have stated that the file with those encrypted passwords
>can be decrypted, and I can only assume this would be done via a brute-force
>attack to get the encryption key.

No brute-force would be necessary. It can't be a secret key, because it
has to be the same key all the time in order for password files to be
portable. So it would have to be part of the standard for passwd file
format, and hard-coded into the software used for encrypting passwords.

Asymmetric cryptography would solve this problem to some extent (the
encryption key would be well known, but the decryption key would never be
given out), but it hadn't been invented at the time that Unix password
hashing was developed. It would also allow the person who selected the
common encryption key to decrypt all passwd files in the world; that's
quite a bit of power to put in the hands of one person.

Furthermore, if you did manage to find the key through brute force, you
would only need to do it for one password. Once you accomplished that, you
would be able to decrypt every other password, since they're all encrypted
with the same key.

One-way hashing, on the other hand, solves the problems nicely. There's no
straightforward way to invert it, so the only way to discover the passwords
is by brute force. And each one is independent, so cracking one password
doesn't help you crack any others.

-- 
Barry Margolin, barmar@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.



Relevant Pages

  • [Full-disclosure] Re: choice-point screw-up and secure hashes
    ... > discover your salting algorithm directly). ... a keyed hashing algorithm would be great. ... encryption won't solve the problem. ... help protect the data in transit, it would help protect the data from ...
    (Full-Disclosure)
  • Re: Hashed PWs more secure than encrypted PWs?
    ... >>Can anybody explain how is it that hashing is more secure than ... >>attack to get the encryption key. ... stated above which is that the secret key could be stolen. ...
    (comp.security.unix)
  • Re: Hashed PWs more secure than encrypted PWs?
    ... >>Can anybody explain how is it that hashing is more secure than ... >>attack to get the encryption key. ... stated above which is that the secret key could be stolen. ...
    (comp.security.unix)
  • Re: Hashed PWs more secure than encrypted PWs?
    ... >attack to get the encryption key. ... hashing was developed. ... Furthermore, if you did manage to find the key through brute force, you ... would be able to decrypt every other password, ...
    (comp.security.unix)
  • Secure password storage/transmisson - Internet
    ... encryption and one-way hashing algorithms. ... User sends unencrypted password to authenticating application ... With the asymmetric one-way hashing technique: ...
    (alt.computer.security)