Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

PBKDF2

Direct answer

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.

When to use this

Use this when PBKDF2 is required, for example by FIPS.

First 30 seconds

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.

Operational verification

password + salt + iterations → PBKDF2 → key

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • 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.
Platform / version applicability
Cryptography, PKI and secrets
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCryptography, PKI and secrets
Scope / prerequisiteUse this when PBKDF2 is required, for example by FIPS.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

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.

observation · 1
Key points
  • Uses HMAC with many iterations.
  • Less GPU-resistant than Argon2.
  • Use high iteration counts.
Key checks
  • python3 -c "import hashlib;print(hashlib.pbkdf2_hmac('sha256',b'pw',b'salt'*4,600000).hex())" — PBKDF2 example
  • Iteration count (OWASP: ≥ 600,000 for SHA-256) — cost
  • Salt length — ≥ 16 bytes
ReferenceWhy it matters1 section · depth on demand

Parameters

ParameterRecommendation
PRFHMAC-SHA-256 or SHA-512
Iterations600 000 (SHA-256) or 210 000 (SHA-512) per OWASP
Salt16 bytes random
Output32 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.

ParameterGuidance (OWASP)
PRFHMAC-SHA256 or HMAC-SHA512
Iterations600,000 for SHA-256; 210,000 for SHA-512
SaltUnique, 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCryptography, PKI and secrets current

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%
Confirmation

Confirm action

Continue?