Derived key will appear here
Enter a password and click Derive Key| Algorithm | Min Iterations | Notes |
|---|---|---|
| PBKDF2-HMAC-SHA1 | 1,300,000 | Legacy, avoid for new apps |
| PBKDF2-HMAC-SHA256 | 600,000 | Recommended default |
| PBKDF2-HMAC-SHA512 | 210,000 | Faster on 64-bit systems |
32 -kdfopt digest:SHA256 \password -kdfopt salt:hex:0102030405060708 \100000 PBKDF2Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.
PBKDF2 (Password-Based Key Derivation Function 2) is defined in RFC 2898 and PKCS#5. It derives a cryptographic key from a password by applying a pseudorandom function (typically HMAC) with a salt value, repeating this process many times (iterations) to increase the computational cost of brute-force attacks.
DK = PBKDF2(PRF, Password, Salt, c, dkLen)
| Algorithm | Memory-Hard | GPU Resistant | Standard | Recommendation |
|---|---|---|---|---|
| PBKDF2 | No | Low | RFC 2898 | Legacy compatibility only |
| BCrypt | 4KB | Medium | De facto | Still acceptable |
| Scrypt | Yes | High | RFC 7914 | Good choice |
| Argon2id | Yes | High | RFC 9106 | Best for new apps |
Python (hashlib)
import hashlib
import os
password = b"secret"
salt = os.urandom(16)
key = hashlib.pbkdf2_hmac(
'sha256', password, salt,
iterations=600000, dklen=32
)
Node.js (crypto)
const crypto = require('crypto');
const key = crypto.pbkdf2Sync(
'password', salt,
600000, 32, 'sha256'
);
Java
SecretKeyFactory f = SecretKeyFactory
.getInstance("PBKDF2WithHmacSHA256");
KeySpec spec = new PBEKeySpec(
password, salt, 600000, 256);
SecretKey key = f.generateSecret(spec);
Go
import "golang.org/x/crypto/pbkdf2"
key := pbkdf2.Key(
[]byte("password"), salt,
600000, 32, sha256.New,
)