b2KIT

PBKDF2 Key Derivation

Derive cryptographic keys from passwords using PBKDF2 with configurable iterations, salt, and hash algorithm.

Tested tool guide Tested browser tools Checked August 16, 2026

What PBKDF2 Key Derivation does, with a checked example

PBKDF2 (Password-Based Key Derivation Function 2, specified in PKCS #5 / RFC 8018) converts a password into a fixed-length cryptographic key. It combines the password with a salt, then applies HMAC with your chosen hash algorithm (SHA-1, SHA-256, SHA-512) repeatedly, a configurable number of times; the iteration count is the work factor that makes guessing expensive. The tool runs that computation in your browser and returns the key as hexadecimal. What surprises most users: the result is deterministic and one-way. Identical inputs always produce identical output, but the key cannot be decrypted back into the password, and changing any single parameter produces a different result.

Worked example

A concrete input and expected output from the current implementation.

Input

password: password | salt: salt | iterations: 4096 | hash: SHA-1 | output length: 20 bytes

Expected output

4b007901b765489abead49d926f721d065a429c1

This is test case 3 in RFC 6070, the standard conformance suite for PBKDF2: password "password", salt "salt", 4096 iterations, HMAC-SHA-1, 20-byte output. Because the derivation is deterministic, the tool reproduces the published vector byte for byte; changing any parameter changes the entire string.

How the result is produced

1

Iterated HMAC construction

PBKDF2 generates the key in blocks. For block index i, it computes HMAC over the salt with a 4-byte counter appended, using the password as the HMAC key, then feeds the result back through HMAC again for c iterations total. The block is the XOR of all c intermediate values; blocks are concatenated to the requested length and truncated. Cost scales linearly with the iteration count.

2

Deterministic inputs

The output is a pure function of five values: password, salt, iteration count, hash algorithm, and output length. No randomness is involved, so identical inputs always yield identical keys, and any change scrambles the entire result. The salt must be stored alongside the derived key if the key is to be reproduced, and a unique salt per password keeps equal passwords from deriving equal keys across users or records.

Good uses

  • Generate an AES encryption key from a shared passphrase once you and a collaborator have agreed on the salt, iteration count, and hash algorithm.
  • Verify a PBKDF2 configuration against published test vectors such as RFC 6070 before wiring it into an application or a data format.
  • Reproduce a derived key for a system that mandates PBKDF2, such as WPA2 Wi-Fi, which derives its pairwise master key from passphrase and network name.

Limits and checks

  • One-way by design: the tool cannot turn its output back into the password, and there is no partial-match signal - compare the full hex strings exactly.
  • Every parameter matters: an off-by-one iteration count, a single changed salt byte, or a different hash algorithm produces an entirely different key, with no warning.
  • Defaults can be weak: an older common default of 1,000 iterations is far below current practice. OWASP currently recommends 600,000 iterations of PBKDF2-HMAC-SHA256 for password hashing, and memory-hard KDFs (bcrypt, scrypt, Argon2) are generally preferred for new systems because PBKDF2 parallelizes cheaply on GPUs.

Common questions

Can the tool decrypt the derived key back into my password?

No. PBKDF2 is a one-way derivation, not encryption; no inverse operation exists. Even with the salt and iteration count, the password cannot be recovered from the key. Verification works by re-running the derivation with a candidate password and comparing the hex output exactly - one guess at a time, which is why iteration count matters.

Why does a higher iteration count make the tool take so much longer?

Each iteration is a complete HMAC computation, and PBKDF2 chains them in sequence, so doubling iterations roughly doubles the run time. That deliberate cost is the security property: an attacker pays it for every password guess. Tools that derive keys with a few iterations are fast but weak; current guidance puts the count in the hundreds of thousands.

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