liveBook · Manning

Key derivation function

As explained in Real-World Cryptography

A key derivation function transforms input keying material into one or more cryptographic keys or related pseudorandom values.

A key derivation function (KDF) turns one secret into one or more cryptographic keys or pseudorandom values. Unlike a PRNG, it can accept a biased secret with enough entropy, such as key-exchange output, and produce uniformly random secrets. KDFs are deterministic, helping participants rederive the same limited set of keys. section 8.6 section 8.9

HKDF, the most widely used KDF, separates derivation into two steps:

  • HKDF-Extract removes bias from an input secret and produces a uniformly random secret. An optional salt is used as the HMAC key, and different salts produce different outputs. section 8.6
  • HKDF-Expand uses a uniformly random secret to produce output of a requested length. An optional info value separates outputs: different info values with the same secret produce different results. section 8.6
  • Implementations commonly expose Extract and Expand together as one HKDF call. HKDF is built on HMAC and is defined in RFC 5869; SHA-2 is commonly used. section 8.6

How Real-World Cryptography covers it

How deep it goes
Explains KDFs through HKDF-Extract, HKDF-Expand, salt, info, output length, and combined implementation, without implementation detail.
Examples
Uses key-exchange output, salts, info values, requested lengths, and Extract-Expand diagrams as concrete derivation examples.
What it assumes
Builds on HMAC, MACs, PRNGs, and entropy while distinguishing their roles in key derivation.
What you can do after
Apply HKDF to extract uniform randomness and expand it into a limited number of reproducible cryptographic keys.
How it connects
Connects KDFs to PRNGs, HMAC, key exchange, pseudorandom functions, and key management.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Real-World Cryptography. The section links point to the parts of the book it draws on.