awesome-everything RU
↑ Back to the climb

Security

Password hashing: multiple-choice review

Crux Multiple-choice synthesis across the password-hashing unit — fast-hash failure, salt vs pepper, Argon2id/bcrypt/scrypt parameters, the 72-byte trap, work-factor migration, and timing-safe compare.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 13 min

Six questions that cut across the whole unit. Each mirrors a real decision — what to ship in signup code, how to read a breach, which knob to turn — not a definition to recite.

Goal

Confirm you can connect the threat model (offline cracking), the defenses (slow + salted + memory-hard), the named parameters, and the production footguns — the synthesis the lesson built toward.

Quiz

Your users table leaks with passwords stored as sha256(salt + password), salt unique per user. How bad is it?

Quiz

A teammate proposes both a salt and a pepper. Where does each live, and why two?

Quiz

Why does memory-hardness (Argon2id, scrypt) matter more than raw CPU slowness (e.g. high-iteration PBKDF2) against a real attacker?

Quiz

You must store passwords for brand-new code with no FIPS constraint. Which choice and parameters?

Quiz

An auth-bypass report says two different long passphrases authenticate the same account, both stored with bcrypt. Root cause?

Quiz

Your Argon2id parameters were tuned in 2020 to ~250 ms. Years later a review flags them. What's the standard migration, and how do you compare hashes at login?

Recap

The through-line is one threat model and one defense stack. The attack is offline cracking — a leaked hash column run at full hardware speed (~22 billion SHA-256/sec per GPU), which makes any fast hash the wrong tool. The defense is slow + salted + memory-hard: a per-user salt (not secret, beside the hash) to kill rainbow tables, a vetted KDF with named parameters (Argon2id m=19 MiB/t=2/p=1 preferred, bcrypt cost 10+ or scrypt N=2^17 acceptable, PBKDF2 only under FIPS), an optional pepper kept outside the DB, a work factor you raise on a schedule via rehash-on-login, and the library’s constant-time verify rather than a hand-rolled equality check. Watch bcrypt’s 72-byte truncation trap.

Continue the climb ↑Password hashing: free-recall review
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources2
expand
  1. 01
  2. 02

Trademarks belong to their respective owners. Editorial reference only.