What separates a toy password hasher from a real KDF?
The naive approach — hashing once. SHA-256 of a password runs in nanoseconds. A GPU cluster can try tens of billions of candidates per second. An eight-character password falls in minutes.
Key stretching (PBKDF2, 2000). RFC 2898 defines PBKDF2: apply HMAC-SHA-1 (or SHA-256) c times in a chain, where c is a configurable iteration count. With c = 600,000 (the current NIST recommendation), the attacker must do 600k hash evaluations per guess. This buys time, but iterations are cheap on a GPU — the function is still CPU-parallelizable.
Memory-hard functions (bcrypt, scrypt, Argon2). The key innovation is forcing the algorithm to allocate and use a large block of RAM during computation. GPUs have fast cores but limited per-core memory bandwidth. By requiring, say, 64 MB that must be read in a random-access pattern, the function becomes memory-bound — not compute-bound. Parallelizing across thousands of GPU cores does not help because each core needs its own 64 MB, and the GPU simply runs out of memory.
- bcrypt (1999, Niels Provos & David Mazières): the first widely deployed memory-hard password hash; still sound for passwords, but its 4 KB memory requirement is trivially small for modern hardware.
- scrypt (2009, Colin Percival): tunable memory and CPU cost; influenced Argon2.
- Argon2 (2015, Alex Biryukov et al.): winner of the Password Hashing Competition. Three variants: Argon2d (GPU-resistant), Argon2i (side-channel-resistant), Argon2id (hybrid, recommended). Parameters: memory m (in KB), time t (iterations), parallelism p. Security is proven under the random oracle model and the Ideal Cipher Model.
HKDF (HMAC-based Extract-and-Expand, RFC 5869) solves a different problem: deriving multiple independent keys from one high-entropy secret (e.g., a Diffie–Hellman shared secret). It is fast by design and not suitable for password storage — it has no cost parameter.
Status: well-established engineering, not an open mathematical question. The security of these constructions reduces to the collision resistance of the underlying hash and the assumed hardness of inverting pseudorandom functions. No practical breaks of Argon2id are known. The design space is active but the core primitives are standardized and widely deployed. Compare with the much deeper uncertainty in P vs NP or factoring — KDF security is a matter of engineering tuning, not unsolved mathematics.
Comments
Loading comments...