How it works · 10 of 34 Core
What are password hashing and salting?
A fingerprint you can't reverse
Hashing & salting: A hash turns any input into a fixed-length fingerprint that can't be turned back; sites store hashes of passwords, not the passwords, and add a random salt per user so identical passwords get different fingerprints and pre-computed tables stop working.
Loading the animation…
Say it like this A site should store a salted, slow hash of your password, never the password: it can check a match, it can't reverse it, and every guess costs the thief real time.
Under the hood — for builders
- Real example: the card's patties
- A hash (here MD5, an old fast one) always gives 32 hex characters. Same input, same output; one character changed, a new output; salt makes twins differ:
- How fast a thief guesses
- Fast hashes were built for speed, which helps the thief. Guesses a second on one gaming graphics card, log scale:
- What a slow, salted hash buys
- Time to try every candidate on that card. Fast MD5 against bcrypt at cost 5:
- Anatomy of a real stored password
- What a site using bcrypt really stores for Mumbai@123. Hash the same password twice and both strings differ, because each gets fresh salt:
- Hash ≠ encryption
- Encryption (B1) comes back with the key. A hash never comes back; it can only be guessed and compared.
- What to use
- OWASP: Argon2id (19 MiB memory, 2 passes) first; bcrypt with cost 10+ where Argon2id isn't available.
- Measure it
- Ask a vendor which hash, which settings, and whether each user gets their own salt.
- Watch out
- bcrypt reads only the first 72 bytes. And no hash saves a password that is on a leaked list.
- Sources
- hashcat v6.2.6 RTX 4090 benchmark (Chick3nman, Oct 2022) · OWASP Password Storage Cheat Sheet · Diceware word list (7,776 words) · MD5: RFC 1321.
What happens in the hashing & salting animation, step by step?
- A site doesn't store your password. It minces it into a fingerprint, a hash, that can't be turned back.
- When you log in, it minces what you typed and compares patties. Same patty, right password.
- A thief steals the tray. Asha and Ravi chose the same password, so their patties match, and a cookbook of pre-minced common passwords cracks both at once.
- Your turn: the thief's graphics card tries 164 billion fast hashes a second. Which stolen patty falls first?
- Salt makes every patty different, so the cookbook is useless. A slow hash like bcrypt cuts the guessing from billions to 184,000 a second.
- A fingerprint proves a password matches. Locked with a private key, it can prove who wrote a letter too. Next: digital signatures.
What everyday example explains hashing & salting?
Mincing meat: you can tell two patties came from the same cut, but you can't rebuild the steak. A pinch of salt unique to each cook makes two patties from the same cut taste different.
Why should a team care about hashing & salting?
If you build a login, never store passwords with a fast hash like MD5 or SHA-256; use Argon2id or bcrypt with a salt, and ask the same of any vendor that holds your staff's passwords.