Cryptographic salt 2026-11-05
A cryptographic salt is an additional input used by a cryptographic construction to vary or condition its processing of secret material. Its required properties depend on the construction. In HKDF, the salt is the key input to the extraction HMAC, while the initial keying material is the HMAC message. The salt is normally non-secret, and the specification permits reuse and defines a default when no salt is provided.[ref]
For HKDF extraction,
Fixing both inputs gives a deterministic intermediate key. Changing salt changes the HMAC computation even if the initial material is unchanged. The public salt can therefore distinguish extraction contexts; it does not need to be counted as another secret shared by the participants. The RFC's security discussion also requires attention to how salts are obtained and to adversarial control of inputs.[ref]
An original counting argument separates public variability from secret uncertainty. Suppose secret is uniform over values and independent public salt is uniform over values. There are possible input pairs before either value is known. Once is public, however, only candidate secrets remain. For any deterministic derived key ,
where is information entropy and the conditioning uses conditional entropy. Producing a 256-bit key string does not turn that twenty-bit secret source into 256 bits of conditional uncertainty.
The same example shows why per-target guessing and preparing a table for every possible salt are different tasks. A table enumerating every stipulated secret/salt pair would have entries, while enumeration for one known salt still has candidate secrets. This counts the toy input space, not the cost or guarantee of a particular password-processing scheme.
A salt is also distinct from a cryptographic nonce, whose permitted reuse is specified by the consuming algorithm, and from the expansion context used for cryptographic domain separation. Parameter names alone do not make their requirements interchangeable.
Fixed-width length field 2026-11-05
A fixed-width length field uses a fixed number of encoded bytes to state a payload length. The payload itself can vary in size. For an unsigned -byte field in big-endian endianness, bytes represent
The format must additionally define the length unit, permitted range and whether headers count toward it. TLS uses unsigned, network-order integers and gives variable-length vectors a prefix wide enough for their declared maximum; its vector length counts bytes, not elements.[ref]
For an original two-byte length-prefixed encoding, prefix 02 01 means payload bytes in big-endian order. The complete field then occupies bytes. The same two prefix bytes would mean under little-endian interpretation, changing the boundary of every following field. The byte order is therefore part of the serialization, not a display preference.
A two-byte field can represent at most ; a format permitting payload lengths only up to must reject larger encoded values even though they fit the field. Conversely, a -byte payload needs prefix 01 2c under this convention. Truncating it to one byte would declare only bytes. A format change cannot be implemented by silently discarding high-order bits.
Length-prefix validation before allocation checks the declared range and available input before reserving space or consuming the payload. A complete decoder also specifies how truncation and trailing bytes are handled. Byte count and character count differ for encodings such as UTF-8. A length prefix supplies boundaries; a field's role or type may still need binding through cryptographic domain separation.
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]
Writing for concatenation, its equations are
The 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]
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, is
3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865.
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.
Key derivation function 2026-11-05
A key derivation function transforms initial keying material, together with specified parameters and context, into one or more cryptographic keys. The output lengths and security requirements belong to the application. HKDF separates extraction of a pseudorandom key from expansion into the needed output material; the design and its assumptions are analysed in Krawczyk's primary paper.[ref]
Derivation does not create secret information from nothing. For an original counting example, suppose a secret input is uniformly selected from only possibilities and every other derivation input is public and fixed. A deterministic function producing 256 output bits can then reach at most different outputs, not all strings independently. An adversary able to enumerate the original possibilities can enumerate the derived possibilities too. More output bytes alone do not raise the input's information entropy.
Context supports cryptographic domain separation. For a stipulated application, deriving a sending key with an unambiguous label send and a receiving key with receive assigns different intended roles to the outputs. Deriving both with exactly the same inputs and parameters instead reproduces exactly the same key. This deterministic equality is a functional property, not a failure to obtain fresh randomness during a repeated call. HKDF's info input is explicitly intended to bind output to application context.[ref]
Parameter encodings must also distinguish intended inputs. Naive concatenation makes pairs ab, c and a, bc both encode as abc. A defined length-prefixed or otherwise unambiguous encoding avoids that collision of descriptions. Changing the encoding changes the KDF input even if a user informally regards the labels as equivalent.
A KDF therefore supplies a specified transformation and separation mechanism. Its security still depends on the initial material, the selected construction and the surrounding cryptographic protocol. It does not by itself authenticate the peer that supplied a shared secret.
Length-prefixed encoding 2026-11-05
A length-prefixed encoding represents a variable-size field by writing a length before its payload. The length's units, width, endianness, permitted range and inclusion or exclusion of the prefix itself are part of the serialization format. For example, the Transport Layer Security presentation language counts vector lengths in bytes and encodes variable-length vectors with a length field whose width follows the specified upper bound.[ref]
An original two-field format uses one unsigned byte for each payload length:
Here counts payload bytes and is concatenation. The ASCII fields ab and c give 02 61 62 01 63, while a and bc give 01 61 02 62 63. Bare concatenation would give 61 62 63 in both cases. This distinction is useful when a cryptographic hash function or message authentication code must commit to two separate fields.
The encoding is an injective function on its stated input set. Read the first length byte , then exactly bytes for ; read the next length byte , then exactly bytes for . This reconstructs both fields uniquely. For a complete two-field record, require that no bytes remain. Missing bytes, absent length fields or forbidden lengths are rejected rather than silently reinterpreted. The proof depends on these parsing rules, not merely on putting some number before the data.
A fixed-width length field also imposes a representable limit: 256 payload bytes cannot be encoded by the one-byte scheme above. Truncating that length modulo 256 would make the parser see zero and destroy the intended format. A larger format must specify a larger prefix or a different encoding.
Finally, byte count and text-character count can differ. The text é has two bytes c3 a9 in UTF-8, so its one-byte length prefix here is 02. A length prefix provides boundaries; cryptographic domain separation may additionally require a field type, role label or protocol version to distinguish records with different meanings.
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][ref]
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]
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]
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]
Figure 1.
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]
If denotes the full final state obtained by hashing with that initialization, then
The 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.
For a computed example, the three ASCII bytes 61 62 63 give
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.