Skip to content
uencoder

PBKDF2

PBKDF2 (Password-Based Key Derivation Function 2) is the KDF standardized in PKCS#5 that derives keys from passwords via iterated HMAC, widely used for password hashing and key derivation.

Purpose

It derives a high-entropy key from a low-entropy password, with the iteration count multiplying the cost of brute force.

Mechanism

DK = T1 || T2 || ..., where Ti = U1 ⊕ U2 ⊕ ... ⊕ Uc, U1 = HMAC(P, salt || i), Uj = HMAC(P, U_{j-1}). The iteration count c is typically ≥ 100000. It is CPU-hard only and does not resist GPU/ASIC parallelism.

Use cases

  • Wi-Fi WPA2/3 key derivation
  • iOS/Android password backups
  • 1Password key derivation
  • PKCS#12 key storage

Examples

  • Input
    password, salt, c=600000
    Output
    256-bit derived key

    OWASP 2023 recommends ≥ 600000

Common errors

Iteration count too low (e.g., 1000)
Use at least 600000 (OWASP 2023)

Related terms

Related tools

References