Visual RFC.
ALL RFCs / RFC 6376
Read the RFC ↗
RFC 6376 / MECHANISM GUIDE

Canonicalization

02

Simple and relaxed algorithms define which message formatting changes affect the signed bytes.

RFC 6376 · § 3.4EXAMPLE

FOLLOW THE SIGNED DATA · FICTIONAL MESSAGES AND DNS

Which formatting changes leave the signed bytes unchanged?

DKIM LAB04 / 04
Step 4 of 4 — Determine whether the bytes match

Header and body rules are chosen independently. Only the defined formatting differences disappear.

Original at signing

Subject:·Meeting·notes↵

Version at receiving

subject:⇥Meeting··notes·⇥↵
↓ relaxed header canonicalization ↓Unfold · lowercase field name · normalize defined whitespace

Canonical bytes at signer

subject:Meeting·notes↵
SHA-256: IuBUpoLLS/1InixqkGBzkPSJ…

Canonical bytes at verifier

subject:Meeting·notes↵
SHA-256: IuBUpoLLS/1InixqkGBzkPSJ…
=Both sides hash the same bytes
SAME CANONICAL BYTESThis transformation preserves this input under the selected algorithm. This alone is not a complete DKIM pass.

Visible byte notation: · = SP, ⇥ = HTAB, ↵ = CRLF. These markers are labels, not extra signed characters.

Empty bodies and unchanged trailing empty lines

A simple empty body becomes one CRLF; a relaxed empty body is zero octets. Both modes ignore trailing empty lines. Relaxed body rules do not lowercase text or allow arbitrary word changes.

Try an alternative outcome

Changing an input shows the completed outcome. Restart restores this chapter’s original example.

Canonicalization defines the exact bytes used for signing. Header and body modes can differ.

Bounded ASCII/CRLF teaching examples. These are not a complete mail parser, DKIM implementation or DNS lookup service. Shortened hash/key/signature labels expand to actual values in the fixture details.

3 / 3
03
Hash canonical bytes

Both sides must obtain the same signed input.

CanonicalizationSimple and relaxed algorithms define which message formatting changes affect the signed bytes.CanonicalizationSubject: Hello worldrelaxed rulessubject:Hello worldHash the same canonical bytes at both ends

Key idea: Header and body canonicalization are selected separately.

Terms

Look up a term in the glossary ↗

Rules & examples
  • Header and body canonicalization are selected separately.
  • Relaxed header processing normalizes specified whitespace and field-name case.
  • Canonicalization is not permission for arbitrary content changes.

Examples are illustrative. Consult the linked RFC and its errata for implementation details.

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

The envelope and the letter do different jobs.

Mail transport moves a message between servers. The message format describes its contents. Authentication adds checks; it does not make every message safe.

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.

All chapters in RFC 6376

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 ↗