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

Body hash and selected headers

03

A body hash is included in the signed DKIM header, which is itself included in the signature calculation.

RFC 6376 · § 3.7EXAMPLE

FOLLOW THE SIGNED DATA · FICTIONAL MESSAGES AND DNS

What exactly do bh=, h=, b= and l= protect?

These are tags in the DKIM-Signature header. Open an underlined term for an explanation and an example.

Body hash
A digest of the body bytes covered by this DKIM signature.
Signed header list
Names the message header fields selected for this signature.
Cryptographic signature
The signature over the selected headers and the DKIM signature header.
Covered body length
An optional count of the canonical body octets covered by the hash.
DKIM LAB04 / 04
Step 4 of 4 — Verify both protected inputs

A body-hash match and a valid header signature are both needed; unsigned data lie outside that protection.

Body octets entering SHA-256

Hello,·team.↵
Meet·at·10.↵
No l=: entire canonical body

Header fields selected by h=

h=from:subject
From:·Offers·<offers@brand.example>↵
Subject:·Meeting·notes↵
Subject is selected
X-Route:·original↵
X-Route is not selected

Canonical body → SHA-256 → bh=

Signed bh=mtWvvw/KmkZ8V67tU75C7b7ZB/JLAYAwFzjpOVEOdsU=Received hash=mtWvvw/KmkZ8V67tU75C7b7ZB/JLAYAwFzjpOVEOdsU=

Selected headers + DKIM-Signature (b= empty)

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.org; s=mail; h=from:subject; bh=mtWvvw/KmkZ8V67tU75C7b7ZB/JLAYAwFzjpOVEOdsU=; b=↓ Private-key signing creates b= ↓b=b4KIjwYPXR91Ds2E53MQnBKs…

Body-hash check

✓ Hash equals bh=

Header-signature check

✓ Selected header input unchangedbh= is inside this authenticated input.
Header selection and body-length limits

From must be signed. This fixture has one occurrence of each field. In general h= is processed in listed order, selecting matching fields from the bottom upward without reuse; repeated names can also assert that no further occurrence exists.

l= counts octets after canonicalization. Content beyond l= is not validated by this signature; a receiver may reject the signature for unsigned content. The length-limited option here is a teaching example, not a recommendation.

PASSThe body hash and signature both verify for the signing domain.
Try an alternative outcome

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

Static view: prevalidated RSA/SHA-256 fixture.

Inspect the actual public fixture bytes

Real RSA-2048/SHA-256 test signatures. Names, DNS answers and messages are fictional. Private keys are never included in these public assets. Long values below are shown in full.

DKIM-Signature

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.org; s=mail; h=from:subject; bh=mtWvvw/KmkZ8V67tU75C7b7ZB/JLAYAwFzjpOVEOdsU=; b=b4KIjwYPXR91Ds2E53MQnBKsht2g21BdDvcP42Wsg+hHIpx+ikEr/hrDsIL+VBljbwHbF+uP3n/nfZNGZLb4h+JV1tPcvO6pxpXrf+x3w7UiTY4E3gbvzRhXpsTda8AeeXsAJMD/xUrPKRluvwJRmnW7v8tskn6rqADZwdBCHwvfPjBoJQkuh5kdj3/DZtMTnD0AnV5o1dVyyxBKRG/oq+VlIL+7jIZEbQ7gFfVnyOh/86LsLF2M00BqKLhnkQWeyBIjLJXXwdaa6d1YpP+Kg9zmlE0AZMIfwPuxjitZsK3pJB71Qm6TE2MpWx08P4sJadmKBHSUb3xdXKquxDbpKA==

DNS public-key value p=

MIIBCgKCAQEAy5XL15qo9i3RKdEPV5B4dPlNClTlWs9D5X1yW9m0Sdz8fhPuZYrC5R7X3D3WxsWY47v3p+mBwan/GSQzDF6y5T1wjygkZXPeposIf72M6kWgmRO4Shaz+Moq1hOEKPU29+CLkD+lznEhQsD8jBiHLM6wMSZQpc0BorecKtwDbdXDAY1WOvwmyq+wdskzZxadr0uLKUrGY/5ePyRhmbVJQdjKstATsJHrMvwXPhvATUpkIAnsYu1KNLkbXIwGjU04+ZXG/X8rREQCvIAIFWY27vLvuixn8rrF/tuTVoYNMy+tVgmBAvTTLi+IZaIfnOgtVUtZnzPQCx3B0LQMb4Be8wIDAQAB

Header signing input (b= empty, no terminal CRLF on DKIM-Signature)

from:Offers·<offers@brand.example>↵
subject:Meeting·notes↵
dkim-signature:v=1;·a=rsa-sha256;·c=relaxed/relaxed;·d=example.org;·s=mail;·h=from:subject;·bh=mtWvvw/KmkZ8V67tU75C7b7ZB/JLAYAwFzjpOVEOdsU=;·b=

bh= binds the covered body bytes into the signed header input. h= controls which message headers are signed; b= contains the resulting signature.

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
Create signature

The signing key authenticates the combined selected input.

Body hash and selected headersA body hash is included in the signed DKIM header, which is itself included in the signature calculation.Body hash and selected headersBody → canonical bytes → bh=hashh=from:subject:dateSignature over selected headers + bhThe signature binds selected inputs, not encryption

Key idea: bh= carries the canonicalized body hash.

Terms

Look up a term in the glossary ↗

Rules & examples
  • bh= carries the canonicalized body hash.
  • h= identifies the signed header fields under the selection rules.
  • Optional body-length signing has additional risks and does not protect unsigned appended data.

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 ↗