Password hashing Argon2id bcrypt

Password Hashing Guide

Password storage needs slow, salted, tunable password hashing. Plain MD5, SHA-1, SHA-256, or SHA-512 are too fast and are not designed for password databases.

Why Plain SHA-256 Is Not Enough

Fast hashes help attackers test billions of guesses. Password hashing raises attack cost with salts, iteration work, and in modern algorithms, memory pressure.

Salt, Pepper, Cost, Memory

Use a unique random salt per password. A pepper is a separate server-side secret. Cost and memory settings should be tuned against your login latency and hardware budget, starting from current OWASP or platform guidance rather than demo defaults.

Algorithm Strength Tuning Limit Best Fit
Argon2idModern defaultMemory and iterationsGood side-channel balanceNew password storage
bcryptVery broad supportCost factor72-byte password limitCompatibility and mature stacks
scryptMemory-hardN, r, p parametersMore complex tuningSystems that already support scrypt
PBKDF2Standards and FIPS contextsIteration countNot memory-hardCompliance or legacy requirements