RFC 1847
Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted
Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted π
okay bestie, this is RFC 1847 π It's a Standards Track doc from October 1995, from the Network Working Group. The authors are J. Galvin and S. Murphy (Trusted Information Systems), S. Crocker (CyberCash, Inc.), and N. Freed (Innosoft International, Inc.) π«Ά The header doesn't list any Obsoletes or Updates, so this doc isn't replacing or changing anything else β¨
Status of this Memo π
ok so this doc specifies an Internet standards track protocol for the Internet community, and it asks for discussion and suggestions for improvements πΈ If you want the standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited π
Abstract π
this doc defines a framework for applying security services to MIME body parts. MIME, short for "Multipurpose Internet Mail Extensions," defines the format of the contents of Internet mail messages and supports multi-part textual and non-textual message bodies π¦ The new content types are subtypes of multipart: signed and encrypted. Each one will contain two body parts: one for the protected data, and one for the control information needed to remove the protection π₯
The type and contents of the control information body parts are decided by the value of the protocol parameter on the enclosing multipart/signed or multipart/encrypted content type. That parameter is required to be present β¨
Table of Contents π
1. Introduction .............................................. 2
2. Definition of Security Subtypes of Multipart .............. 2
2.1 Definition of Multipart/Signed .......................... 3
2.2 Definition of Multipart/Encrypted ....................... 6
3. Definition of Control Information Content Types ........... 9
4. Definition of Key Management Content Types ................ 9
5. Security Considerations ................................... 10
6. Acknowledgements .......................................... 10
7. References ................................................ 10
8. Authors' Addresses ........................................ 11
1. Introduction π§
okay so an Internet email message has two parts: the headers and the body π The headers are a bunch of field/value pairs, structured according to STD 11, RFC 822 [1]. The body, if it's structured, is defined by MIME [2]. The basic MIME spec doesn't give you any specific security protection, and that's the gap π
This doc sets up a framework so security protection from other protocols can be used with MIME, working alongside it π«Ά By itself, it doesn't specify any security protection. A MIME agent must include support for the framework defined here, plus a way to interact with a security protocol defined in a separate document. Put together, that combined service gives you security for single-part and multi-part textual and non-textual messages π₯
The framework works by defining two new security subtypes of the MIME multipart content type: signed and encrypted. Each security subtype has exactly two related body parts: one for the protected data and one for the control information π The type and contents of the control information body parts are decided by the value of the protocol parameter on the enclosing multipart/signed or multipart/encrypted content type, which is required to be present. By registering new values for the required protocol parameter, the framework can be extended to cover a whole variety of protocols π
A MIME agent that supports this framework will be able to recognize a security multipart body part and figure out which of its body parts hold the protected data and which hold the control information π¦ If the value of the protocol parameter isn't recognized, the MIME agent won't be able to process that security multipart. Lowkey tragic, but the agent may keep processing any other body parts that are there π₯²
2. Definition of Security Subtypes of Multipart π
the multipart/signed content type specifies how to support authentication and integrity services through a digital signature βοΈ Its control information is carried in the second of the two required body parts π
the multipart/encrypted content type specifies how to support confidentiality through encryption π Its control information is carried in the first of the two required body parts π
there's a three-step process for originating and receiving multipart/signed and multipart/encrypted contents π§ The details of the processing done during each step are left to the security protocol being used. So the doc is giving the protocol the wheel here, iykyk π
2.1. Definition of Multipart/Signed β¨
okay bestie, let's talk about multipart/signed π, the main character of this section. here's the quick spec card:
- MIME type name:
multipart - MIME subtype name:
signed - Required parameters:
boundary,protocol, andmicalg - Optional parameters: none
- Security considerations: Must be treated as opaque while in transit
so multipart/signed is giving exactly two body parts. no more, no less π
body part one is the exact thing the digital signature was made over, MIME headers and all π. body part two carries the control info you need to verify the signature π. body part one can be any valid MIME content type, as long as it's labeled properly β¨, and body part two gets labeled based on the value of the protocol parameter π§.
let's get into the protocol parameter π«Ά. its attribute token is protocol, so it looks like this:
parameter := "protocol" "=" value
the value token is made of the type and sub-type tokens from the Content-Type: header of body part two, like so:
value := <"> type "/" subtype <">
those type and sub-type tokens come from the MIME [2] specification. and the semantics of protocol depend entirely on its value π.
now the micalg parameter π. its attribute token is micalg:
parameter := "micalg" "=" value
the Message Integrity Check (MIC) is the name for the quantity computed over the body part with a message digest or hash function, which supports the digital signature service π₯. valid value tokens are defined by the spec for the value of the protocol parameter. the value can be a comma (",") separated list of tokens, meaning multiple MIC algorithms are in play. because of that, the comma (",") character is explicitly excluded from the characters that may appear in a token used as a micalg value, so no sneaky commas π. if multiple MIC algorithms are specified, the protocol defines what each one is for and how they're used. and if the MIC algorithm is also in the control information and the two values don't agree, it must be treated as an error π.
NOTE (this part is lowercase-iconic π«Ά): The micalg parameter on the multipart/signed header is explicitly there to support one-pass processing. MIME implementations can find the second body part by feeding in the first body part and computing the specified MIC values until they hit the boundary that marks the second body part.
now the big rule π: the entire contents of the multipart/signed container must be treated as opaque while in transit from an originator to a recipient. intermediate message transfer agents must not alter the content of a multipart/signed in any way, including (but not limited to!) changing the content transfer encoding of the body part or any of its encapsulated body parts. hands off π«.
the signature in a multipart/signed only applies to the material that is actually within the multipart/signed object π―. so it does not apply to any enclosing message material, and it does not apply to entities that are referenced (e.g. via a MIME message/external-body) by rather than included in the signed content.
when creating a multipart/signed body part, here's the sequence of steps π§. important: it must be emphasized that these steps are descriptive, not prescriptive, and in no way impose restrictions or requirements on implementations of this specification.
- The content of the body part to be protected is prepared according to a local convention. The content is then transformed into a MIME body part in canonical MIME format, including an appropriate set of MIME headers.
In addition, if the multipart/signed object is EVER to be transferred over the standard Internet SMTP infrastructure, the resulting MIME body is constrained to 7 bits -- that is, the use of material requiring either 8bit or binary content-transfer-encoding is NOT allowed. Such 8bit or binary material MUST be encoded using either the quoted-printable or base64 encodings.
This requirement exists because it is not generally possible, given the current characteristics of Internet SMTP, for a message originator to guarantee that a message will travel only along paths capable of carrying 8bit or binary material.
SMTP clients normally have the option of either converting the message to eliminate the use of 8bit or binary encoding or returning a nondelivery notification to the originator. However, conversion is not viable in the case of signed objects since conversion would necessarily invalidate the signature. This leaves a nondelivery notification as the only available option, which is not acceptable π.
- The body part (headers and content) to be digitally signed is prepared for signature according to the value of the protocol parameter. The MIME headers of the signed body part are included in the signature to protect the integrity of the MIME labeling of the data that is signed.
- The prepared body part is made available to the signature creation process according to a local convention. The signature creation process must make available to a MIME implementation two data streams: the control information necessary to verify the signature, which the MIME implementation will place in the second body part and label according to the value of the protocol parameter, and the digitally signed body part, which the MIME implementation will use as the first body part.
when receiving a multipart/signed body part, here's the sequence of steps for verifying the signature or signatures π. same deal as before: it must be emphasized that these steps are descriptive, not prescriptive, and in no way impose restrictions or requirements on implementations of this specification.
- The first body part and the control information in the second body part must be prepared for the signature verification process according to the value of the protocol parameter.
- The prepared body parts must be made available to the signature verification process according to a local convention. The signature verification process must make available to the MIME implementation the result of the signature verification and the body part that was digitally signed.
NOTE: The result of the signature verification is likely to include a testament of the success or failure of the verification. Also, in the usual case, the body part returned after signature verification will be the same as the body part that was received. We do not insist that this be the case to allow for protocols that may modify the body part during the signature processing.
- The result of the signature verification process is made available to the user and the MIME implementation continues processing with the verified body part, i.e., the body part returned by the signature verification process.
the following example is an illustration of a multipart/signed body part π¦. it's necessarily incomplete, since the control information is defined by the security protocol, which must be specified in a separate document π.
Content-Type: multipart/signed; protocol="TYPE/STYPE";
micalg="MICALG"; boundary="Signed Boundary"
--Signed Boundary
Content-Type: text/plain; charset="us-ascii"
This is some text to be signed although it could be
any type of data, labeled accordingly, of course.
--Signed Boundary
Content-Type: TYPE/STYPE
CONTROL INFORMATION for protocol "TYPE/STYPE" would be here
--Signed Boundary--
2.2. Definition of Multipart/Encrypted π
Okay bestie, the encrypted one is basically the signed one's sister π Same template energy, so let's do the registration bits first:
- MIME type name:
multipart - MIME subtype name:
encrypted - Required parameters:
boundary,protocol - Optional parameters:
none - Security considerations:
none
Okay so multipart/encrypted is exactly two body parts, no more, no less π. Part one holds the control info you need to decrypt, and it's labeled according to the protocol parameter. Part two is the scrambled data, and it's always labeled application/octet-stream π.
The attribute token for the protocol parameter is "protocol", so it looks like this:
parameter := "protocol" "=" value
The value token is made from the type and sub-type tokens of the Content-Type: header on the first body part, like so:
value := <"> type "/" subtype <">
The type and subtype tokens are defined by the MIME [2] specification. The semantics of the protocol parameter depend on its value π.
When you're creating a multipart/encrypted body part, here's the step-by-step. Tea time β: it MUST be emphasized that these steps are descriptive, not prescriptive, and they in no way impose restrictions or requirements on implementations of this specification π
- The contents of the body part to be protected get prepared according to a local convention. Then they're transformed into a MIME body part in canonical MIME format, including an appropriate set of MIME headers.
- The body part (headers and content) to be encrypted gets prepared for encryption according to the value of the protocol parameter. The MIME headers of the encrypted body part are included in the encryption, so the MIME labeling of the encrypted data stays protected from disclosure π
- The prepared body part is made available to the encryption process according to a local convention. The encryption process MUST make available to a MIME implementation two data streams: the control information needed to decrypt the body part, which the MIME implementation puts in the first body part and labels according to the value of the protocol parameter, and the encrypted body part, which it puts in the second body part and labels
application/octet-stream. So in a multipart/encrypted, theapplication/octet-streamdata is a nested MIME body part πͺ
When you're receiving a multipart/encrypted body part, here's how to decrypt the enclosed data. Same tea β: it MUST be emphasized that these steps are descriptive, not prescriptive, and in no way impose restrictions or requirements on implementations of this specification.
- The second body part and the control information in the first body part MUST be prepared for the decryption process according to the value of the protocol parameter.
- The prepared body parts MUST be made available to the decryption process according to a local convention. The decryption process MUST make available to the MIME implementation the result of the decryption and the decrypted form of the encrypted body part.
NOTE: The result of the decryption process is likely to include a testament of the success or failure of the decryption. Failure MAY be due to an inability to locate the proper decryption key or the proper recipient field, etc. Implementors SHOULD note that the data, if any, of a failed decryption process is pretty much guaranteed to be garbage π
- The result of the decryption process is made available to the user, and the MIME implementation keeps processing the decrypted body part, i.e., the body part returned by the decryption process β¨
NOTE: A MIME implementation will not be able to display the received form of the second body part, because applying encryption transforms the body part. That transformation won't be described in the MIME headers (Content-Type:andContent-Transfer-Encoding:), but rather in the content of the first body part. So an implementation SHOULD wait until the encryption has been removed before trying to display the content π
Here's an illustration of a multipart/encrypted body part π§ It's necessarily incomplete, since the control information is defined by the security protocol, which MUST be specified in a separate document.
Content-Type: multipart/encrypted; protocol="TYPE/STYPE";
boundary="Encrypted Boundary"
--Encrypted Boundary
Content-Type: TYPE/STYPE
CONTROL INFORMATION for protocol "TYPE/STYPE" would be here
--Encrypted Boundary
Content-Type: application/octet-stream
Content-Type: text/plain; charset="us-ascii"
All of this indented text, including the indented headers,
would be unreadable since it would have been encrypted by
the protocol "TYPE/STYPE". Also, this encrypted data could
be any type of data, labeled accordingly, of course.
--Encrypted Boundary--
3. Definition of Control Information Content Types π§Ύβ¨
This document defines a framework within which security services MAY be applied to MIME body parts. A minimal MIME implementation will be able to recognize multipart/signed and multipart/encrypted body parts, and identify the protected data and control information body parts inside them π
Complete support for security services requires the MIME agent to recognize the value of the protocol parameter and to keep processing based on that value. The value of the protocol parameter is the same value used to label the content type of the control information π
The value of the protocol parameter and the resulting processing required MUST be specified in the document defining the security protocol used. That document MUST also precisely specify the contents of the control information body part π
4. Definition of Key Management Content Types π
This specification recognizes that the complete specification of a MIME-based security protocol MUST include a mechanism for distributing the cryptographic material used in support of the security services. For example, a digital signature service implemented with asymmetric cryptography requires that a signer's public key be available to the signee ποΈ
One possible mechanism for distributing cryptographic material is to define two additional body parts: one for requesting cryptographic information, and one for returning the cryptographic information that was requested. The specification of a security protocol MAY include a definition of two such body parts, or it MAY specify an alternate mechanism for distributing cryptographic material π¦
5. Security Considerations π¨
This specification describes an enhancement to MIME to support signed and encrypted body parts. In that context, this entire document is about security. Dramatic, I know, but it's literally true ππ
6. Acknowledgements π«Ά
David H. Crocker suggested the use of a multipart structure for the MIME and PEM interaction. Iconic idea, honestly π
7. References π
- [1] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", STD 11, RFC 822, University of Delaware, August 1982.
- [2] Borenstein, N., and N. Freed, "MIME (Multipurpose Internet Mail Extension) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies", RFC 1521, Bellcore and Innosoft, September 1993.
8. Authors' Addresses π
Jim Galvin
Trusted Information Systems
3060 Washington Road
Glenwood, MD 21738
Phone: +1 301 854 6889
Fax: +1 301 854 5363
EMail: galvin@tis.com
Sandy Murphy
Trusted Information Systems
3060 Washington Road
Glenwood, MD 21738
Phone: +1 301 854 6889
Fax: +1 301 854 5363
EMail: sandy@tis.com
Steve Crocker
CyberCash, Inc.
2086 Hunters Crest Way
Vienna, VA 22181
Phone:: +1 703 620 1222
Fax: +1 703 391 2651
EMail: crocker@cybercash.com
Ned Freed
Innosoft International, Inc.
1050 East Garvey Avenue South
West Covina, CA 91790
Phone: +1 818 919 3600
Fax: +1 818 919 3614
EMail: ned@innosoft.com
π¦ where this page comes from
- ietf: rfc1847 1995-10
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms