RFC 1864
The Content-MD5 Header Field
RFC 1864: The Content-MD5 Header Field π
okay bestie, this is RFC 1864 π and it's giving MIME energy π It was written by J. Myers of Carnegie Mellon and M. Rose of Dover Beach Consulting, Inc., in October 1995. It's a standards track document from the Network Working Group, and it obsoletes RFC 1544 π Its title block doesn't list anything it updates β¨
Status of This Memo β¨
This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited. πΈ
Abstract π¦
So the big idea is this: there's an optional header field called Content-MD5, and it's made for MIME-conformant messages π
Table of Contents ποΈ
1. Introduction .............................................. 1
2. Generation of the Content-MD5 Field ....................... 2
3. Processing the Content-MD5 field .......................... 3
4. Security Considerations ................................... 3
5. Acknowledgements .......................................... 3
6. References ................................................ 3
7. Authors' Addresses ........................................ 4
1. Introduction π·
Okay so even with all the stuff MIME [1] does to keep data from getting damaged during email transport, it's still lowkey desirable to have a way to check that the data, once decoded, is actually intact π That's why this memo defines the use of an optional header field, Content-MD5, which may be used as a message integrity check (MIC) to verify that the decoded data are the same data that were initially sent. The Content-MD5 header may also be placed in the encapsulated headers of an object of type message/external-body, to be used to verify that the retrieved and decoded data are the same data that were initially referenced. Iconic behavior π
MD5 is an algorithm that computes a 128 bit "digest" of arbitrary-length data, with a high degree of confidence that any alterations in the data will be reflected in alterations in the digest π§ The MD5 algorithm itself is defined in [2]. This memo specifies how the algorithm may be used as an integrity check for MIME mail π
2. Generation of the Content-MD5 Field π
Only an originating user agent generates the Content-MD5 field. Message relays and gateways are expressly forbidden from generating a Content-MD5 field, no exceptions π«
Use of the Content-MD5 field is completely optional, but its use is recommended whenever data integrity is desired and Privacy-Enhanced Mail services [3] are not available. (Consult Section 4 for further details.) The Content-MD5 field may only be added to MIME entities of a `leaf' nature. In other words, the Content-MD5 field may be used with any content type other than multipart or message/rfc822 β¨
To generate the value of the Content-MD5 field, the MD5 algorithm is computed on the canonical form of the MIME entity's object. Basically, the sender runs MD5 on the data right after it's converted to canonical form and before any content-transfer-encoding is applied. The receiver also runs MD5 on the canonical form, after undoing any content-transfer-encoding π For textual data, the MD5 algorithm must be computed on data in which the canonical form for newlines applies, meaning each newline is represented by a CR-LF pair. The canonical encoding model of MIME is described in Appendix G of [1] π
The output of the MD5 algorithm is a 128 bit digest. When viewed in network byte order (big-endian order), this gives a sequence of 16 octets of binary data. Those 16 octets are then encoded according to the base64 algorithm to get the value that goes in the Content-MD5 field. So if running MD5 over the raw data of a MIME entity gives a digest with the (unlikely) value of "Check Integrity!", then that entity's header could contain the field:
Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==
Finally, as discussed in Appendix B of [1], textual data gets altered all the time during normal mail delivery π Because adding or deleting trailing white space results in a different digest, either the quoted-printable or base64 algorithm should be employed as a content-transfer-encoding when the Content-MD5 field is used π«Ά
3. Processing the Content-MD5 field π
If the Content-MD5 field is present, a recipient user agent may choose to use it to verify that the contents of a MIME entity have not been modified during transport. Message relays and gateways are expressly forbidden to change their processing based on whether the Content-MD5 field is present π ββοΈ However, a message gateway is allowed to remove the Content-MD5 field if the corresponding MIME entity is translated into a different content-type π¦
4. Security Considerations π
Okay, serious moment. This document specifies a data integrity service that protects data from accidental modification while it's in transit from the sender to the recipient. A secure data integrity service, such as the one provided by Privacy Enhanced Mail [3], is conjectured to protect data from all modifications. Conjectured means it's a hunch, not a proven fact π
5. Acknowledgements π«Ά
This memo is based almost entirely on text originally written by Nathaniel Borenstein of Bellcore. Several improvements were also suggested by Keith Moore of the University of Tennessee, Knoxville π
6. References π
- [1] Borenstein, N., and N. Freed, "MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies", RFC 1521, Bellcore, Innosoft, September 1993.
- [2] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, MIT Laboratory for Computer Science and RSA Data Security, Inc., April 1992.
- [3] Linn, J., "Privacy Enhancement for Internet Electronic Mail, Part I: Message Encryption and Authentication Procedures", RFC 1421, IAB IRTF PSRG, IETF PEM WG, February 1993.
7. Authors' Addresses π
John G. Myers Carnegie Mellon University EMail: jgm+@cmu.edu π
Marshall T. Rose Dover Beach Consulting, Inc. EMail: mrose@dbc.mtview.ca.us π
That's the whole RFC, bestie! πβ¨ Bye bye π
π¦ where this page comes from
- ietf: rfc1864 1995-10
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms