Cryptographic domain separation 2026-11-05
Cryptographic domain separation distinguishes intended uses of cryptographic computations by encoding their roles or contexts into the inputs. A key derivation function can thereby derive different role-specific cryptographic keys from shared initial material. For HKDF, the
info field is specifically intended to bind the output to application context, including relevant protocol and algorithm information.[ref]For an original computed example, use the extraction result from RFC 5869 Test Case 1, then expand it to sixteen bytes with the ASCII context
app/send. The result ise2f1c135562168a517b5c5451fd68f76.c5302399f25698fce7c4e33ad0c8b479.These are new computations using the specified HKDF expansion; the contexts are illustrative application labels, not additional published test vectors. Repeating exactly the first set of inputs reproduces exactly its first output. The distinction is encoded in the context rather than obtained by hoping repeated deterministic calls will differ.
The encoding must preserve the intended distinction. Raw concatenation sends both field pairs
ab, c and a, bc to abc. A length-prefixed encoding with one-byte lengths instead gives 02 61 62 01 63 and 01 61 02 62 63. These five-byte strings differ, even though their unstructured character concatenations agree. The one-byte example assumes each field is shorter than 256 bytes; a protocol must define its full length limits and encoding.Different encodings do not mathematically guarantee different finite-length digests: distinct inputs can still collide. Domain separation supplies a structured distinction on which the construction's security argument can rely. It also does not authenticate a context string supplied by an attacker. The surrounding cryptographic protocol must establish the identities and agreed roles whose labels it encodes.
Salt and context have different jobs in HKDF. The cryptographic salt is an extraction input, while
info is an expansion input. Reusing one parameter as if it automatically established every other required binding changes the specified construction. Hash initialization vector 2026-11-05
A hash initialization vector is the initial internal state from which a specified cryptographic hash function begins processing a message. For the SHA-2 algorithms, it is a public, algorithm-defined sequence of state words. It is not a fresh per-message cryptographic nonce, a secret key or a cryptographic salt.[ref]
Secure Hash Standard by National Institute of Standards and Technology. §5.3, setting the initial hash value
For an iterative hash, write the state update schematically aswhere is one padded message block and is the algorithm's hash compression function. The digest is derived from the final state by the algorithm's output rule. Initial state, padding, compression and output rule together specify the function; agreeing on only the output width does not specify a hash.
An original comparison uses two specified algorithms. SHA-256 starts with the 32-bit word
6a09e667, while SHA-224 starts with c1059ed8. Both subsequently use the SHA-256-family compression structure, but their full initial states differ. Even the empty message is padded and processed, so its digest is not simply a printed initial state.[ref]Computing the empty-message digests gives SHA-256
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855and SHA-224
d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f.Keeping the first 28 bytes of the first result does not produce the second. Initialization acts before every subsequent block transformation; final truncation cannot substitute for it.
This also matters when implementing several hash variants with one compression routine. Resetting a context must restore the chosen variant's complete initial state and length counters. Accidentally reusing a previous message's final state computes a different function. A known-answer test for empty and short messages can expose such state-management mistakes, although passing finitely many vectors does not prove every update sequence correct.
HKDF 2026-11-05
HKDF is an HMAC-based key derivation function with extraction and expansion stages. Extraction combines initial material with a cryptographic salt to produce an intermediate key . Expansion uses that key, context
info and an output length . RFC 5869 specifies the construction as an Informational RFC.[ref]HMAC-based Extract-and-Expand Key Derivation Function (HKDF) by Hugo Krawczyk and Pasi Eronen. Status of This Memo; §§2.2–2.3
Writing for concatenation, its equations areThe output is the first bytes of , where and is the digest length in bytes. The counter occupies one byte, giving . The first HMAC argument is the key; swapping its two arguments changes the construction.[ref]
HMAC-based Extract-and-Expand Key Derivation Function (HKDF) by Hugo Krawczyk and Pasi Eronen. §2.1, HMAC argument convention; §§2.2–2.3, extraction and expansion
For SHA-256, . Requesting therefore requires two expansion blocks, using all 32 bytes of the first and ten of the second. The maximum specified length is bytes. Requesting a longer output under that one-byte counter rule is not an additional iteration of the same specification.
RFC 5869 Appendix A.1 supplies a reproducible example: 22 input bytes each equal to hexadecimal
0b, salt bytes 00 through 0c, and info bytes f0 through f9, with . The resulting output, written as hexadecimal, is3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865.That is 84 hexadecimal digits representing 42 bytes. Each expansion block depends on its predecessor as well as the context and counter; independently hashing the counter would describe a different function.[ref]
A salt need not be secret, while the derived key material must receive the protection required by its role. Context can distinguish protocol uses through cryptographic domain separation. Neither changing a label nor asking for more bytes supplies additional secret entropy to a weak input.
Pasi Eronen 2026-11-05
Pasi Eronen is a computer scientist contributing to Internet security and cryptographic protocols. His IETF author record links a series of protocol specifications; RFC 5869's author-contact section gives his full name and a Nokia Research Center affiliation at publication.[ref]
Pasi Eronen profile in the IETF Datatracker. Named author record.
[ref]HMAC-based Extract-and-Expand Key Derivation Function (HKDF) by Hugo Krawczyk and Pasi Eronen. May 2010, Authors’ Addresses.
With Hugo Krawczyk, Pasi Eronen specified HKDF, an HMAC-based key derivation function. It separates extraction of an intermediate pseudorandom key from expansion into output keying material, with cryptographic salt and application context supplied as specified inputs.[ref]
HMAC-based Extract-and-Expand Key Derivation Function (HKDF) by Hugo Krawczyk and Pasi Eronen. §§2.1–2.3, construction and argument order.
An original output-length calculation illustrates the design. With SHA-256, each expansion block has 32 bytes. Requesting 42 bytes therefore requires two blocks: all 32 bytes of the first and the first 10 of the second. The one-byte block counter limits expansion to 255 blocks, hence 8160 bytes for this hash. These are construction limits, not claims that a longer output contains more independent secret information than its input.[ref]
HMAC-based Extract-and-Expand Key Derivation Function (HKDF) by Hugo Krawczyk and Pasi Eronen. §2.3, expansion, counter and length bound.
The context input supports cryptographic domain separation. A protocol can distinguish two intended roles by unambiguous labels rather than silently reuse identical derived material. The surrounding cryptographic protocol must still authenticate its parties and provide suitable input secrets; HKDF does not establish those properties by itself.[ref]
Pasi Eronen, portrait identified by his IETF Datatracker profile
. SHA-512/256 2026-11-05
SHA-512/256 is a SHA-2 cryptographic hash function with a 256-bit digest. It uses the 1024-bit blocks and 64-bit word operations of SHA-512, a variant-specific hash initialization vector, and the first 256 bits of the final state. It is one member of SHA-512/t.[ref]
Its initialization illustrates cryptographic domain separation. Let be the eight-word ordinary SHA-512 initial state. First form by applying bitwise exclusive or to each word with the hexadecimal word
a5a5a5a5a5a5a5a5. Run the SHA-512 computation on the ASCII label SHA-512/256, using as its initial state. The full 512-bit result is the variant's fixed initial state . This label computation is part of defining the function, not an extra message prefix chosen by its user.[ref]Secure Hash Standard by National Institute of Standards and Technology. §5.3.6, SHA-512/t IV Generation Function
If denotes the full final state obtained by hashing with that initialization, thenThe output comprises four 64-bit words: 32 bytes or 64 hexadecimal digits. The initial state is public and fixed; it is not a cryptographic salt or a secret key.
53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23.Ordinary SHA-512 of those bytes begins
ddaf35a193617aba, while SHA-256 begins ba7816bf8f01cfea. Neither output implements SHA-512/256. In particular, the slash and output width do not mean “hash with ordinary SHA-512 and keep 256 bits”.The padding also follows the SHA-512 family: a 128-bit length field and 1024-bit blocks. An input of 56 bytes therefore fits into one padded block here, while SHA-256 needs two of its smaller blocks. The identical 32-byte digest sizes say nothing about those different computations.
