The derived key is only reproducible with the same salt and parameters, so store those too. The encoded option bundles them into one string.
PBKDF2 Hash Generator
Derive a key from a password with PBKDF2.
About the PBKDF2 Hash Generator
What is a PBKDF2 hash?
PBKDF2 (Password-Based Key Derivation Function 2) is one of the oldest and most widely supported ways to turn a password into a cryptographic key or a stored password hash. It works by running an underlying hash such as SHA-256 many thousands of times, so that guessing each candidate password becomes slow. You control the iteration count, the hash, the salt and the output length.
PBKDF2 is everywhere: it protects Django and Werkzeug password databases, WPA2 Wi-Fi keys, 1Password and other vaults, and countless file-encryption tools. It is not memory-hard like scrypt or Argon2, so a high iteration count is essential; OWASP suggests hundreds of thousands of iterations for SHA-256. This tool uses your browser's native Web Crypto implementation, so it is fast and fully private.
How to Use This Tool
- Enter the password. Type or paste the password you want to hash.
- Adjust the settings. Tune the cost parameters and salt; the hash recomputes automatically.
- Copy the result. One click copies the hash to your clipboard.
- Store it safely. Keep the salt and parameters so the key can be reproduced.
Common Use Cases
- Django and Flask password hashes: the encoded output here matches Django's pbkdf2_sha256 format.
- Deriving encryption keys: turn a passphrase into an AES key with a known salt and iteration count.
- Wi-Fi and standards compliance: PBKDF2 underlies WPA2 and many FIPS-compliant systems.
- Cross-platform hashing: PBKDF2 is supported virtually everywhere, making it a safe interoperability choice.
Frequently Asked Questions
How many iterations should PBKDF2 use?
As many as your system can afford. Current OWASP guidance is around 600,000 iterations for PBKDF2-HMAC-SHA256 and 210,000 for SHA-512. The number is stored alongside the hash, so you can raise it over time. More iterations mean slower cracking but also slower logins, so benchmark on your hardware.
Which PRF should I choose, SHA-256 or SHA-512?
SHA-256 is the most common and interoperable choice and is what Django uses by default. SHA-512 produces a longer internal state and can be marginally stronger, but requires more iterations to reach equivalent cost on some hardware. Avoid SHA-1 for new applications.
Is PBKDF2 as good as bcrypt or Argon2?
PBKDF2 is secure when configured with a high iteration count, but it is not memory-hard, so it is more vulnerable to GPU and ASIC attacks than scrypt or Argon2. It remains a solid, standards-approved choice, especially where compatibility matters, but Argon2id is preferred for brand-new password storage.
What is the Django hash format?
Django stores PBKDF2 hashes as pbkdf2_sha256$iterations$salt$hash, with the salt and hash Base64-encoded. Selecting the encoded output option here produces that exact format, so you can drop it straight into a Django user record.
Do I need to store the salt and iterations?
Yes. PBKDF2 is only reproducible with the same salt, iteration count, PRF and key length, so keep them with the hash. The encoded output bundles them together for you.
Is my password uploaded anywhere?
No. PBKDF2 runs through your browser's built-in Web Crypto API. Your password and the derived key never leave your device.