User: Password:
Subscribe / Log in / New account

Encryption vs hashing

Encryption vs hashing

Posted Mar 22, 2012 17:27 UTC (Thu) by drag (guest, #31333)
In reply to: Encryption vs hashing by rvfh
Parent article: Shadow hardening

> I thought these were hashing methods. Is it correct to call them encryption methods?

It's encryption.

It's one-way encryption. Useful for validating the integrity/correctness of data. In this case it is nice for making sure that a password is correct.

That being said I don't really understand the point of using blowfish in this context. It's a general purpose cypher were you are suppose to be able to decrypt the information being encrypted. So this means that if you are able to obtain the key used to encrypt the password data stored in the shadow file then you can recover the password.

This is technically impossible to do with sha256 even if you wanted to. All the data used to encrypt the password can be present on the host system (except the password itself) and it is still impossible for a person with physical access to recover it. The only chance they have is to brute force it or have the user type it into a compromised system.

It's generally a bad idea to have a system were it is actually possible for a administrator to recover a password, if that is the idea. This opens up all sorts of liability and auditing problems. Just a bad idea.

So this seems bad. Unless the shadow files in each directory serve a slightly different purpose then before. I am probably missing something important here.

Basically if the authors feel that sha256 can't be trusted for hashing, then they need to find a different approach. Or they are using Blowfish in a different manner then I understood it to be used.

(Log in to post comments)

Encryption vs hashing

Posted Mar 22, 2012 17:50 UTC (Thu) by drag (guest, #31333) [Link]

I see what I was missing. With OpenBSD the stored hash is created by using the user's password to loop through blowfish a few cycles then encrypt "OrpheanBeholderScryDoubt".

Thats clever.

Encryption vs hashing

Posted Mar 22, 2012 20:08 UTC (Thu) by anselm (subscriber, #2796) [Link]

Or they are using Blowfish in a different manner then I understood it to be used.

The original Unix CRYPT mechanism used DES (with a few minor tweaks), which like Blowfish is a symmetric cypher. The way this worked was that the user-provided password was used as the key to encrypt a constant (usually a vector of null bytes). The result was then encrypted again etc., for a total of 25 rounds (which on a PDP-11 took a reasonable amount of time). This is incidentally why Unix passwords used to be limited to 8 (7-bit) characters, which are just enough to make up a 56-bit DES key.

Blowfish-based password »encryption« operates along the same lines – it uses the password as the key, not the plaintext to be encrypted – but makes use of the password in a more complicated manner.

Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds