What is PBKDF2?
PBKDF2 is a key derivation function that converts a password into a cryptographic key by applying a hash function repeatedly, commonly 600,000 times. The repetition is the point: it costs you a fraction of a second once and makes an attacker pay that delay for every guess.
- Topic
- Cryptography
- Also called
- Password-Based Key Derivation Function 2
- Reading time
- 1 min
- Reviewed
On this page
Why the iteration count matters
Each doubling of the iteration count halves an attacker's guessing rate. Going from 1,000 iterations to 600,000 slows them by a factor of 600, which is worth roughly nine extra bits of password entropy without the user changing anything.
OWASP currently recommends at least 600,000 iterations for PBKDF2-HMAC-SHA256. Older software using 1,000 or 10,000 iterations is measurably weaker against modern GPUs.
PBKDF2 versus bcrypt, scrypt, and Argon2
PBKDF2 is compute-hard but not memory-hard, which means specialised hardware can parallelise it efficiently. Argon2id and scrypt additionally require large amounts of memory per guess, which frustrates that hardware. PBKDF2's advantage is universal availability: it is built into the Web Crypto API in every browser, so it runs client-side with no dependencies.
Sources
These primary references support the terminology and current security guidance used in this definition.
