wire / wire-format / hkdf
HKDF (RFC 5869) derives keys from a shared secret. Two phases: Extract (PRK = HMAC-Hash(salt, IKM)) and Expand (OKM = T_1 || T_2 || ... where T_i = HMAC-Hash(PRK, T_{i-1} || info || i)). Used in TLS 1.3, Signal Protocol, and many modern protocols.
aka: HKDF (HMAC-based Key Derivation Function)
spec: RFC 5869
HKDF (RFC 5869) derives keys from a shared secret. Two phases: Extract (PRK = HMAC-Hash(salt, IKM)) and Expand (OKM = T_1 || T_2 || ... where T_i = HMAC-Hash(PRK, T_{i-1} || info || i)). Used in TLS 1.3, Signal Protocol, and many modern protocols.
| field | size | meaning |
|---|---|---|
| Extract | function | PRK = HMAC-Hash(salt, IKM). Extracts a pseudorandom key from input key material. |
| Expand | function | OKM = T_1 || T_2 || ... || T_N. T_i = HMAC-Hash(PRK, T_{i-1} || info || i). Each T_i is HashLen bytes. |
| Salt | optional | Optional salt (recommended for better security). If not provided, zeros. |
| IKM | variable | Input Key Material (shared secret from DH, etc.). |
| Info | variable | Context/application-specific info (e.g., 'tls13 key', 'tls13 iv'). |
| OKM length | variable | Output Key Material length (up to 255 * HashLen). |
example:
00 00 00 00
HKDF (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/hkdf
or /wire-format/hkdf.json