Security and auth / Beginner / 5 min / Updated
Password hashing: bcrypt, salts and a leaked database
An attacker has your users table. MD5, SHA-256, bcrypt or Argon2, salt or no salt: watch how fast 10,000 passwords fall on GPUs.
Start the simulation → Change the load, break a part, watch what happens. Free, no sign-up.
In short
What is password hashing?
Passwords are stored as slow, salted hashes (bcrypt, scrypt, Argon2), never in plain text or with fast hashes like MD5.
Why does it matter?
Databases leak. A slow hash with a unique salt makes each guess expensive and forces the attacker to attack every user separately.
What is the trade-off?
Higher work factors protect users better but cost server CPU on every login; tune it to about 100-300 ms and rehash on login.
How do you explain it in an interview?
"Argon2id or bcrypt cost 12 with per-user salts, block breached and common passwords, rate-limit logins, offer 2FA and passkeys."
Check yourself
Why is MD5 or SHA-256 a bad way to store passwords?
Answer: They are fast, so GPUs try billions of guesses per second. Password hashes must be slow on purpose; bcrypt, scrypt and Argon2 make each guess expensive.
What does a unique salt per user stop?
Answer: Precomputed tables and testing one guess against every user at once. With salts, the same password gives different hashes, so each user is a separate attack.
You raise bcrypt cost from 10 to 12. What happens?
Answer: Each guess and each login take 4 times as long. Each cost step doubles the work. Pick the highest cost your login servers can afford (about 100-300 ms).