Skip to content
Putting It All Together
step 1/5

Reading — step 1 of 5

Read

~1 min readProduction

Putting It All Together

Layers built:

LayerLesson
Why hash1
Salts2
PBKDF23
bcrypt4
argon25
Constant-time6
Rehash on login7

What we glossed over:

  • Pepper: a SECRET application-wide value mixed into hashing. Provides defense-in-depth. Stored in env, not DB.
  • Multi-factor auth: TOTP, hardware keys, WebAuthn. Independent layer above passwords.
  • Password policies: complexity rules, length minimums, breach lists (Have I Been Pwned).
  • Account lockouts: throttle login attempts.
  • Password reset flows: secure tokens, expiry, single-use.

Recommendations (2024):

  1. New code: argon2id, m=19MiB, t=2, p=1.
  2. Existing bcrypt: keep, bump cost to 12+.
  3. Anything else: migrate to bcrypt or argon2id ASAP.
  4. NEVER: SHA, MD5, custom XOR schemes.

Use a library. Don't implement primitives yourself. Side channels and parameter choices are subtle.

OWASP's Authentication Cheat Sheet is the best continuously-updated reference.

Discussion

Ask a question, share an insight, or help someone who’s stuck.

Sign in to post a comment or reply.

Loading…