Use this when PBKDF2 is required, for example by FIPS.
PBKDF2
PBKDF2 derives keys or password hashes by running HMAC many times with a salt. It is standardized and FIPS-approved, but less resistant to GPU cracking than bcrypt, scrypt or Argon2, so use high iteration counts.
1. PBKDF2: iterated HMAC; FIPS-approved.
2. Not memory-hard — GPUs attack it efficiently.
3. High iteration counts.
4. Use when FIPS requires.
5. Prefer Argon2id otherwise.
password + salt + iterations → PBKDF2 → key
Context & applicabilityCommon mistakes · platform/version boundaries
- Iteration counts from old guides (1,000 or 10,000).
- Using PBKDF2-HMAC-SHA1 with output longer than 20 bytes (doubles the defender's work, not the attacker's).
- Same salt for all users.
- Using PBKDF2 output directly as several keys without HKDF.
Operational reference
Fast context before you go deeper.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Uses HMAC with many iterations.
- Less GPU-resistant than Argon2.
- Use high iteration counts.
ReferenceWhy it matters1 section · depth on demand
Parameters
| Parameter | Recommendation |
|---|---|
| PRF | HMAC-SHA-256 or SHA-512 |
| Iterations | 600 000 (SHA-256) or 210 000 (SHA-512) per OWASP |
| Salt | 16 bytes random |
| Output | 32 bytes |
PBKDF2 needs little memory, so GPUs crack it much faster than Argon2 or scrypt. Use it where FIPS 140 approval is required (it is used in WPA2-PSK, LUKS1 and many enterprise products).
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
PBKDF2 (Password-Based Key Derivation Function 2) derives keys or password hashes by applying an HMAC (usually HMAC-SHA256) many thousands of times with a salt. The iteration count makes each guess expensive. It is widely supported and FIPS-approved, which is why it remains common in regulated environments.
| Parameter | Guidance (OWASP) |
|---|---|
| PRF | HMAC-SHA256 or HMAC-SHA512 |
| Iterations | 600,000 for SHA-256; 210,000 for SHA-512 |
| Salt | Unique, random, at least 16 bytes |
PBKDF2 is not memory-hard, so attackers with GPUs gain more advantage than against Argon2id or scrypt. Prefer Argon2id for new systems unless FIPS compliance requires PBKDF2.
ReferenceConfiguration & state1 section · depth on demand
Example (Python)
import hashlib, os
salt = os.urandom(16)
dk = hashlib.pbkdf2_hmac('sha256', b'password', salt, 600_000)
Documented example, not captured output. PBKDF2 is not memory-hard, so GPUs crack it faster than Argon2/scrypt; it remains common because it is FIPS-approved.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hashing → PBKDF2. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://csrc.nist.gov/pubs/fips/180-4/upd1/final · confidence 94%