489 / 691PBKDF2

PBKDF2

Seed derivation in BIP39

PBKDF2 converts input text and salt into a derived key through repeated computation. BIP39 uses it to turn a mnemonic phrase and passphrase into a seed; it does not generate new randomness.

Password-Based Key Derivation Function 2 is a deterministic derivation function parameterized by input, salt, iteration count, pseudorandom function and output length. BIP39 specifies a particular PBKDF2-HMAC-SHA512 profile, not every possible PBKDF2 application.

The input called password is the mnemonic phrase in UTF-8 NFKD. The salt is mnemonic + passphrase, also in UTF-8 NFKD; without a passphrase, an empty value is appended. BIP39 requires HMAC-SHA512, 2048 iterations and 64 bytes, or 512 bits, of output. [BIP39 — Mnemonic generation and seed conversion]

PBKDF2 creates the first intermediate result from the password input, salt and output-block index. It computes subsequent intermediate results by applying the same pseudorandom function to the preceding result and combines the values with XOR. With HMAC-SHA512, a block is 64 bytes, so BIP39 needs one block. Simply applying SHA-512 to the text 2048 times is not sufficient. [RFC8018 — PBKDF2 construction] [BIP39 — Mnemonic generation and seed conversion]

Identical normalized inputs and parameters produce the same seed. Arbitrarily increasing 2048 iterations or changing the function during recovery is not a security improvement for the existing wallet: the result no longer matches the prescribed BIP39 derivation. Translating the words to another wordlist is not a neutral change either. [BIP39 — Mnemonic generation and seed conversion]

Iterations increase the work required per attempt but add no independent secret randomness. An attacker with the words and wallet comparison data can try weak passphrases offline. A 512-bit output therefore does not mean protection equivalent to 512 bits of entropy, and 2048 is not a universal recommendation for new systems. [RFC8018 — PBKDF2 construction] [BIP39 — Mnemonic generation and seed conversion]

The BIP39 checksum helps detect errors in the words before use. PBKDF2 conversion itself is separate from phrase generation and validation; it does not certify that a passphrase belongs to the wallet sought. BIP32 or other deterministic methods can then use the seed as a further step. [BIP39 — Mnemonic generation and seed conversion]

Public BIP39 test vectors specify entropy, words and the expected seed with the test passphrase TREZOR. A correct implementation must reproduce the complete output and respect NFKD. These known inputs must never be your own backup for funds; a matching test alone also does not verify the security of the whole application. [BIP39 — Mnemonic generation and seed conversion]

For the clearest picture, read this entry together with BIP 39, BIP39 passphrase, Seed Generation, HD Wallet. The reverse links also lead from BIP39 passphrase.

DOC · 001BIP39 — Mnemonic generation and seed conversionSpecification ↗DOC · 002RFC8018 — PBKDF2 constructionSpecification ↗
Source-first · No investment advice