Online PBKDF2 derive

PBKDF2 stretches a password with a salt and an iteration count into a fixed-length key. The password is always UTF-8. The salt is read either as UTF-8 text or as hex digits. The PRF is HMAC with SHA-1, SHA-256, or SHA-512. Output length is 8 to 8192 bits in steps of 8. The derived bytes appear in hex or Base64. With password, UTF-8 salt salt, one iteration, SHA-256, and 256 bits, the hex is 120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b. Changing iterations, salt encoding, PRF, or bit length changes every output byte.

What PBKDF2 derives when the password, salt, and iterations are fixed

PBKDF2 stretches a password into key material with a salt and an iteration count. The password is the UTF-8 bytes of the text that was typed. The salt can be read the same way as UTF-8 text, or decoded from hex into bytes before the derivation runs. The PRF is HMAC built from SHA-1, SHA-256, or SHA-512. The output length is chosen in bits from 8 through 8192. At 256 bits with SHA-256 as the PRF, the derived bytes are 32 bytes long.

The password password, the salt salt as four UTF-8 bytes, one iteration, SHA-256 as the PRF, and 256 output bits produce the hex string 120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b. That is 64 hex characters, lowercase, with no spaces. RFC 6070 lists the same password and the salt salt with one iteration under SHA-1 at 160 bits: 0c60c80f961f0e71f4a944a4264269b0799badc3, which is 40 hex characters. Changing the PRF or the output bit count moves the whole string.

Hex spells two digits per byte. Base64 groups bits differently and may add padding. A slow password store may prefer bcrypt or Argon2. A one-shot digest without salt is hash digest. A keyed tag without stretching is HMAC. Wrapping data with a derived AES key is the subject of AES cipher. Salt bytes in hex form are the topic of hex encode and decode.

How the password bytes, salt encoding, PRF, iterations, and output bits decide the derivation

Why SHA-1, SHA-256, and SHA-512 as the PRF change digest width and iteration cost

  1. The PRF is HMAC with the password as the key. SHA-1 inside HMAC is 160 bits per block step, SHA-256 is 256 bits, and SHA-512 is 512 bits.
  2. RFC 6070 SHA-1 with password, salt salt, and one iteration at 160 bits is 0c60c80f961f0e71f4a944a4264269b0799badc3. SHA-256 on the same inputs at 256 bits starts with 120fb6cf.
  3. Each iteration feeds the previous output back into HMAC. A higher iteration count multiplies that work. The PRF name must match on both sides of a check.

Why salt as UTF-8 text is not the same bytes as salt typed as hex digits

  1. The four letters salt as UTF-8 are the bytes 73 61 6c 74. The eight characters 73616c74 read as hex decode to those same four bytes.
  2. If hex decoding is off, the tool hashes the eight digit characters as UTF-8 instead, which is eight bytes and a different derivation.
  3. A newline in the salt field is the byte 0A. salt plus a newline is five bytes, not four, and the derived key moves with it.

Why iteration count one still has a published answer and why higher counts slow checks

  1. One iteration is valid for test vectors even though password storage normally uses thousands or millions of rounds.
  2. Password password, salt salt, one iteration, SHA-256, 256 bits always reaches 120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b.
  3. Doubling iterations roughly doubles the HMAC work for each derive or verify. That cost is the point when the input is a human password.

Why output bits from eight through 8192 set hex length and Base64 length together

  1. The tool keeps the first dkLen bits of the PRF output stream. Bytes are eight bits each, so 256 bits is 32 bytes.
  2. Hex uses two characters per byte, so 256 bits is 64 hex characters and 160 bits is 40. Base64 uses four characters per three bytes and may end with equals padding.
  3. 8192 bits is 1024 bytes, 2048 hex characters, and a longer Base64 line. Eight bits is one byte, one pair of hex digits, and a short Base64 fragment.

Where the published vector and the typed salt quietly disagree

The RFC-style pair password and salt under SHA-256 at one iteration

Password password is eight UTF-8 bytes. Salt salt is four bytes, 73 61 6c 74. With one iteration, SHA-256 as the PRF, and 256 output bits, the hex derived key is 120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b. The same password and salt under SHA-1 at 160 bits and one iteration, as RFC 6070 records, is 0c60c80f961f0e71f4a944a4264269b0799badc3. The password did not change. The PRF and the kept bit count did. Base64 of the 32-byte SHA-256 result is EDL2zPzyizxD5yJSVWxPg3qmVITJLPNUgIBZhXy3C28=.

A salt field that held the hex spelling 73616c74 without hex decoding

The word salt is four bytes. The text 73616c74 is eight characters when read as UTF-8, not four decoded bytes. PBKDF2 with password password, that eight-byte salt, one iteration, and SHA-256 at 256 bits does not start with 120fb6cf. A checklist that expected UTF-8 salt will fail. Turning hex digits into bytes before deriving is what hex encode and decode describes. The derived key is a function of the salt bytes the tool actually fed in, not of the label on the encoding selector.

A login design that stopped at one fast PBKDF2 round

One iteration matches test vectors and proves the implementation, but it is not enough for offline guessing against stolen hashes. Production systems raise the iteration count and still store a unique salt per account. Competitors in the same space include memory-hard Argon2 and bcrypt. A single hash digest of a password skips both salt and iterations. HMAC adds a key but does not stretch guesses the same way. Feeding the derived bytes into AES cipher is a different step from storing the password.

Common questions

What is PBKDF2 for password password, salt salt, one iteration, SHA-256, 256 bits?
The password is the UTF-8 bytes of password, eight bytes. The salt is the UTF-8 bytes of salt, four bytes 73 61 6c 74. One iteration, HMAC-SHA-256 as the PRF, and 256 output bits yield 120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b in hex. That is 64 characters. The same inputs with SHA-1 at 160 bits yield 0c60c80f961f0e71f4a944a4264269b0799badc3, which RFC 6070 publishes for this pair.
How is salt UTF-8 different from salt entered as hex?
UTF-8 salt means the typed characters become bytes directly. The four letters salt are 73 61 6c 74. Hex mode means pairs of digits become bytes, so 73616c74 is also those four bytes when decoding is enabled. If the field says hex but the tool still treats the text as UTF-8, eight digit characters hash as eight bytes and the derivation diverges from RFC-style vectors. A space or newline in the salt is an extra byte and changes the result.
How long is the derived key in hex and in Base64?
Hex length is twice the byte count, because each byte is two hex digits. 256 bits is 32 bytes and 64 hex characters. 160 bits is 20 bytes and 40 hex characters. Base64 encodes three bytes as four characters and may append one or two equals signs for padding. 32 bytes typically become 44 Base64 characters with one equals sign. Switching display format does not change the underlying bytes, only the spelling on screen.
What PRF choices does PBKDF2 offer here?
The PRF is HMAC with SHA-1, SHA-256, or SHA-512 as the hash inside. SHA-1 steps produce 160-bit blocks inside the PBKDF2 loop. SHA-256 uses 256-bit blocks. SHA-512 uses 512-bit blocks and more work per iteration on long inputs. The published SHA-256 vector starts with 120fb6cf. The RFC 6070 SHA-1 vector starts with 0c60c80f. Picking SHA-512 does not make the output longer by itself. The output bit slider sets length separately.
What output bit counts can PBKDF2 produce on this page?
The slider runs from 8 bits through 8192 bits in steps the tool allows. Eight bits is one byte. 256 bits is 32 bytes and matches common AES-256 key sizes. 8192 bits is 1024 bytes, which is far longer than most protocols need but useful for stress tests. Partial bytes at the top are truncated according to the standard. Hex and Base64 lengths track the byte count that remains after truncation.
Why do iterations matter if one iteration already has a fixed answer?
One iteration is for reproducible test vectors and for checking an implementation against RFC 6070 and the SHA-256 example. Real password storage repeats HMAC thousands or millions of times so each guess costs more CPU time. The iteration count is stored beside the salt and the PRF name. Raising it slows legitimate logins slightly and slows bulk offline attacks more. The derived bytes at one iteration are not safer merely because PBKDF2 was used.
Can PBKDF2 output be reversed into the password?
No. The output is a one-way stretch of the password bytes with the salt and iterations fixed. Many passwords could in theory map into the same bytes for a short output, and a long output does not store the password length. Matching derived material only shows that the same password, salt, encoding, PRF, iterations, and bit count were used. It does not reveal the password to someone who lacks the password field input.
How is PBKDF2 different from SHA-256 of the password alone?
SHA-256 of the password is one fast hash with no salt and no iteration loop. The same password always gives the same digest, which is easy to attack with precomputed tables. PBKDF2 mixes in a salt so equal passwords diverge, and iterations multiply HMAC work. A bare digest is described under hash digest. Password storage often adds even higher costs with bcrypt or Argon2.
Does a higher iteration count change the SHA-256 test vector at 256 bits?
Yes. The vector 120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b is tied to exactly one iteration. Ten iterations or ten thousand iterations produce different bytes even when the password, salt, and PRF stay the same. Documentation that quotes the vector must also quote the iteration count. Verification must use the stored count, not assume one.