b2KIT

PBKDF2 Key Derivation Tool

Derive cryptographic keys from passwords using PBKDF2 with SHA-256 or SHA-512 and configurable iteration counts.

Tested tool guide Tested browser tools Checked August 16, 2026

What PBKDF2 Key Derivation Tool does, with a checked example

This tool derives a fixed-length cryptographic key from a password using PBKDF2, the password-based key derivation function behind most legacy password storage. You supply the password, a salt, an iteration count, and either SHA-256 or SHA-512; the tool runs the derivation in your browser and returns the derived key as hex. Nothing is uploaded. The surprise most users hit: the result is all-or-nothing. Change the salt, the iteration count, or the hash function and the output changes completely, so the same password never produces the same key twice unless every parameter matches exactly.

Worked example

A concrete input and expected output from the current implementation.

Input

password: password | salt: salt | iterations: 1 | hash: SHA-256 | output length: 32 bytes

Expected output

120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b

This is the published known-answer test vector for PBKDF2-HMAC-SHA256 from RFC 7914, so any correct implementation returns exactly this hex. The 1-iteration count exists only to verify implementations; real use needs hundreds of thousands of iterations.

How the result is produced

1

What PBKDF2 computes

PBKDF2 builds the key from blocks of hLen bytes each, where hLen is the hash output length: 32 for SHA-256, 64 for SHA-512. For each block it runs HMAC keyed by the password, first on the salt plus a block index, then repeatedly on its own previous output, c times in total, and XORs the c results together. Defined in RFC 8018 section 5.2; the blocks concatenate into the final key.

2

What the iteration count does

The iteration count is the work factor. Every verification repeats the full HMAC chain c times, and an attacker guessing passwords pays the same cost per guess, which is the entire point. One iteration returns in microseconds; current guidance runs to hundreds of thousands. Output length multiplies cost too: each extra block is a full c-iteration pass, so request only the bytes you need.

Good uses

  • Reproduce a stored PBKDF2 hash when auditing or migrating a user database: enter the recorded salt, iteration count, and hash function, and compare the hex with what the database holds.
  • Build a deterministic test fixture: a fixed password, salt, and iteration count yield a stable expected key you can assert against in unit tests, verifiable across languages.
  • Confirm that two implementations agree before wiring systems together: Python's hashlib.pbkdf2_hmac, OpenSSL, and a hardware token should all emit identical bytes for identical inputs.

Limits and checks

  • The output carries no error signal. Any difference in password, salt, iteration count, or hash function yields a different but perfectly plausible key, so a non-matching result only tells you some input differs, never which one.
  • The salt is not secret; systems store it beside the hash. Its job is uniqueness, not secrecy: a shared salt makes identical passwords derive identical keys, which exposes duplicates. The derived key itself is secret material and should not be shared.
  • Raising the iteration count does not strengthen hashes already stored: they were derived at the old count and stay cheap to attack. Only re-deriving every password at the new count, or forcing users to reset, applies the new work factor, and every login then pays it in full.

Common questions

Can I use this to verify a password against a stored hash from my own database?

If the stored hash is plain PBKDF2, yes, provided you have the salt and iteration count recorded alongside it, as most systems do. Enter them with the candidate password and compare the hex. But if the site mixed in an extra secret (a pepper) before deriving, or used a hash this tool does not offer (older systems used PBKDF2-HMAC-SHA1), the result will not match.

How many iterations should I choose?

Current OWASP guidance is 600,000 iterations for PBKDF2-HMAC-SHA256, or 210,000 for SHA-512. More iterations mean safer hashes but slower logins, so choose the highest count your slowest login path tolerates. PBKDF2 uses CPU alone with little memory, so dedicated hardware attacks it efficiently; OWASP's preferred function is Argon2id, with PBKDF2 remaining the standard where FIPS compliance is required.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools