Review common password-storage failures, including fast hashes, reused salts, weak parameters, truncated outputs, custom schemes, and unsafe migration practices.
Password storage often fails through ordinary implementation choices rather than exotic cryptanalysis. A team selects a fast hash, reuses one salt, truncates a library output, keeps obsolete parameters, or creates a fallback path that bypasses the main design. Reviewing these mistakes is useful because each one has a practical fix.
General-purpose hashes are designed for speed. That helps attackers test offline password guesses. A longer output does not turn SHA-256 into a password function. Use Argon2id, scrypt, bcrypt, or an appropriately configured PBKDF2 implementation.
The article why MD5 should never be used for passwords explains why collision weakness is only part of MD5’s problem. Guessing cost is the central password-storage concern.
Unique random salts stop identical passwords from sharing a stored value and defeat reusable precomputed tables. They do not slow each fresh guess enough when the underlying function is MD5 or SHA-256.
Use a salt and an expensive password function. Let the library generate and encode the salt rather than building it from a user ID or timestamp.
A global value may force attackers to precompute specifically for your application, but it still lets them reuse work across every account. If the value is stored in the application or database, it will often be exposed with the rest of the system.
Every password record needs its own random salt. An optional global secret is a pepper, which has different storage and rotation requirements.
Password-hashing cost settings age. Hardware gets faster, cloud resources become cheaper, and application architecture changes. A configuration selected years ago may now be too cheap.
Benchmark on production-class systems, define a target verification cost, and revisit it regularly. Store parameters with each record so older values remain verifiable while active users are upgraded.
Repeated MD5, SHA-256 in a homemade loop, secret prefixes, and mixed algorithms may look stronger but lack the review, test vectors, and interoperability of standard password functions. Encoding and length mistakes are common.
Use a high-level library API. It should hash, verify, encode parameters, generate salts, and identify records that need rehashing.
Some bcrypt implementations use only the first 72 bytes. A user may believe a longer password adds protection while the application ignores the remainder. Unicode characters also occupy a variable number of bytes in UTF-8.
Understand the exact library behavior. Do not silently cut input. If legacy compatibility forces a limit, document it, test boundary cases, and plan migration to a function that handles long inputs cleanly.
Self-describing password strings can be longer than old database columns. Silent truncation may make accounts unverifiable or, worse, remove important parameter data in a way that creates inconsistent fallback behavior.
Size columns for current and future formats. Test round trips through databases, ORMs, APIs, exports, replicas, and backups.
Developers sometimes parse encoded values, recalculate a digest, and compare strings with ordinary equality. This can introduce format errors and timing differences. Use the library’s verification function, which understands its own encoding and comparison requirements.
Passwords can leak through request logs, debug traces, analytics events, error reports, queue payloads, and support screenshots. Hashing them correctly in the database does not protect those copies.
Redact password fields at the earliest logging boundary. Test observability systems and disable body capture on authentication endpoints.
The main registration flow may use Argon2id while imported users, mobile clients, admin-created accounts, or old API versions still write MD5. Attackers target the weakest path.
Inventory every function that creates, changes, verifies, resets, or migrates a password. Centralize operations in one authentication service or shared library.
If the application stores encrypted passwords, anyone who obtains the decryption key can recover every credential. User passwords normally do not need recovery. Store a verifier and provide a secure reset flow instead.
Password storage can be excellent while recovery is predictable or long-lived. Generate random, single-use, expiring tokens. Bind them to an account and purpose, and invalidate them after use. Consider storing only a hash of the reset token.
Argon2id protects against offline guessing after a database breach. It does not stop unlimited attempts against the live login form, credential stuffing, phishing, or session theft. Add rate limits, anomaly detection, multifactor authentication, secure cookies, and protected recovery.
A secure design should identify outdated records and upgrade them after successful login. Without that mechanism, parameters remain frozen until a disruptive reset project.
Use an explicit algorithm marker or self-describing format. Test rehash behavior during library updates and infrastructure changes.
A checklist may require salted hashing but leave room for obsolete parameters or weak operational controls. Compliance can set a minimum; threat modeling and measurement must complete the design.
Centralize password operations, provide tested wrappers, remove old helpers, and add automated checks for forbidden algorithms. The best design does not depend on every developer remembering every cryptographic detail. It makes secure defaults automatic and legacy exceptions visible, temporary, and measurable.