Keys From Passwords

How a password becomes a key: a bare hash gives equal digests for equal passwords, a salt separates users, iterations multiply the work of a guess, PBKDF2 builds keys of any length from blocks, and HKDF splits one good secret into several keys. Everything is computed in the page with toy settings.

From Password to Key

Why a bare digest of a password is not enough, and what a salt and an iteration count add.

  1. Same Password, Same Digest

    equal passwords give equal digests

  2. A Salt Separates the Users

    one password, different salts, unrelated keys

  3. Iterations Cost the Guesser

    count the HMAC calls behind one guess

One Secret, Many Keys

How PBKDF2 builds a longer key, how HKDF splits one secret into keys, and what the other password functions of the same command do.

  1. Key Length and Blocks

    a longer key is more blocks, not a longer first block

  2. HKDF Splits One Secret

    one secret, a label for each key

  3. Other Password Functions

    scrypt, Argon2 and PBKDF2 inside enc