Visual RFC.
ALL RFCs / RFC 8188
Read the RFC ↗
RFC 8188 / ENCRYPTED CONTENT

Derive the key and each nonce

03

HKDF, the HMAC-based Extract-and-Expand Key Derivation Function, derives a per-message key and nonce base. Each record combines that base with its own sequence number.

RFC 8188 · § 2.2EXAMPLE
4 / 4
Derive the key and each nonceHKDF, the HMAC-based Extract-and-Expand Key Derivation Function, derives a per-message key and nonce base. Each record combines that base with its own sequence number. For a hypothetical next record with this same message key, encode sequence 1 as 12 big-endian octets and XOR with the same base. Only the last bit changes in this example. The key stays fixed within this message; nonce progression protects record order.Different labels derive different valuesSEQ = 1 (96-bit big-endian)XOR; not addition05 cb 3c 82 42 11 28 b2 3c 19 e2 3dNext nonce changes the last bit hereSame message key; distinct record nonceRFC8188 · chapter3 · state4 · published/illustrative data
04
Advance without reusing a record nonce

For a hypothetical next record with this same message key, encode sequence 1 as 12 big-endian octets and XOR with the same base. Only the last bit changes in this example. The key stays fixed within this message; nonce progression protects record order.

Source for this drawing: RFC 8188 · Read RFC section 2.2 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

Extract with SHA-256: PRK = HMAC-SHA-256(salt, IKM), where IKM is separately supplied input-keying material and PRK is a pseudorandom key.

  • Extract with SHA-256: PRK = HMAC-SHA-256(salt, IKM), where IKM is separately supplied input-keying material and PRK is a pseudorandom key.
  • Expand with different info strings: Content-Encoding: aes128gcm followed by 00 for a 16-octet key; Content-Encoding: nonce followed by 00 for a 12-octet nonce base. A single 01 block counter follows each info value.
  • XOR the nonce base with the 96-bit big-endian record sequence number, beginning at zero. XOR combines corresponding bits; it is not integer addition or concatenation.
DETAILS

Published test keys are examples, not secrets to use. This guide does not implement key management or a production cryptographic library.

Read the RFC section ↗

All chapters in RFC 8188

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗