RFC 1847 PROPOSED STANDARD EMAIL · MIME · SECURITY

MIME Security Multiparts: Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted

Two MIME wrappers that carry protected data and the control information needed to verify or unlock it.

On rfc-editor.org ↗
PUBLISHED
October 1995
AUTHORS
J. Galvin, S. Murphy, S. Crocker, N. Freed
STREAM
IETF
BODY PARTS PER CONTAINER
Exactly 2
SIGNED REQUIRED PARAMETERS
boundary, protocol, micalg
ENCRYPTED REQUIRED PARAMETERS
boundary, protocol
ENCRYPTED DATA TYPE
application/octet-stream
SIGNED OVER SMTP
7-bit only
DOI
10.17487/RFC1847

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Network Working Group                                          J. Galvin
Request For Comments: 1847                                     S. Murphy
Category: Standards Track                    Trusted Information Systems
                                                              S. Crocker
                                                         CyberCash, Inc.
                                                                N. Freed
                                            Innosoft International, Inc.
                                                            October 1995


                     Security Multiparts for MIME:
                Multipart/Signed and Multipart/Encrypted

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

   This document defines a framework within which security services may
   be applied to MIME body parts.  MIME, an acronym for "Multipurpose
   Internet Mail Extensions", defines the format of the contents of
   Internet mail messages and provides for multi-part textual and non-
   textual message bodies.  The new content types are subtypes of
   multipart: signed and encrypted.  Each will contain two body parts:
   one for the protected data and one for the control information
   necessary to remove the protection.  The type and contents of the
   control information body parts are determined by the value of the
   protocol parameter of the enclosing multipart/signed or
   multipart/encrypted content type, which 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

   An Internet electronic mail message consists of two parts: the
   headers and the body.  The headers form a collection of field/value
   pairs structured according to STD 11, RFC 822 [1], whilst the body,
   if structured, is defined according to MIME [2].  The basic MIME
   specification does not provide specific security protection.

   This document defines a framework whereby security protection
   provided by other protocols may be used with MIME in a complementary
   fashion.  By itself, it does not specify security protection.  A MIME
   agent must include support for both the framework defined here and a
   mechanism to interact with a security protocol defined in a separate
   document.  The resulting combined service provides security for
   single-part and multi-part textual and non-textual messages.

   The framework is provided by defining two new security subtypes of
   the MIME multipart content type: signed and encrypted.  In each of
   the security subtypes, there are 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 determined by
   the value of the protocol parameter of 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 is easily extended to accommodate a variety of protocols.

   A MIME agent that includes support for this framework will be able to
   recognize a security multipart body part and to identify its
   protected data and control information body parts.  If the value of
   the protocol parameter is unrecognized the MIME agent will not be
   able to process the security multipart.  However, a MIME agent may
   continue to process any other body parts that may be present.

2.  Definition of Security Subtypes of Multipart

   The multipart/signed content type specifies how to support
   authentication and integrity services via digital signature.  The
   control information is carried in the second of the two required body
   parts.

   The multipart/encrypted content type specifies how to support
   confidentiality via encryption.  The control information is carried
   in the first of the two required body parts.

   A three-step process is described for the origination and reception
   of the multipart/signed and multipart/encrypted contents.  The
   details of the processing performed during each step is left to be
   specified by the security protocol being used.

2.1.  Definition of Multipart/Signed

   (1)  MIME type name: multipart

   (2)  MIME subtype name: signed

   (3)  Required parameters: boundary, protocol, and micalg

   (4)  Optional parameters: none

   (5)  Security considerations: Must be treated as opaque while in
        transit

   The multipart/signed content type contains exactly two body parts.
   The first body part is the body part over which the digital signature
   was created, including its MIME headers.  The second body part
   contains the control information necessary to verify the digital
   signature.  The first body part may contain any valid MIME content
   type, labeled accordingly.  The second body part is labeled according
   to the value of the protocol parameter.

   The attribute token for the protocol parameter is "protocol", i.e.,

    parameter := "protocol" "=" value

   The value token is comprised of the type and sub-type tokens of the
   Content-Type: header of the second body part, i.e.,

    value := <"> type "/" subtype <">

   where the type and subtype tokens are defined by the MIME [2]
   specification.  The semantics of the protocol parameter are defined
   according to its value.

   The attribute token for the micalg parameter is "micalg", i.e.,

    parameter := "micalg" "=" value

   The Message Integrity Check (MIC) is the name given to the quantity
   computed over the body part with a message digest or hash function,
   in support of the digital signature service.  Valid value tokens are
   defined by the specification for the value of the protocol parameter.
   The value may be a comma (",") separated list of tokens, indicating
   the use of multiple MIC algorithms.  As a result, the comma (",")
   character is explicitly excluded from the list of characters that may
   be included in a token used as a value of the micalg parameter.  If
   multiple MIC algorithms are specified, the purpose and use of the
   multiple algorithms is defined by the protocol.  If the MIC algorithm
   is also specified in the control information and the value there does
   not agree with the value in this parameter, it must be treated as an
   error.

    NOTE: The presence of the micalg parameter on the
    multipart/signed content type header is explicitly intended to
    support one-pass processing.  MIME implementations may locate
    the second body part by inputting the first body part and
    computing the specified MIC values until the boundary
    identifying the second body part is found.

   The entire contents of the multipart/signed container must be treated
   as opaque while it is 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.

   The signature in a multipart/signed only applies to the material that
   is actually within the multipart/signed object.  In particular, it
   does not apply to any enclosing message material, nor does it 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, the following sequence of
   steps describes the processing necessary.  It must be emphasized that
   these steps are descriptive, not prescriptive, and in no way impose
   restrictions or requirements on implementations of this
   specification.

   (1)  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.

   (2)  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.

   (3)  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, the following sequence
   of steps describes the processing necessary to verify the signature
   or signatures.  It must be emphasized that these steps are
   descriptive, not prescriptive, and in no way impose restrictions or
   requirements on implementations of this specification.

   (1)  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.

   (2)  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.

   (3)  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 is 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

   (1)  MIME type name: multipart

   (2)  MIME subtype name: encrypted

   (3)  Required parameters: boundary, protocol

   (4)  Optional parameters: none

   (5)  Security considerations: none

   The multipart/encrypted content type contains exactly two body parts.
   The first body part contains the control information necessary to
   decrypt the data in the second body part and is labeled according to
   the value of the protocol parameter.  The second body part contains
   the data which was encrypted and is always labeled
   application/octet-stream.

   The attribute token for the protocol parameter is "protocol", i.e.,

    parameter := "protocol" "=" value
   The value token is comprised of the type and sub-type tokens of the
   Content-Type: header of the first body part, i.e.,

    value := <"> type "/" subtype <">

   where the type and subtype tokens are defined by the MIME [2]
   specification.  The semantics of the protocol parameter are defined
   according to its value.

   When creating a multipart/encrypted body part, the following sequence
   of steps describes the processing necessary.  It must be emphasized
   that these steps are descriptive, not prescriptive, and in no way
   impose restrictions or requirements on implementations of this
   specification.

   (1)  The contents of the body part to be protected is prepared according
        to a local convention.  The contents are then transformed into a
        MIME body part in canonical MIME format, including an appropriate
        set of MIME headers.

   (2)  The body part (headers and content) to be encrypted is prepared for
        encryption according to the value of the protocol parameter.  The
        MIME headers of the encrypted body part are included in the
        encryption to protect from disclosure the MIME labeling of the
        data that is encrypted.

   (3)  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 necessary to decrypt the body part, which the MIME
        implementation will place in the first body part and label
        according to the value of the protocol parameter, and the
        encrypted body part, which the MIME implementation will place in
        the second body part and label application/octet-stream.  Thus,
        when used in a multipart/encrypted, the application/octet-stream
        data is comprised of a nested MIME body part.

   When receiving a multipart/encrypted body part, the following
   sequence of steps describes the processing necessary to decrypt the
   enclosed data.  It must be emphasized that these steps are
   descriptive, not prescriptive, and in no way impose restrictions or
   requirements on implementations of this specification.

   (1)  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.

   (2)  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.

   (3)  The result of the decryption process is made available to the user
        and the MIME implementation continues processing with 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 the
            application of encryption will transform the body part.
            This transformation will not be described in the MIME
            headers (Content-Type: and Content-Transfer-Encoding:) but,
            rather, will be described in the content of the first body
            part.  Therefore, an implementation should wait until the
            encryption has been removed before attempting to display
            the content.

   The following example is an illustration of a multipart/encrypted
   body part.  It is 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 be able to identify the protected data and control information
   body parts within them.

   Complete support for security services requires the MIME agent to
   recognize the value of the protocol parameter and to continue
   processing based on its 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 the purpose of requesting
   cryptographic information and one for the purpose of returning the
   cryptographic information requested.  The specification of a security
   protocol may include a definition of two such body parts or it may
   specify an alternate mechanism for the distribution of 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.

6.  Acknowledgements

   David H. Crocker suggested the use of a multipart structure for the
   MIME and PEM interaction.

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

AI ELI5

On this page
PROBLEMMIME describes the format of Internet mail bodies but provides no security protection of its own.
MECHANISMIt defines two multipart subtypes, signed and encrypted, each with exactly two body parts: the protected data and the control information. A required protocol parameter says what the control information is.
THE CATCHBy itself the RFC specifies no security protection. It is a framework, and each security protocol must be defined in a separate document that plugs in through the protocol parameter.

§1Why MIME Needs a Security Framework

An Internet mail message has headers and a body. The headers follow RFC 822, and a structured body follows MIME (RFC 1521). The basic MIME specification does not provide specific security protection.

This RFC defines a framework so that security services supplied by other protocols can be used with MIME. By itself it does not specify security protection. A MIME agent needs support for both this framework and a mechanism to interact with a security protocol defined in a separate document.

MIME is like a mailroom that knows how to pack parcels but has no locks. This RFC adds a standard way to attach locks that other people design.

§2Two Security Subtypes of Multipart

The framework adds two new subtypes of the MIME multipart content type: signed and encrypted. In each, there are exactly two related body parts: one for the protected data and one for the control information.

The multipart/signed type supports authentication and integrity through a digital signature, and its control information is in the second part. The multipart/encrypted type supports confidentiality through encryption, and its control information is in the first part.

Both types require a protocol parameter. Its value decides the type and contents of the control information part. New protocols are added by registering new values for it. A MIME agent that does not recognize the value cannot process the security multipart, but it may still process any other body parts present.

Each envelope has exactly two compartments: one for the message and one for the instructions. A label on the outside says which kind of instructions are inside.

THE TWO SECURITY SUBTYPES
Propertymultipart/signedmultipart/encrypted
ServiceAuthentication and integrityConfidentiality
Control informationSecond body partFirst body part
Protected dataFirst body part, any MIME typeSecond part, application/octet-stream
Required parametersboundary, protocol, micalgboundary, protocol

§2.1The Multipart/Signed Format

A multipart/signed object has the required parameters boundary, protocol and micalg, and no optional ones. The first body part is the part over which the signature was made, including its MIME headers, and it may be any valid MIME type. The second part holds the control information needed to verify the signature, labeled by the protocol value.

The micalg parameter names the algorithm for the Message Integrity Check (MIC), the quantity computed over the body part with a message digest or hash function. Its value may be a comma-separated list when multiple algorithms are used. If the control information also names the algorithm and the two disagree, that is an error. The parameter exists to support one-pass processing: an implementation can compute the MIC while reading the first part until it reaches the boundary of the second.

The whole container must be treated as opaque in transit. Intermediate message transfer agents must not alter it, including changing the content transfer encoding of any part. The signature covers only material inside the object, not enclosing message material or entities referenced rather than included.

If a signed object may ever cross standard Internet SMTP, its body is constrained to 7 bits. Any 8bit or binary material MUST be encoded as quoted-printable or base64, because converting it later would invalidate the signature.

A signed message is a letter with a seal-note stapled behind it. Nobody along the way may rewrite the letter, or the seal would no longer match.

EXAMPLE FROM RFC 1847 (CONTROL INFORMATION LEFT GENERIC)
A multipart/signed body part
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.1.1Signing and Verifying Steps

The RFC describes a three-step process for each direction. It stresses that the steps are descriptive, not prescriptive.

To create a signed part: prepare the content as a MIME body part in canonical format with its headers; prepare it for signature according to the protocol value, including the MIME headers so the labeling is protected; then hand it to the signature process, which returns the control information (placed in the second part) and the signed body part (the first part).

To verify: prepare the first part and the control information per the protocol value, pass them to the verification process, and give the user the result. The MIME agent then continues with the body part that verification returned. Usually that is identical to the received part, but the RFC allows protocols that modify it.

To sign, you pack the letter and get a seal-note. To check, you compare the letter with the seal-note and tell the reader whether they match.

§2.2The Multipart/Encrypted Format

A multipart/encrypted object has the required parameters boundary and protocol, and no optional ones. The first body part holds the control information needed to decrypt, labeled by the protocol value. The second part holds the encrypted data and is always labeled application/octet-stream.

The MIME headers of the original body part are included in the encryption, so the labeling of the data is hidden too. As a result, the octet-stream data is itself a nested MIME body part. A receiver cannot display the second part as received, because the transformation is described in the control information rather than in the MIME headers. It should wait until the encryption is removed before trying to display anything.

The decryption result is likely to say whether it succeeded. Failure may come from a missing key or recipient field, and the data from a failed decryption is described as pretty much guaranteed to be garbage.

An encrypted message is a key card in one compartment and a locked box in the other. You must unlock the box before you can see even what kind of thing is inside.

§3Control Information and Key Management

A minimal MIME implementation can recognize both multipart types and identify the protected data and control information parts. Complete support means recognizing the protocol value and continuing based on it. That value is the same one used to label the content type of the control information.

The document that defines a security protocol must specify the protocol value, the processing it requires and the exact contents of the control information part.

That document must also account for distributing cryptographic material, for example a signer's public key. One possible approach is two extra body parts, one to request cryptographic information and one to return it, but a protocol may choose another mechanism.

The envelope rules do not say how locks work. Whoever invents a lock must write down how it works and how to get its key.

§4Security Considerations

The RFC states that it describes an enhancement to MIME to support signed and encrypted body parts, so in that context the entire document is about security. The type registration for multipart/signed adds that it must be treated as opaque while in transit; the registration for multipart/encrypted lists no security considerations.

The whole point of this RFC is safety, and the one big rule is: do not open and change a signed envelope while it travels.

§8References