Two villagers share a password in the post’s book: does plain SHA-256 tell their rows apart? A salt each, real PBKDF2, iterations timed in your browser. An…
Why it matters
A database leak is a question of when, not if. What decides your users’ fate when it happens is how their passwords were stored: a fast hash with no salt opens common passwords in minutes, while a unique salt and a deliberately slow hash make every guess expensive.
The key idea
A fast hash is wrong for passwords; salt and slowness guard them
Common mistakes
Passwords hashed with plain SHA-256, feels safe but falls in minutes SHA-256 is built to be fast, for checking files; a guesser with a graphics card makes billions a second. Use a password hash that is slow on purpose and salted: Argon2id, scrypt, bcrypt, or PBKDF2 with high iterations (OWASP: 600,000 for PBKDF2-SHA256).
One global salt for every user, twin passwords still look like twins A salt must be unique per person and random, made fresh each time a password is stored. One shared salt lets the same password still give the same hash, and one guess opens them all.
Worried the salt leaks, when it is stored in the open in the hash line A salt is not a secret: it is written in the line (pbkdf2_sha256$600000$<salt>$<hash>, or $2b$12$… for bcrypt) because checking needs it. Its job is to make every hash unique, not to be a key.
Try it in this playground
See two equal passwords make twin rows SHA-256 with no salt: Wulan’s and Bagas’s rows are identical.
Give each person a salt The passwords stay the same, the rows differ wholly.
Measure SHA-256 in your browser How many guesses a second one tab can make.
Raise the iterations to 100,000 or more One login is still a blink, the guesses a second fall far.