Build the inner hash input
03XOR the normalized key with the inner pad, append the original message, and hash the combined byte string.
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 ↗
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.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
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).
Selected construction rules and public test data; not a cryptographic library, key exchange, authentication protocol or deployment certification.
Read the RFC section ↗