PBKDF2 Key Derivation/Verification
Online PBKDF2 key derivation and verification tool with SHA-1/SHA-256/SHA-384/SHA-512, configurable iterations and key length, random salt generation, and derived-key verification.
OWASP 2023 recommends at least 310,000 iterations for PBKDF2-SHA256. Higher iterations increase brute-force resistance.
PBKDF2 Documentation
PBKDF2 (Password-Based Key Derivation Function 2) is defined in RFC 8018. It raises attack cost with repeated HMAC rounds and is widely used for password-based key derivation.
PBKDF2 is used in password storage, file encryption, and protocol key derivation. It is especially useful where NIST/FIPS compatibility is required.
How It Works
PBKDF2 takes password, salt, iterations, and output length, then repeatedly applies HMAC and combines output blocks.
- Input password, salt, iteration count, and target key length
- Run HMAC using password as key and salt+counter as message
- Repeat rounds and XOR intermediate outputs per block
- Concatenate blocks to obtain the final derived key
OWASP Iteration Guidance (2023)
Recommended iteration counts differ by hash algorithm. Tune values against security goals and performance budget.
| Hash | Minimum | Recommended |
|---|---|---|
| PBKDF2-SHA256 | 310,000 | 600,000+ |
| PBKDF2-SHA384 | 210,000 | 500,000+ |
| PBKDF2-SHA512 | 120,000 | 210,000+ |
| PBKDF2-SHA1 | 1,300,000 | Not recommended |
Common Use Cases
- Deriving AES/ChaCha20 keys from user passphrases
- Password verification in authentication systems
- Master-password key derivation in password managers
- Disk encryption and secure container key generation
PBKDF2 vs Bcrypt vs Argon2
- PBKDF2 offers strong standards and broad compliance support
- Bcrypt remains common in legacy stacks
- Argon2 provides stronger memory hardness for new systems
Security Best Practices
- Use unique salts with at least 16 bytes
- Store salt with the derived key; salt is not secret
- Increase iterations over time as hardware improves
- Prefer Argon2id for new systems, keep PBKDF2 for compliance scenarios
References
- RFC 8018 (PKCS #5 v2.1)
- OWASP Password Storage Cheat Sheet
- NIST SP 800-132