Hashing vs "One-way Encryption"

You are correct. Hashing is not invertible and encryption is. The security expert is talking through his hat.

The "pepper" that cpast is talking about is the key of a keyed hash. In that case, there are three components in the input to the hash algorithm: the password, the salt, and the key. If the database is compromised, the salt is compromised, but the key is not. If the key is of non-trivial length, like 128 bits, recovering the password from hash and salt alone is probably not possible. (Strictly speaking, it is an "intractable" problem. One knows how to to it -- try all possible key values -- one just cannot do it in reasonable time.)


I suppose that the term "one way encryption" gets back to the days when no cryptographic hash function was available, so to get a password hash on Unix systems for instance an encryption function was used (DES). However, instead to provide a fixed key to encrypt the password (normal usage of this algorithm but which would allow to decrypt the password using this same key), the password itself was used both as the key and as the data to encrypt.

By this way, a one way encryption was achieved since there was no way to decrypt the password without already knowing it.

Afterward, time went on, a lot of people including highly qualified mathematicians and high-profile security engineers worked on the subject, and provided us better tools for each needs (here: password hashing functions). Nowadays no one should therefore try to tinker with existing algorithms to use them in an inappropriate way (an encryption is used to encrypt text, and not to produce a hash).


In standard techie talk, "one way encryption" means hashing. Although technically hashing is a distinct operation from encryption, they are both "cryptographic primitives" and it is common (although technically incorrect) to refer to all cryptography as encryption. Being pedantic with your colleague about this point is unlikely to win you any friends. When speaking to people who are not security specialists I usually use the phrase "one way encryption" as it is more widely understood.

As an aside, it is possible to make any block hash operation into a symmetric cipher, and any symmetric cipher into a block hash operation. There's some info on Wikipedia and Bruce Schneier discusses this in more detail in his book "Applied Cryptography".