Identity and access Password hashing 4 min read
What is password hashing?
A company’s user database leaks, and every row has a password column. What should an attacker find in it?
-
The site stores a fingerprint, not your password
When you sign up, the app mixes your password with a random salt, runs it through a deliberately slow hash, and stores the result. Your password itself is never saved.
When you sign in, it does the same to what you typed, with the same salt and settings, and compares. Matching fingerprints mean the right password. The fingerprint can’t be turned back into the password.
At sign-up, the app hashes your password with a new salt and stores only the salt and the hash. At sign-in, it reads the salt back, hashes what you typed the same way, and compares the two hashes.
The password is used, then thrown away. Only the fingerprint stays. In short The site can check your password without being able to read it.
-
What a good row looks like
A stored row reads like
argon2id · m=19456,t=2,p=1 · q8Rk2v9LmT1xZp4c · Xf3kP0aQ7nV…: the algorithm, its cost settings, the salt, and the hash.Argon2id is built to be slow and memory-hungry, so guessing billions of passwords costs real time and money. The cost settings say how slow, and get raised as computers get faster.
One way only. To check a password, hash it again and compare. There’s no way back. In short One-way, salted and slow.
-
What bad storage looks like
Argon2id, scrypt and bcrypt with a unique salt are all sound. MD5 and plain SHA-256 are not: they’re fast, so graphics cards try billions of guesses a second.
Encrypting passwords is also a mistake. Nobody ever needs to decrypt a password, and whoever gets the key, often sitting in the app’s config, gets every one.
In short Fast hashes and reversible encryption both turn a leak into a list.
What hashing can’t save
If Priya’s password is password123, Argon2id doesn’t help much. Attackers try common passwords first, and a top-1,000 password falls in the first few guesses.
Hashing protects good passwords; it can’t rescue weak ones. That’s why MFA and checks against breached passwords matter.
Keep this
Store a slow, salted hash. Never the password, and never something you can turn back into it.
Hashing makes a leaked database expensive to crack. It can’t save a password attackers guess first, like password123.- One-way
- You can check a password against the hash, but not get it back.
- Salt
- A random value per user, so identical passwords hash differently.
- Slow
- Argon2id, scrypt or bcrypt make every guess costly.
- Limit
- Weak, common passwords still fall fast.
Questions worth carrying
What’s a pepper?
A secret added to every password before hashing, kept outside the database. If only the database leaks, the hashes can’t be cracked without it.
Why not just use a fast hash with a salt?
Salt stops identical passwords matching, but fast hashes still let attackers try billions of guesses a second. Slowness is the point.