Password Attacks & Cryptography · intermediate · ~11 min
Recognise the crypto misuses that show up in code review and JWTs.
Most crypto failures are misuse, not broken algorithms: home-rolled crypto, ECB, reused IV/nonce, hardcoded keys, unauthenticated (non-AEAD) encryption, non-constant-time comparison, weak RNGs, and JWT signing flaws. Fixes: vetted libraries, AEAD, unique nonces, CSPRNGs, constant-time compares, vaulted secrets.
These misuse patterns are exactly what source-code review and pentests turn up — hardcoded keys, nonce reuse, timing-unsafe comparisons — and recommending the correct construction is high-value remediation advice.
Misuse > broken algos. Nonce/IV reuse. Breaks confidentiality, can leak keys (GCM). Hardcoded keys. Top finding. Unauthenticated encryption. Tampering/padding oracles. Timing leaks. Constant-time compare for secrets. Weak RNG. Use a CSPRNG. JWT. alg:none, weak secret.
Strong algorithms fail when used wrong. These misuses are far more common than broken ciphers, and they're what you actually find in code review.
==/memcmp leaks timing → forgeable. Use constant-time comparison (the platform has a C exercise for exactly this).rand()) for keys/tokens. Use a CSPRNG.alg:none, weak HMAC secrets, RS256↔HS256 confusion (cross-reference the Web App Security track).Cryptography is a minefield of usage, not just algorithms. In review, look for these patterns; in remediation, recommend vetted libraries, AEAD modes, unique nonces, CSPRNGs, constant-time comparisons, and secrets in a vault.
Cryptography breaks at the usage layer — ECB, reused nonces, hardcoded keys, missing authentication, timing-unsafe comparisons, weak randomness, JWT flaws. Defend with vetted libraries, AEAD modes, unique nonces, CSPRNGs, constant-time comparisons, and secret vaults.