The Content-MD5 Header Field
obsoleted by
- rfc-1864 — The Content-MD5 Header Field
Extracted elements (10)
Content-MD5 was introduced because, despite MIME's existing transport protections, there was no mechanism to verify that decoded data remained intact end-to-end. It serves as a message integrity check (MIC) for MIME entities.
Use of Content-MD5 is recommended whenever data integrity is desired but Privacy-Enhanced Mail (PEM) services are not available, positioning it as a lightweight alternative to full PEM integrity services.
Because trailing white space is regularly altered during mail delivery and would cause a different digest, quoted-printable or base64 content-transfer-encoding SHOULD be used when the Content-MD5 field is present on textual data.
For textual data, the MD5 algorithm MUST be computed on data where each newline is represented by a CR-LF pair (canonical form).
Message relays and gateways are expressly forbidden to alter their processing based on the presence of the Content-MD5 field. However, a gateway is allowed to remove it if the corresponding MIME entity is translated to a different content-type.
The Content-MD5 field MAY only be added to MIME entities of a 'leaf' nature; it MUST NOT be used with content types multipart or message/rfc822.
The Content-MD5 field MUST be generated only by an originating user agent. Message relays and gateways are expressly forbidden from generating a Content-MD5 field.
The MD5 algorithm MUST be computed on the canonical form of the raw data, before applying any content-transfer-encoding. The receiver also applies MD5 on the raw data after undoing any content-transfer-encoding.
Content-MD5 provides only an accidental-modification integrity service; it does not protect against malicious modification. A secure integrity service such as Privacy-Enhanced Mail is conjectured to protect against all modifications.
The MD5 algorithm produces a 128-bit (16-octet) digest. Those 16 octets are base64-encoded to produce the value of the Content-MD5 header field (e.g., 'Q2hlY2sgSW50ZWdyaXR5IQ==').