Cryptographic Failures & Password Storage — OWASP Top 10
Protect data in transit (TLS everywhere, HSTS) and at rest (encryption, key management), and never invent your own crypto. Common failures Failure Fix Passwords hashed with MD5/SHA-1/SHA-256 slow, salted KDF: Argon2id, scrypt, bcrypt, PBKDF2 (600k+ iterations) Hard-coded keys / secrets in Git secret manager (Vault, AWS Secrets Manager, Key Vault) + rotation random for tokens secrets module / CSPRNG Comparing MACs with == constant-time hmac.comparedigest ECB mode, static IVs authenticated encryption: AES-GCM, ChaCha20-Poly1305 HTTP or TLS 1.0/1.1 TLS 1.2+ only, HSTS Sensitive data in logs/URLs classify data, minimise, mask Store only what you need — data you don't keep cannot leak.
Key Takeaways
Hash passwords with a slow, salted KDF such as Argon2id, scrypt or bcrypt.
Generate tokens with a CSPRNG (secrets) and compare secrets in constant time.
Use TLS 1.2+ with HSTS for data in transit and AES-GCM for data at rest.
Keep keys in a secret manager and rotate them — never in source control.