Visual RFC.
ALL RFCs / RFC 2104
Read the RFC ↗
RFC 2104 / Keyed message authentication

Build the inner hash input

03

XOR the normalized key with the inner pad, append the original message, and hash the combined byte string.

RFC 2104 · § 2EXAMPLE
4 / 4
Build the inner hash inputSHA-256 of that72-byte sequence gives the full32-byte inner digest shown as two hexadecimal rows, not the final HMAC tag.Build the inner hash inputKeyed inner padM: 8SHA-256 over the 72-byte sequenceInner digest: 32 raw bytes92ab4d9a1f3b6152bca9dd9e69af43f4ce99e42fd4e30ff972c48025b9f9cfefKeep raw bytes for the outer passByte concatenation · hash padding not shown
04
Calculate the inner digest

The record shows the complete inner digest as two hex rows. Keep its32raw bytes for the outer pass; this is not the final tag.

Source for this drawing: RFC 2104 · Read RFC section 2 ↗

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

A seal answers a specific question.

A certificate or signature supports particular checks about a key or message. It does not automatically prove that every claim or sender is trustworthy.

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

The inner hash receives a B-byte keyed pad followed by the message bytes.

  • XOR (exclusive OR) compares corresponding bits: equal bits become0, different bits become1. The inner pad ipad is the byte 36 in hexadecimal repeated B times. The outer pad opad is the different byte 5c repeated B times (§2). These are public constants, not two independently generated keys.
  • For the public key 0b repeated 20 times and 44normalization zeroes, K0 XOR ipad is 3d repeated 20 times followed by 36 repeated 44 times. The byte operations are0b XOR36=3d and00 XOR36=36. Apply XOR at every one of the B positions.
  • Append the original message bytes to this64-byte inner keyed pad. "Hi There" is eight ASCII bytes:48 69 20 54 68 65 72 65. The inner hash input is therefore72 bytes. Hexadecimal characters are a readable representation; the hash consumes the byte values, not their printed hex spelling.
  • Apply the selected hash H to that combined input. The SHA-256 inner digest is32raw bytes. That inner result is not yet the HMAC tag; it becomes input to the outer hash in the next chapter. Do not transmit it as the final tag (§2 steps2–4).
  • The diagrams show HMAC-level inputs, not SHA-256 compression rounds or its internal message-padding rules. HMAC’s zero padding of K0 and the hash function’s own final padding are separate operations. RFC 2104 uses the hash without changing its usual definition (§§2,4).
DETAILS

Selected construction rules and public test data; not a cryptographic library, key exchange, authentication protocol or deployment certification.

Read the RFC section ↗

All chapters in RFC 2104

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 ↗