What a Hash Function Does
Collisions and Why They Matter
When MD5 and SHA-1 Are Still Fine
Hashing Passwords: Salting and Slow KDFs
Frequently Asked Questions
Is MD5 safe to use?
Not for anything security-sensitive. MD5 is collision-broken, so it must not be used for signatures, certificates, or tamper detection. It is still acceptable for non-adversarial checksums like detecting accidental file corruption.
Should I use SHA-256 to store passwords?
No. SHA-256 is secure but fast, which is exactly wrong for passwords. Use a slow, salted key-derivation function such as bcrypt, Argon2, or scrypt so each guess is expensive for an attacker.
What is a hash collision?
A collision is when two different inputs produce the same digest. Collisions always exist in theory, but for a secure hash they should be infeasible to find deliberately. MD5 and SHA-1 are broken because collisions can be found.
Why add a salt to a password hash?
A unique random salt per password ensures identical passwords produce different digests and defeats precomputed rainbow tables. It forces an attacker to crack each stolen hash individually rather than all at once.