Cryptographic hash functions · 08 FAQ

Hash functions: frequently asked questions

Short answers to the most common doubts about cryptographic hash functions.

Is a hash function a form of encryption?

No. Encryption is reversible with the key; a hash function is not, and uses no keys.

Can two different files have the same hash value?

In theory yes, because the possible values are finite. With robust functions such as SHA-256, however, finding two is practically impossible.

Can MD5 still be used?

To spot duplicate files or transmission errors, yes; for any security purpose, no, because collisions are easy to find.

Is SHA-3 better than SHA-2?

It is not more secure in practical terms: both are considered robust. SHA-3 has a different architecture that makes it immune to some structural attacks, such as length extension.

Why are passwords not stored with SHA-256?

Because it is too fast: whoever steals the database can try billions of passwords per second. Slow, salted functions designed for the purpose are needed.

What is a “salt”?

A random value, different for each password, added before computing the hash: it prevents the use of precomputed tables and the recognition of identical passwords.

↑