← Back to the tool

Foundations · Under the hood

PBKDF2 password hashing

What each button in the tool actually computes, step by step — with the real formulas.

What the iteration count actually does

PBKDF2 applies HMAC-SHA256 to the password and salt, then feeds that output back in as input for another round of HMAC, repeated for however many iterations you choose. Each round is cheap on its own; multiplied by hundreds of thousands of rounds, it becomes deliberately, measurably slow.

DK=PBKDF2(password,salt,c,dkLen)\mathrm{DK} = \mathrm{PBKDF2}(\text{password}, \text{salt}, c, \text{dkLen})

c is the iteration count you picked above.

Why the timer matters

The elapsed-time readout after you click "Derive key" isn't a UI flourish — it's the entire point made concrete. An attacker checking a stolen password database against a wordlist pays that exact same per-guess cost, for every single guess. At 1,000 iterations that cost is negligible; at 600,000 it starts to meaningfully slow down large-scale guessing, at the price of also slowing down your own legitimate login checks.

Salt: public, but not pointless

The salt travels in the clear right alongside the derived key — it isn't a secret. Its job is narrower: it guarantees two users with the same password get completely different derived keys, which defeats precomputed rainbow-table attacks that only work when the same input always produces the same output.

Why this tool doesn't offer Argon2

The Web Crypto API implements PBKDF2 natively in every browser; it doesn't implement Argon2, bcrypt, or scrypt at all — those would require a third-party WebAssembly library, which this playground deliberately avoids so that every tool here runs on nothing but your browser's own built-in, audited cryptography. The key derivation functions module covers all four algorithms and explains why Argon2 is the current recommendation for new systems.

Now try it

Back to PBKDF2 password hashing

Derive a real key from a password with a tunable iteration count, and feel the cost difference between 1,000 and 600,000 iterations yourself.