home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 1000s / rfc1040.txt < prev    next >
Text File  |  1988-01-21  |  75KB  |  1,622 lines

  1. Network Working Group                                    J. Linn (BBNCC)
  2. Request for Comments: 1040                        IAB Privacy Task Force
  3. Obsoletes RFCs: 989                                         January 1988
  4.  
  5.  
  6.            Privacy Enhancement for Internet Electronic Mail:
  7.        Part I: Message Encipherment and Authentication Procedures
  8.  
  9.  
  10. STATUS OF THIS MEMO
  11.  
  12.    This RFC suggests a proposed protocol for the Internet community, and
  13.    requests discussion and suggestions for improvements.  Distribution
  14.    of this memo is unlimited.
  15.  
  16. ACKNOWLEDGMENT
  17.  
  18.    This RFC is the outgrowth of a series of IAB Privacy Task Force
  19.    meetings and of internal working papers distributed for those
  20.    meetings.  I would like to thank the following Privacy Task Force
  21.    members and meeting guests for their comments and contributions at
  22.    the meetings which led to the preparation of this RFC:  David
  23.    Balenson, Curt Barker, Matt Bishop, Danny Cohen, Tom Daniel, Charles
  24.    Fox, Morrie Gasser, Steve Kent (chairman), John Laws, Steve Lipner,
  25.    Dan Nessett, Mike Padlipsky, Rob Shirey, Miles Smid, Steve Walker,
  26.    and Steve Wilbur.
  27.  
  28. 1.  Executive Summary
  29.  
  30.    This RFC defines message encipherment and authentication procedures,
  31.    as the initial phase of an effort to provide privacy enhancement
  32.    services for electronic mail transfer in the Internet.  Detailed key
  33.    management mechanisms to support these procedures will be defined in
  34.    a subsequent RFC.  As a goal of this initial phase, it is intended
  35.    that the procedures defined here be compatible with a wide range of
  36.    key management approaches, including both conventional (symmetric)
  37.    and public-key (asymmetric) approaches for encryption of data
  38.    encrypting keys.  Use of conventional cryptography for message text
  39.    encryption and/or integrity check computation is anticipated.
  40.  
  41.    Privacy enhancement services (confidentiality, authentication, and
  42.    message integrity assurance) are offered through the use of
  43.    end-to-end cryptography between originator and recipient User Agent
  44.    processes, with no special processing requirements imposed on the
  45.    Message Transfer System at endpoints or at intermediate relay
  46.    sites.  This approach allows privacy enhancement facilities to be
  47.    incorporated on a site-by-site or user-by-user basis without impact
  48.    on other Internet entities.  Interoperability among heterogeneous
  49.  
  50.  
  51.  
  52. Linn                                                            [Page 1]
  53.  
  54. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  55.  
  56.  
  57.    components and mail transport facilities is supported.
  58.  
  59. 2.  Terminology
  60.  
  61.    For descriptive purposes, this RFC uses some terms defined in the OSI
  62.    X.400 Message Handling System Model per the 1984 CCITT
  63.    Recommendations.  This section replicates a portion of X.400's
  64.    Section 2.2.1, "Description of the MHS Model: Overview" in order to
  65.    make the terminology clear to readers who may not be familiar with
  66.    the OSI MHS Model.
  67.  
  68.    In the [MHS] model, a user is a person or a computer application.  A
  69.    user is referred to as either an originator (when sending a message)
  70.    or a recipient (when receiving one).  MH Service elements define the
  71.    set of message types and the capabilities that enable an originator
  72.    to transfer messages of those types to one or more recipients.
  73.  
  74.    An originator prepares messages with the assistance of his User
  75.    Agent.  A User Agent (UA) is an application process that interacts
  76.    with the Message Transfer System (MTS) to submit messages.  The MTS
  77.    delivers to one or more recipient UAs the messages submitted to it.
  78.    Functions performed solely by the UA and not standardized as part of
  79.    the MH Service elements are called local UA functions.
  80.  
  81.    The MTS is composed of a number of Message Transfer Agents (MTAs).
  82.    Operating together, the MTAs relay messages and deliver them to the
  83.    intended recipient UAs, which then make the messages available to the
  84.    intended recipients.
  85.  
  86.    The collection of UAs and MTAs is called the Message Handling System
  87.    (MHS).  The MHS and all of its users are collectively referred to as
  88.    the Message Handling Environment.
  89.  
  90. 3.  Services, Constraints, and Implications
  91.  
  92.    This RFC defines mechanisms to enhance privacy for electronic mail
  93.    transferred in the Internet.  The facilities discussed in this RFC
  94.    provide privacy enhancement services on an end-to-end basis between
  95.    sender and recipient UAs.  No privacy enhancements are offered for
  96.    message fields which are added or transformed by intermediate relay
  97.    points.
  98.  
  99.    Authentication and integrity facilities are always applied to the
  100.    entirety of a message's text.  No facility for confidentiality
  101.    service without authentication is provided.  Encryption facilities
  102.    may be applied selectively to portions of a message's contents; this
  103.    allows less sensitive portions of messages (e.g., descriptive fields)
  104.    to be processed by a recipient's delegate in the absence of the
  105.  
  106.  
  107.  
  108. Linn                                                            [Page 2]
  109.  
  110. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  111.  
  112.  
  113.    recipient's personal cryptographic keys.  In the limiting case, where
  114.    the entirety of message text is excluded from encryption, this
  115.    feature can be used to yield the effective combination of
  116.    authentication and integrity services without confidentiality.
  117.  
  118.    In keeping with the Internet's heterogeneous constituencies and usage
  119.    modes, the measures defined here are applicable to a broad range of
  120.    Internet hosts and usage paradigms.  In particular, it is worth
  121.    noting the following attributes:
  122.  
  123.        1.  The mechanisms defined in this RFC are not restricted to a
  124.            particular host or operating system, but rather allow
  125.            interoperability among a broad range of systems.  All
  126.            privacy enhancements are implemented at the application
  127.            layer, and are not dependent on any privacy features at
  128.            lower protocol layers.
  129.  
  130.        2.  The defined mechanisms are compatible with non-enhanced
  131.            Internet components.  Privacy enhancements are implemented
  132.            in an end-to-end fashion which does not impact mail
  133.            processing by intermediate relay hosts which do not
  134.            incorporate privacy enhancement facilities.  It is
  135.            necessary, however, for a message's sender to be cognizant
  136.            of whether a message's intended recipient implements privacy
  137.            enhancements, in order that encoding and possible
  138.            encipherment will not be performed on a message whose
  139.            destination is not equipped to perform corresponding inverse
  140.            transformations.
  141.  
  142.        3.  The defined mechanisms are compatible with a range of mail
  143.            transport facilities (MTAs).  Within the Internet,
  144.            electronic mail transport is effected by a variety of SMTP
  145.            implementations.  Certain sites, accessible via SMTP,
  146.            forward mail into other mail processing environments (e.g.,
  147.            USENET, CSNET, BITNET).  The privacy enhancements must be
  148.            able to operate across the SMTP realm; it is desirable that
  149.            they also be compatible with protection of electronic mail
  150.            sent between the SMTP environment and other connected
  151.            environments.
  152.  
  153.        4.  The defined mechanisms offer compatibility with a broad
  154.            range of electronic mail user agents (UAs).  A large variety
  155.            of electronic mail user agent programs, with a corresponding
  156.            broad range of user interface paradigms, is used in the
  157.            Internet.  In order that an electronic mail privacy
  158.            enhancement be available to the broadest possible user
  159.            community, the selected mechanism should be usable with the
  160.            widest possible variety of existing UA programs.  For
  161.  
  162.  
  163.  
  164. Linn                                                            [Page 3]
  165.  
  166. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  167.  
  168.  
  169.            purposes of pilot implementation, it is desirable that
  170.            privacy enhancement processing be incorporable into a
  171.            separate program, applicable to a range of UAs, rather than
  172.            requiring internal modifications to each UA with which
  173.            enhanced privacy services are to be provided.
  174.  
  175.        5.  The defined mechanisms allow electronic mail privacy
  176.            enhancement processing to be performed on personal computers
  177.            (PCs) separate from the systems on which UA functions are
  178.            implemented.  Given the expanding use of PCs and the limited
  179.            degree of trust which can be placed in UA implementations on
  180.            many multi-user systems, this attribute can allow many users
  181.            to process privacy-enhanced mail with a higher assurance
  182.            level than a strictly UA-based approach would allow.
  183.  
  184.        6.  The defined mechanisms support privacy protection of
  185.            electronic mail addressed to mailing lists.
  186.  
  187.    In order to achieve applicability to the broadest possible range of
  188.    Internet hosts and mail systems, and to facilitate pilot
  189.    implementation and testing without the need for prior modifications
  190.    throughout the Internet, three basic restrictions are imposed on the
  191.    set of measures to be considered in this RFC:
  192.  
  193.        1.  Measures will be restricted to implementation at endpoints
  194.            and will be amenable to integration at the user agent (UA)
  195.            level or above, rather than necessitating integration into
  196.            the message transport system (e.g., SMTP servers).
  197.  
  198.        2.  The set of supported measures enhances rather than restricts
  199.            user capabilities.  Trusted implementations, incorporating
  200.            integrity features protecting software from subversion by
  201.            local users, cannot be assumed in general.  In the absence
  202.            of such features, it appears more feasible to provide
  203.            facilities which enhance user services (e.g., by protecting
  204.            and authenticating inter-user traffic) than to enforce
  205.            restrictions (e.g., inter-user access control) on user
  206.            actions.
  207.  
  208.        3.  The set of supported measures focuses on a set of functional
  209.            capabilities selected to provide significant and tangible
  210.            benefits to a broad user community.  By concentrating on the
  211.            most critical set of services, we aim to maximize the added
  212.            privacy value that can be provided with a modest level of
  213.            implementation effort.
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220. Linn                                                            [Page 4]
  221.  
  222. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  223.  
  224.  
  225.    As a result of these restrictions, the following facilities can be
  226.    provided:
  227.  
  228.            1.  disclosure protection,
  229.  
  230.            2.  sender authenticity, and
  231.  
  232.            3.  message integrity measures,
  233.  
  234.    but the following privacy-relevant concerns are not addressed:
  235.  
  236.            1.  access control,
  237.  
  238.            2.  traffic flow confidentiality,
  239.  
  240.            3.  address list accuracy,
  241.  
  242.            4.  routing control,
  243.  
  244.            5.  issues relating to the serial reuse of PCs by multiple
  245.                users,
  246.  
  247.            6.  assurance of message receipt and non-deniability of
  248.                receipt,
  249.  
  250.            7.  automatic association of acknowledgments with the
  251.                messages to which they refer, and
  252.  
  253.            8.  message duplicate detection, replay prevention, or other
  254.                stream-oriented services.
  255.  
  256.    An important goal is that privacy enhancement mechanisms impose a
  257.    minimum of burden on the users they serve.  In particular, this goal
  258.    suggests eventual automation of the key management mechanisms
  259.    supporting message encryption and authentication.  In order to
  260.    facilitate deployment and testing of pilot privacy enhancement
  261.    implementations in the near term, however, compatibility with
  262.    out-of-band (e.g., manual) key distribution must also be supported.
  263.  
  264.    A message's sender will determine whether privacy enhancements are to
  265.    be performed on a particular message.  Therefore, a sender must be
  266.    able to determine whether particular recipients are equipped to
  267.    process privacy-enhanced mail.  In a general architecture, these
  268.    mechanisms will be based on server queries; thus, the query function
  269.    could be integrated into a UA to avoid imposing burdens or
  270.    inconvenience on electronic mail users.
  271.  
  272.  
  273.  
  274.  
  275.  
  276. Linn                                                            [Page 5]
  277.  
  278. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  279.  
  280.  
  281. 4.  Processing of Messages
  282.  
  283. 4.1  Message Processing Overview
  284.  
  285.    This subsection provides a high-level overview of the components and
  286.    processing steps involved in electronic mail privacy enhancement
  287.    processing.  Subsequent subsections will define the procedures in
  288.    more detail.
  289.  
  290.    A two-level keying hierarchy is used to support privacy-enhanced
  291.    message transmission:
  292.  
  293.        1.  Data Encrypting Keys (DEKs) are used for encryption of
  294.            message text and (with certain choices among a set of
  295.            alternative algorithms) for computation of message integrity
  296.            check quantities (MICs).  DEKs are generated individually
  297.            for each transmitted message; no predistribution of DEKs is
  298.            needed to support privacy-enhanced message transmission.
  299.  
  300.        2.  Interchange Keys (IKs) are used to encrypt DEKs for
  301.            transmission within messages.  An IK may be a single
  302.            symmetric cryptographic key or, where asymmetric
  303.            (public-key) cryptography is used to encrypt DEKs, the
  304.            composition of a public component used by an originator and
  305.            a secret component used by a recipient.  Ordinarily, the
  306.            same IK will be used for all messages sent between a given
  307.            originator-recipient pair over a period of time.  Each
  308.            transmitted message includes a representation of the DEK(s)
  309.            used for message encryption and/or authentication,
  310.            encrypted under an individual IK per named recipient.  This
  311.            representation is associated with sender and recipient
  312.            identification header fields, which enable recipients to
  313.            identify the IKs used.  With this information, the recipient
  314.            can decrypt the transmitted DEK representation, yielding
  315.            the DEK required for message text decryption and/or MIC
  316.            verification.
  317.  
  318.    When privacy enhancement processing is to be performed on an outgoing
  319.    message, a DEK is generated [1] for use in message encryption and a
  320.    variant of the DEK is formed (if the chosen MIC algorithm requires a
  321.    key) for use in MIC computation.  An "X-Sender-ID:" field is included
  322.    in the header to provide one identification component for the IK(s)
  323.    used for message processing.  An IK is selected for each individually
  324.    identified recipient; a corresponding "X-Recipient-ID:" field,
  325.    interpreted in the context of a prior "X-Sender-ID:" field, serves to
  326.    identify each IK.  Each "X-Recipient-ID:" field is followed by an
  327.    "X-Key-Info:" field, which transfers the DEK and computed MIC.  The
  328.    DEK and MIC are encrypted for transmission under the appropriate IK.
  329.  
  330.  
  331.  
  332. Linn                                                            [Page 6]
  333.  
  334. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  335.  
  336.  
  337.    A four-phase transformation procedure is employed in order to
  338.    represent encrypted message text in a universally transmissible form
  339.    and to enable messages encrypted on one type of system to be
  340.    decrypted on a different type.  A plaintext message is accepted in
  341.    local form, using the host's native character set and line
  342.    representation.  The local form is converted to a canonical message
  343.    text representation, defined as equivalent to the inter-SMTP
  344.    representation of message text.  This canonical representation forms
  345.    the input to the encryption and MIC computation processes.
  346.  
  347.    For encryption purposes, the canonical representation is padded as
  348.    required by the encryption algorithm.  The padded canonical
  349.    representation is encrypted (except for any regions explicitly
  350.    excluded from encryption).  The canonically encoded representation is
  351.    encoded, after encryption, into a printable form.  The printable form
  352.    is composed of a restricted character set which is chosen to be
  353.    universally representable across sites, and which will not be
  354.    disrupted by processing within and between MTS entities.
  355.  
  356.    The output of the encoding procedure is combined with a set of header
  357.    fields carrying cryptographic control information.  The result is
  358.    passed to the electronic mail system to be encapsulated as the text
  359.    portion of a transmitted message.
  360.  
  361.    When a privacy-enhanced message is received, the cryptographic
  362.    control fields within its text portion provide the information
  363.    required for the authorized recipient to perform MIC verification and
  364.    decryption of the received message text.  First, the printable
  365.    encoding is converted to a bitstring.  The MIC is verified.
  366.    Encrypted portions of the transmitted message are decrypted, and the
  367.    canonical representation is converted to the recipient's local form,
  368.    which need not be the same as the sender's local form.
  369.  
  370. 4.2  Encryption Algorithms and Modes
  371.  
  372.    For purposes of this RFC, the Block Cipher Algorithm DEA-1, defined
  373.    in ISO draft international standard DIS 8227 [2] shall be used for
  374.    encryption of message text.  The DEA-1 is equivalent to the Data
  375.    Encryption Standard (DES), as defined in FIPS PUB 46 [3].  When used
  376.    for encryption of text, the DEA-1 shall be used in the Cipher Block
  377.    Chaining (CBC) mode, as defined in ISO DIS 8372 [4].  The CBC mode
  378.    definition in DIS 8372 is equivalent to that provided in FIPS PUB 81
  379.    [5].  A unique initializing vector (IV) will be generated for and
  380.    transmitted with each privacy-enhanced electronic mail message.
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388. Linn                                                            [Page 7]
  389.  
  390. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  391.  
  392.  
  393.    An algorithm other than DEA-1 may be employed, provided that it
  394.    satisfies the following requirements:
  395.  
  396.            1.  It must be a 64-bit block cipher, enciphering and
  397.                deciphering in 8-octet blocks.
  398.  
  399.            2.  It is usable in the ECB and CBC modes defined in DIS
  400.                8372.
  401.  
  402.            3.  It is able to be keyed using the procedures and
  403.                parameters defined in this RFC.
  404.  
  405.            4.  It is appropriate for MIC computation, if the selected
  406.                MIC computation algorithm is eCcryption-based.
  407.  
  408.            5.  Cryptographic key field lengths are limited to 16 octets
  409.                in length.
  410.  
  411.    Certain operations require that one key be encrypted under another
  412.    key (interchange key) for purposes of transmission.  This encryption
  413.    may be performed using symmetric cryptography by using DEA-1 in
  414.    Electronic Codebook (ECB) mode.  A header facility is available to
  415.    indicate that an associated key is to be used for encryption in
  416.    another mode (e.g., the Encrypt-Decrypt-Encrypt (EDE) mode used for
  417.    key encryption and decryption with pairs of 64-bit keys, as described
  418.    by ASC X3T1 [6], or public-key algorithms).
  419.  
  420.    Support of public key algorithms for key encryption is under active
  421.    consideration, and it is intended that the procedures defined in this
  422.    RFC be appropriate to allow such usage.  Support of key encryption
  423.    modes other than ECB is optional for implementations, however.
  424.    Therefore, in support of universal interoperability, interchange key
  425.    providers should not specify other modes in the absence of a priori
  426.    information indicating that recipients are equipped to perform key
  427.    encryption in other modes.
  428.  
  429. 4.3  Privacy Enhancement Message Transformations
  430.  
  431. 4.3.1  Constraints
  432.  
  433.    An electronic mail encryption mechanism must be compatible with the
  434.    transparency constraints of its underlying electronic mail
  435.    facilities.  These constraints are generally established based on
  436.    expected user requirements and on the characteristics of anticipated
  437.    endpoint transport facilities.  An encryption mechanism must also be
  438.    compatible with the local conventions of the computer systems which
  439.    it interconnects.  In our approach, a canonicalization step is
  440.    performed to abstract out local conventions and a subsequent encoding
  441.  
  442.  
  443.  
  444. Linn                                                            [Page 8]
  445.  
  446. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  447.  
  448.  
  449.    step is performed to conform to the characteristics of the underlying
  450.    mail transport medium (SMTP).  The encoding conforms to SMTP
  451.    constraints, established to support interpersonal messaging.  SMTP's
  452.    rules are also used independently in the canonicalization process.
  453.    RFC-821's [7] Section 4.5 details SMTP's transparency constraints.
  454.  
  455.    To encode a message for SMTP transmission, the following requirements
  456.    must be met:
  457.  
  458.            1.  All characters must be members of the 7-bit ASCII
  459.                character set.
  460.  
  461.            2.  Text lines, delimited by the character pair <CR><LF>,
  462.                must be no more than 1000 characters long.
  463.  
  464.            3.  Since the string <CR><LF>.<CR><LF> indicates the end of a
  465.                message, it must not occur in text prior to the end of a
  466.                message.
  467.  
  468.    Although SMTP specifies a standard representation for line delimiters
  469.    (ASCII <CR><LF>), numerous systems use a different native
  470.    representation to delimit lines.  For example, the <CR><LF> sequences
  471.    delimiting lines in mail inbound to UNIX(tm) systems are transformed
  472.    to single <LF>s as mail is written into local mailbox files.  Lines
  473.    in mail incoming to record-oriented systems (such as VAX VMS) may be
  474.    converted to appropriate records by the destination SMTP [8] server.
  475.    As a result, if the encryption process generated <CR>s or <LF>s,
  476.    those characters might not be accessible to a recipient UA program at
  477.    a destination which uses different line delimiting conventions.  It
  478.    is also possible that conversion between tabs and spaces may be
  479.    performed in the course of mapping between inter-SMTP and local
  480.    format; this is a matter of local option.  If such transformations
  481.    changed the form of transmitted ciphertext, decryption would fail to
  482.    regenerate the transmitted plaintext, and a transmitted MIC would
  483.    fail to compare with that computed at the destination.
  484.  
  485.    The conversion performed by an SMTP server at a system with EBCDIC as
  486.    a native character set has even more severe impact, since the
  487.    conversion from EBCDIC into ASCII is an information-losing
  488.    transformation.  In principle, the transformation function mapping
  489.    between inter-SMTP canonical ASCII message representation and local
  490.    format could be moved from the SMTP server up to the UA, given a
  491.    means to direct that the SMTP server should no longer perform that
  492.    transformation.  This approach has a major disadvantage: internal
  493.    file (e.g., mailbox) formats would be incompatible with the native
  494.    forms used on the systems where they reside.  Further, it would
  495.    require modification to SMTP servers, as mail would be passed to SMTP
  496.    in a different representation than it is passed at present.
  497.  
  498.  
  499.  
  500. Linn                                                            [Page 9]
  501.  
  502. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  503.  
  504.  
  505. 4.3.2  Approach
  506.  
  507.    Our approach to supporting privacy-enhanced mail across an
  508.    environment in which intermediate conversions may occur encodes mail
  509.    in a fashion which is uniformly representable across the set of
  510.    privacy-enhanced UAs regardless of their systems' native character
  511.    sets.  This encoded form is used to represent mail text from sender
  512.    to recipient, but the encoding is not applied to enclosing mail
  513.    transport headers or to encapsulated headers inserted to carry
  514.    control information between privacy-enhanced UAs.  The encoding's
  515.    characteristics are such that the transformations anticipated between
  516.    sender and recipient UAs will not prevent an encoded message from
  517.    being decoded properly at its destination.
  518.  
  519.    A sender may exclude one or more portions of a message from
  520.    encryption processing.  Authentication processing is always applied
  521.    to the entirety of message text.  Explicit action is required to
  522.    exclude a portion of a message from encryption processing; by
  523.    default, encryption is applied to the entirety of message text.  The
  524.    user-level delimiter which specifies such exclusion is a local
  525.    matter, and hence may vary between sender and recipient, but all
  526.    systems should provide a means for unambiguous identification of
  527.    areas excluded from encryption processing.
  528.  
  529.    An outbound privacy-enhanced message undergoes four transformation
  530.    steps, described in the following four subsections.
  531.  
  532. 4.3.2.1  Step 1: Local Form
  533.  
  534.    The message text is created in the system's native character set,
  535.    with lines delimited in accordance with local convention.
  536.  
  537. 4.3.2.2  Step 2: Canonical Form
  538.  
  539.    The entire message text, including both those portions subject to
  540.    encipherment processing and those portions excluded from such
  541.    processing, is converted to the universal canonical form,
  542.    equivalent to the inter-SMTP representation [9] as defined in
  543.    RFC-821 and RFC-822 [10] (ASCII character set, <CR><LF> line
  544.    delimiters).  The processing required to perform this conversion is
  545.    minimal on systems whose native character set is ASCII.  Since a
  546.    message is converted to a standard character set and representation
  547.    before encryption, it can be decrypted and its MIC can be verified
  548.    at any destination system before any conversion necessary to
  549.    transform the message into a destination-specific local form is
  550.    performed.
  551.  
  552.  
  553.  
  554.  
  555.  
  556. Linn                                                           [Page 10]
  557.  
  558. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  559.  
  560.  
  561. 4.3.2.3  Step 3: Authentication and Encipherment
  562.  
  563.    The canonical form is input to the selected MIC computation algorithm
  564.    in order to compute an integrity check quantity for the message.  No
  565.    padding is added to the canonical form before submission to the MIC
  566.    computation algorithm, although certain MIC algorithms will apply
  567.    their own padding in the course of computing a MIC.
  568.  
  569.    Padding is applied to the canonical form as needed to perform
  570.    encryption in the DEA-1 CBC mode, as follows:  The number of octets
  571.    to be encrypted is determined by subtracting the number of octets
  572.    excluded from encryption from the total length of the encapsulated
  573.    text.  Octets with the hexadecimal value FF (all ones) are appended
  574.    to the canonical form as needed so that the text octets to be
  575.    encrypted, along with the added padding octets, fill an integral
  576.    number of 8-octet encryption quanta.  No padding is applied if the
  577.    number of octets to be encrypted is already an integral multiple of
  578.    8.  The use of hexadecimal FF (a value outside the 7-bit ASCII set)
  579.    as a padding value allows padding octets to be distinguished from
  580.    valid data without inclusion of an explicit padding count indicator.
  581.  
  582.    The regions of the message which have not been excluded from
  583.    encryption are encrypted.  To support selective encipherment
  584.    processing, an implementation must retain internal indications of the
  585.    positions of excluded areas excluded from encryption with relation to
  586.    non-excluded areas, so that those areas can be properly delimited in
  587.    the encoding procedure defined in step 4.  If a region excluded from
  588.    encryption intervenes between encrypted regions, cryptographic state
  589.    (e.g., IVs and accumulation of octets into encryption quanta) is
  590.    preserved and continued after the excluded region.
  591.  
  592. 4.3.2.4  Step 4: Printable Encoding
  593.  
  594.    The bit string resulting from step 3 is encoded into characters which
  595.    are universally representable at all sites, though not necessarily
  596.    with the same bit patterns (e.g., although the character "E" is
  597.    represented in an ASCII-based system as hexadecimal 45 and as
  598.    hexadecimal C5 in an EBCDIC-based system, the local significance of
  599.    the two representations is equivalent).  This encoding step is
  600.    performed for all privacy-enhanced messages.
  601.  
  602.    A 64-character subset of International Alphabet IA5 is used, enabling
  603.    6-bits to be represented per printable character.  (The proposed
  604.    subset of characters is represented identically in IA5 and ASCII.)
  605.    Two additional characters, "=" and "*", are used to signify special
  606.    processing functions.  The character "=" is used for padding within
  607.    the printable encoding procedure.  The character "*" is used to
  608.    delimit the beginning and end of a region which has been excluded
  609.  
  610.  
  611.  
  612. Linn                                                           [Page 11]
  613.  
  614. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  615.  
  616.  
  617.    from encipherment processing.  The encoding function's output is
  618.    delimited into text lines (using local conventions), with each line
  619.    containing 64 printable characters.
  620.  
  621.    The encoding process represents 24-bit groups of input bits as output
  622.    strings of 4 encoded characters. Proceeding from left to right across
  623.    a 24-bit input group extracted from the output of step 3, each 6-bit
  624.    group is used as an index into an array of 64 printable characters.
  625.    The character referenced by the index is placed in the output string.
  626.    These characters, identified in Table 1, are selected so as to be
  627.    universally representable, and the set excludes characters with
  628.    particular significance to SMTP (e.g., ".", "<CR>", "<LF>").
  629.  
  630.    Special processing is performed if fewer than 24-bits are available
  631.    in an input group, either at the end of a message or (when the
  632.    selective encryption facility is invoked) at the end of an encrypted
  633.    region or an excluded region.  In other words, a full encoding
  634.    quantum is always completed at the end of a message and before the
  635.    delimiter "*" is output to initiate or terminate the representation
  636.    of a block excluded from encryption.  When fewer than 24 input bits
  637.    are available in an input group, zero bits are added (on the right)
  638.    to form an integral number of 6-bit groups.  Output character
  639.    positions which are not required to represent actual input data are
  640.    set to the character "=".  Since all canonically encoded output is
  641.    an integral number of octets, only the following cases can arise:
  642.    (1) the final quantum of encoding input is an integral multiple of
  643.    24-bits; here, the final unit of encoded output will be an integral
  644.    multiple of 4 characters with no "=" padding, (2) the final quantum
  645.    of encoding input is exactly 8-bits; here, the final unit of encoded
  646.    output will be two characters followed by two "=" padding
  647.    characters, or (3) the final quantum of encoding input is exactly
  648.    16-bits; here, the final unit of encoded output will be three
  649.    characters followed by one "=" padding character.
  650.  
  651.    In summary, the outbound message is subjected to the following
  652.    composition of transformations:
  653.  
  654.          Transmit_Form = Encode(Encipher(Canonicalize(Local_Form)))
  655.  
  656.    The inverse transformations are performed, in reverse order, to
  657.    process inbound privacy-enhanced mail:
  658.  
  659.          Local_Form = DeCanonicalize(Decipher(Decode(Transmit_Form)))
  660.  
  661.    Note that the local form and the functions to transform messages to
  662.    and from canonical form may vary between the sender and recipient
  663.    systems without loss of information.
  664.  
  665.  
  666.  
  667.  
  668. Linn                                                           [Page 12]
  669.  
  670. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  671.  
  672.  
  673.         Value Encoding Value Encoding Value Encoding Value Encoding
  674.            0     A        17    R        34    i        51    z
  675.            1     B        18    S        35    j        52    0
  676.            2     C        19    T        36    k        53    1
  677.            3     D        20    U        37    l        54    2
  678.            4     E        21    V        38    m        55    3
  679.            5     F        22    W        39    n        56    4
  680.            6     G        23    X        40    o        57    5
  681.            7     H        24    Y        41    p        58    6
  682.            8     I        25    Z        42    q        59    7
  683.            9     J        26    a        43    r        60    8
  684.            10    K        27    b        44    s        61    9
  685.            11    L        28    c        45    t        62    +
  686.            12    M        29    d        46    u        63    /
  687.            13    N        30    e        47    v
  688.            14    O        31    f        48    w        (pad) =
  689.            15    P        32    g        49    x
  690.            16    Q        33    h        50    y        (1)   *
  691.  
  692.    (1) The character "*" is used to delimit portions of an encoded
  693.    message to which encryption processing has not been applied.
  694.  
  695.                        Printable Encoding Characters
  696.                                   Table 1
  697.  
  698. 4.4  Encapsulation Mechanism
  699.  
  700.    Encapsulation of privacy-enhanced messages within an enclosing layer
  701.    of headers interpreted by the electronic mail transport system offers
  702.    a number of advantages in comparison to a flat approach in which
  703.    certain fields within a single header are encrypted and/or carry
  704.    cryptographic control information.  Encapsulation provides generality
  705.    and segregates fields with user-to-user significance from those
  706.    transformed in transit.  All fields inserted in the course of
  707.    encryption/authentication processing are placed in the encapsulated
  708.    header.  This facilitates compatibility with mail handling programs
  709.    which accept only text, not header fields, from input files or from
  710.    other programs.  Further, privacy enhancement processing can be
  711.    applied recursively.  As far as the MTS is concerned, information
  712.    incorporated into cryptographic authentication or encryption
  713.    processing will reside in a message's text portion, not its header
  714.    portion.
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724. Linn                                                           [Page 13]
  725.  
  726. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  727.  
  728.  
  729.    The encapsulation mechanism to be used for privacy-enhanced mail is
  730.    derived from that described in RFC-934 [11] which is, in turn, based
  731.    on precedents in the processing of message digests in the Internet
  732.    community.  To prepare a user message for encrypted or authenticated
  733.    transmission, it will be transformed into the representation shown in
  734.    Figure 1.
  735.  
  736.    Enclosing Header Portion
  737.            (Contains header fields per RFC-822)
  738.  
  739.    Blank Line
  740.             (Separates Enclosing Header from Encapsulated Message)
  741.  
  742.    Encapsulated Message
  743.  
  744.       Pre-Encapsulation Boundary (Pre-EB)
  745.           -----PRIVACY-ENHANCED MESSAGE BOUNDARY-----
  746.  
  747.       Encapsulated Header Portion
  748.           (Contains encryption control fields inserted in plaintext.
  749.           Examples include "X-IV:", "X-Sender-ID:", and "X-Key-Info:".
  750.           Note that, although these control fields have line-oriented
  751.           representations similar to RFC-822 header fields, the set of
  752.           fields valid in this context is disjoint from those used in
  753.           RFC-822 processing.)
  754.  
  755.       Blank Line
  756.           (Separates Encapsulated Header from subsequent encoded
  757.           Encapsulated Text Portion)
  758.  
  759.       Encapsulated Text Portion
  760.           (Contains message data encoded as specified in Section 4.3;
  761.           may incorporate protected copies of "Subject:", etc.)
  762.  
  763.       Post-Encapsulation Boundary (Post-EB)
  764.           -----PRIVACY-ENHANCED MESSAGE BOUNDARY-----
  765.  
  766.                               Message Encapsulation
  767.                                      Figure 1
  768.  
  769.    As a general design principle, sensitive data is protected by
  770.    incorporating the data within the encapsulated text rather than by
  771.    applying measures selectively to fields in the enclosing header.
  772.    Examples of potentially sensitive header information may include
  773.    fields such as "Subject:", with contents which are significant on an
  774.    end-to-end, inter-user basis.  The (possibly empty) set of headers to
  775.    which protection is to be applied is a user option.  It is strongly
  776.    recommended, however, that all implementations should replicate
  777.  
  778.  
  779.  
  780. Linn                                                           [Page 14]
  781.  
  782. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  783.  
  784.  
  785.    copies of "X-Sender-ID:" and "X-Recipient-ID:" fields within the
  786.    encapsulated text and include those replicated fields in encryption
  787.    and MIC computations.
  788.  
  789.    If a user wishes disclosure protection for header fields, they must
  790.    occur only in the encapsulated text and not in the enclosing or
  791.    encapsulated header.  If disclosure protection is desired for a
  792.    message's subject indication, it is recommended that the enclosing
  793.    header contain a "Subject:" field indicating that "Encrypted Mail
  794.    Follows".
  795.  
  796.    If an authenticated version of header information is desired, that
  797.    data can be replicated within the encapsulated text portion in
  798.    addition to its inclusion in the enclosing header.  For example, a
  799.    sender wishing to provide recipients with a protected indication of a
  800.    message's position in a series of messages could include a copy of a
  801.    timestamp or message counter field within the encapsulated text.
  802.  
  803.    A specific point regarding the integration of privacy-enhanced mail
  804.    facilities with the message encapsulation mechanism is worthy of
  805.    note.  The subset of IA5 selected for transmission encoding
  806.    intentionally excludes the character "-", so encapsulated text can be
  807.    distinguished unambiguously from a message's closing encapsulation
  808.    boundary (Post-EB) without recourse to character stuffing.
  809.  
  810. 4.5  Mail for Mailing Lists
  811.  
  812.    When mail is addressed to mailing lists, two different methods of
  813.    processing can be applicable: the IK-per-list method and the IK-
  814.    perrecipient method.  The choice depends on the information available
  815.    to the sender and on the sender's preference.
  816.  
  817.    If a message's sender addresses a message to a list name or alias,
  818.    use of an IK associated with that name or alias as a entity (IK-
  819.    perlist), rather than resolution of the name or alias to its
  820.    constituent destinations, is implied.  Such an IK must, therefore, be
  821.    available to all list members.  For the case of public-key
  822.    cryptography, the secret component of the composite IK must be
  823.    available to all list members.  This alternative will be the normal
  824.    case for messages sent via remote exploder sites, as a sender to such
  825.    lists may not be cognizant of the set of individual recipients.
  826.    Unfortunately, it implies an undesirable level of exposure for the
  827.    shared IK or component, and makes its revocation difficult.
  828.    Moreover, use of the IK-per-list method allows any holder of the
  829.    list's IK to masquerade as another sender to the list for
  830.    authentication purposes.
  831.  
  832.  
  833.  
  834.  
  835.  
  836. Linn                                                           [Page 15]
  837.  
  838. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  839.  
  840.  
  841.    If, in contrast, a message's sender is equipped to expand the
  842.    destination mailing list into its individual constituents and elects
  843.    to do so (IK-per-recipient), the message's DEK and MIC will be
  844.    encrypted under each per-recipient IK and all such encrypted
  845.    representations will be incorporated into the transmitted message.
  846.    Note that per-recipient encryption is required only for the
  847.    relatively small DEK and MIC quantities carried in the X-Key-Info
  848.    field, not for the message text which is, in general, much larger.
  849.    Although more IKs are involved in processing under the IK-
  850.    perrecipient method, the pairwise IKs can be individually revoked and
  851.    possession of one IK does not enable a successful masquerade of
  852.    another user on the list.
  853.  
  854. 4.6  Summary of Added Header and Control Fields
  855.  
  856.    This section summarizes the syntax and semantics of the new
  857.    encapsulated header fields to be added to messages in the course of
  858.    privacy enhancement processing.  In certain indicated cases, it is
  859.    recommended that the fields be replicated within the encapsulated
  860.    text portion as well.  Figure 2 shows the appearance of a small
  861.    example encapsulated message using these fields.  The example assumes
  862.    the use of symmetric cryptography; no "X-Certificate:" field is
  863.    carried.  In all cases, hexadecimal quantities are represented as
  864.    contiguous strings of digits, where each digit is represented by a
  865.    character from the ranges "0"-"9" or upper case "A"-"F".  Unless
  866.    otherwise specified, all arguments are to be processed in a
  867.    casesensitive fashion.
  868.  
  869.    Although the encapsulated header fields resemble RFC-822 header
  870.    fields, they are a disjoint set and will not in general be processed
  871.    by the same parser which operates on enclosing header fields.  The
  872.    complexity of lexical analysis needed and appropriate for
  873.    encapsulated header field processing is significantly less than that
  874.    appropriate to RFC-822 header processing.  For example, many
  875.    characters with special significance to RFC-822 at the syntactic
  876.    level have no such significance within encapsulated header fields.
  877.  
  878.    When the length of an encapsulated header field is longer than the
  879.    size conveniently printable on a line, whitespace may be used between
  880.    the subfields of these fields to fold them in the manner of RFC-822,
  881.    section 3.1.1.  Any such inserted whitespace is not to be interpreted
  882.    as a part of a subfield.
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892. Linn                                                           [Page 16]
  893.  
  894. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  895.  
  896.  
  897.    -----PRIVACY-ENHANCED MESSAGE BOUNDARY-----
  898.    X-Proc-Type: 2
  899.    X-IV: F8143EDE5960C597
  900.    X-Sender-ID: linn@ccy.bbn.com:::
  901.    X-Recipient-ID: linn@ccy.bbn.com:ptf-kmc:3:BMAC:ECB
  902.    X-Key-Info: 9FD3AAD2F2691B9A,B70665BB9BF7CBCD
  903.    X-Recipient-ID: privacy-tf@venera.isi.edu:ptf-kmc:4:BMAC:ECB
  904.    X-Key-Info: 161A3F75DC82EF26,E2EF532C65CBCFF7
  905.  
  906.    LLrHB0eJzyhP+/fSStdW8okeEnv47jxe7SJ/iN72ohNcUk2jHEUSoH1nvNSIWL9M
  907.    8tEjmF/zxB+bATMtPjCUWbz8Lr9wloXIkjHUlBLpvXR0UrUzYbkNpk0agV2IzUpk
  908.    J6UiRRGcDSvzrsoK+oNvqu6z7Xs5Xfz5rDqUcMlK1Z6720dcBWGGsDLpTpSCnpot
  909.    dXd/H5LMDWnonNvPCwQUHt==
  910.     -----PRIVACY-ENHANCED MESSAGE BOUNDARY-----
  911.  
  912.                        Example Encapsulated Message
  913.                                  Figure 2
  914.  
  915. 4.6.1  X-Certificate Field
  916.  
  917.    The X-Certificate encapsulated header field is used only when
  918.    public-key certificate key management is employed.  It transfers a
  919.    sender's certificate as a string of hexadecimal digits.  The
  920.    semantics of a certificate are discussed in Section 5.3,
  921.    Certificates.  The certificate carried in an X-Certificate field is
  922.    used in conjunction with all subsequent X-Sender-ID and X-RecipientID
  923.    fields until another X-Certificate field occurs; the ordinary case
  924.    will be that only a single X-Certificate field will occur, prior to
  925.    any X-Sender-ID and X-Recipient-ID fields.
  926.  
  927.    Due to the length of a certificate, it may need to be folded across
  928.    multiple printed lines.  In order to enable such folding to be
  929.    performed, the hexadecimal digits representing the contents of a
  930.    certificate are to be divided into an ordered set (with more
  931.    significant digits first) of zero or more 64-digit groups, followed
  932.    by a final digit group which may be any length up to 64-digits.  A
  933.    single whitespace character is interposed between each pair of groups
  934.    so that folding (per RFC-822, section 3.1.1) may take place; this
  935.    whitespace is ignored in parsing the received digit string.
  936.  
  937. 4.6.2  X-IV Field
  938.  
  939.    The X-IV encapsulated header field carries the Initializing Vector
  940.    used for message encryption.  Only one X-IV field occurs in a
  941.    message.  It appears in all messages, even if the entirety of message
  942.    text is excluded from encryption.  Following the field name, and one
  943.    or more delimiting whitespace characters, a 64-bit Initializing
  944.    Vector is represented as a contiguous string of 16 hexadecimal
  945.  
  946.  
  947.  
  948. Linn                                                           [Page 17]
  949.  
  950. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  951.  
  952.  
  953.    digits.
  954.  
  955. 4.6.3  X-Key-Info Field
  956.  
  957.    The X-Key-Info encapsulated header field transfers two items: a DEK
  958.    and a MIC.  One X-Key-Info field is included for each of a message's
  959.    named recipients.  The DEK and MIC are encrypted under the IK
  960.    identified by a preceding X-Recipient-ID field and prior X-Sender-ID
  961.    field; they are represented as two strings of contiguous hexadecimal
  962.    digits, separated by a comma.  For DEA-1, the DEK representation will
  963.    be 16 hexadecimal digits (corresponding to a 64-bit key); this
  964.    subfield can be extended to 32 hexadecimal digits (corresponding to a
  965.    128-bit key), if required to support other algorithms.  MICs are also
  966.    represented as contiguous strings of hexadecimal digits.  The size of
  967.    a MIC is dependent on the choice of MIC algorithm as specified in the
  968.    X-Recipient-ID field corresponding to a given recipient.
  969.  
  970. 4.6.4  X-Proc-Type Field
  971.  
  972.    The X-Proc-Type encapsulated header field identifies the type of
  973.    processing performed on the transmitted message.  Only one X-ProcType
  974.    field occurs in a message.  It has one subfield, a decimal number
  975.    which is used to distinguish among incompatible encapsulated header
  976.    field interpretations which may arise as changes are made to this
  977.    standard.  Messages processed according to this RFC will carry the
  978.    subfield value "2".
  979.  
  980. 4.6.5  X-Sender-ID Field
  981.  
  982.    The X-Sender-ID encapsulated header field provides the sender's
  983.    interchange key identification component.  It should be replicated
  984.    within the encapsulated text.  The interchange key identification
  985.    component carried in an X-Sender-ID field is used in conjunction with
  986.    all subsequent X-Recipient-ID fields until another X-Sender-ID field
  987.    occurs; the ordinary case will be that only a single X-Sender-ID
  988.    field will occur, prior to any X-Recipient-ID fields.
  989.  
  990.    The X-Sender-ID field contains (in order) an Entity Identifier
  991.    subfield, an (optional) Issuing Authority subfield, an (optional)
  992.    Version/Expiration subfield, and an (optional) IK Use Indicator
  993.    subfield.  The optional subfields are omitted if their use is
  994.    rendered redundant by information carried in subsequent X-RecipientID
  995.    fields; this will ordinarily be the case where symmetric cryptography
  996.    is used for key management.  The subfields are delimited by the colon
  997.    character (":"), optionally followed by whitespace.
  998.  
  999.    Section 5.2, Interchange Keys, discusses the semantics of these
  1000.    subfields and specifies the alphabet from which they are chosen.
  1001.  
  1002.  
  1003.  
  1004. Linn                                                           [Page 18]
  1005.  
  1006. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1007.  
  1008.  
  1009.    Note that multiple X-Sender-ID fields may occur within a single
  1010.    encapsulated header.  All X-Recipient-ID fields are interpreted in
  1011.    the context of the most recent preceding X-Sender-ID field; it is
  1012.    illegal for an X-Recipient-ID field to occur in a header before an
  1013.    X-Sender-ID has been provided.
  1014.  
  1015. 4.6.6  X-Recipient-ID Field
  1016.  
  1017.    The X-Recipient-ID encapsulated header field provides the recipient's
  1018.    interchange key identification component.  One X-Recipient-ID field
  1019.    is included for each of a message's named recipients.  It should be
  1020.    replicated within the encapsulated text.  The field contains (in
  1021.    order) an Entity Identifier subfield, an Issuing Authority subfield,
  1022.    a Version/Expiration subfield, a MIC algorithm indicator subfield,
  1023.    and an IK Use Indicator subfield.  The subfields are delimited by the
  1024.    colon character (":"), optionally followed by whitespace.
  1025.  
  1026.    The MIC algorithm indicator is an ASCII string, selected from the
  1027.    values defined in Appendix A of this RFC.  Section 5.2, Interchange
  1028.    Keys, discusses the semantics of the other subfields and specifies
  1029.    the alphabet from which they are chosen.  All X-Recipient-ID
  1030.    fields are interpreted in the context of the most recent preceding
  1031.    XSender-ID field; it is illegal for an X-Recipient-ID field to
  1032.    occur in a header before an X-Sender-ID has been provided.
  1033.  
  1034. 5.  Key Management
  1035.  
  1036.    Several cryptographic constructs are involved in supporting the
  1037.    privacy-enhanced message processing procedure.  While (as noted in
  1038.    the Executive Summary section of this RFC), key management mechanisms
  1039.    have not yet been fully defined, a set of fundamental elements are
  1040.    assumed.  Data Encrypting Keys (DEKs) are used to encrypt message
  1041.    text and in the message integrity check (MIC) computation process.
  1042.    Interchange Keys (IKs) are used to encrypt DEKs for transmission with
  1043.    messages.  In an asymmetric key management architecture, certificates
  1044.    are used as a means to provide entities' public key components and
  1045.    other information in a fashion which is securely bound by a central
  1046.    authority.  The remainder of this section provides more information
  1047.    about these constructs.
  1048.  
  1049. 5.1  Data Encrypting Keys (DEKs)
  1050.  
  1051.    Data Encrypting Keys (DEKs) are used for encryption of message text
  1052.    and for computation of message integrity check quantities (MICs).  It
  1053.    is strongly recommended that DEKs be generated and used on a one-time
  1054.    basis.  A transmitted message will incorporate a representation of
  1055.    the DEK encrypted under an appropriate interchange key (IK) for each
  1056.    the authorized recipient.
  1057.  
  1058.  
  1059.  
  1060. Linn                                                           [Page 19]
  1061.  
  1062. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1063.  
  1064.  
  1065.    DEK generation can be performed either centrally by key distribution
  1066.    centers (KDCs) or by endpoint systems.  Dedicated KDC systems may be
  1067.    able to implement better algorithms for random DEK generation than
  1068.    can be supported in endpoint systems.  On the other hand,
  1069.    decentralization allows endpoints to be relatively self-sufficient,
  1070.    reducing the level of trust which must be placed in components other
  1071.    than a message's originator and recipient.  Moreover, decentralized
  1072.    DEK generation at endpoints reduces the frequency with which senders
  1073.    must make real-time queries of (potentially unique) servers in order
  1074.    to send mail, enhancing communications availability.
  1075.  
  1076.    When symmetric cryptography is used, one advantage of centralized
  1077.    KDC-based generation is that DEKs can be returned to endpoints
  1078.    already encrypted under the IKs of message recipients rather than
  1079.    providing the IKs to the senders.  This reduces IK exposure and
  1080.    simplifies endpoint key management requirements.  This approach has
  1081.    less value if asymmetric cryptography is used for key management,
  1082.    since per-recipient public IK components are assumed to be generally
  1083.    available and per-sender secret IK components need not necessarily be
  1084.    shared with a KDC.
  1085.  
  1086. 5.2  Interchange Keys (IKs)
  1087.  
  1088.    Interchange Keys (IKs) are used to encrypt Data Encrypting Keys.  In
  1089.    general, IK granularity is at the pairwise per-user level except for
  1090.    mail sent to address lists comprising multiple users.  In order for
  1091.    two principals to engage in a useful exchange of privacy-enhanced
  1092.    electronic mail using conventional cryptography, they must first
  1093.    share a common interchange key.  When symmetric cryptography is used,
  1094.    the interchange key consists of a single component.  When asymmetric
  1095.    cryptography is used, an originator and recipient must possess an
  1096.    asymmetric key's public and secret components, as appropriate.  This
  1097.    pair of components, when composed, constitute an interchange key.
  1098.  
  1099.    While this RFC does not prescribe the means by which interchange keys
  1100.    are provided to appropriate parties, it is useful to note that such
  1101.    means may be centralized (e.g., via key management servers) or
  1102.    decentralized (e.g., via pairwise agreement and direct distribution
  1103.    among users).  In any case, any given IK component is associated with
  1104.    a responsible Issuing Authority (IA).  When an IA generates and
  1105.    distributes an IK, associated control information is provided to
  1106.    direct how that IK is to be used.  In order to select the appropriate
  1107.    IK to use in message encryption, a sender must retain a
  1108.    correspondence between IK components and the recipients with which
  1109.    they are associated.  Expiration date information must also be
  1110.    retained, in order that cached entries may be invalidated and
  1111.    replaced as appropriate.
  1112.  
  1113.  
  1114.  
  1115.  
  1116. Linn                                                           [Page 20]
  1117.  
  1118. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1119.  
  1120.  
  1121.    Since a message may be sent with multiple IK component
  1122.    representations, corresponding to multiple intended recipients, each
  1123.    recipient must be able to determine which IK component is intended
  1124.    for it.  Moreover, if no corresponding IK component is available in
  1125.    the recipient's database when a message arrives, the recipient must
  1126.    be able to determine which IK component to request and to identify
  1127.    that IK component's associated IA.  Note that different IKs may be
  1128.    used for different messages between a pair of communicants.
  1129.    Consider, for example, one message sent from A to B and another
  1130.    message sent (using the IK-per-list method) from A to a mailing list
  1131.    of which B is a member.  The first message would use IK components
  1132.    associated individually with A and B, but the second would use an IK
  1133.    component shared among list members.
  1134.  
  1135.    When a privacy-enhanced message is transmitted, an indication of the
  1136.    IK components used for DEK encryption must be included.  To this end,
  1137.    the "X-Sender-ID:" and "X-Recipient-ID:" encapsulated header fields
  1138.    provide the following data:
  1139.  
  1140.          1.  Identification of the relevant Issuing Authority (IA
  1141.              subfield).
  1142.  
  1143.          2.  Identification of an entity with which a particular IK
  1144.              component is associated (Entity Identifier or EI
  1145.              subfield).
  1146.  
  1147.          3.  Indicator of IK usage mode (IK use indicator subfield).
  1148.  
  1149.          4.  Version/Expiration subfield.
  1150.  
  1151.    The colon character (":") is used to delimit the subfields within an
  1152.    "X-Sender-ID:" or "X-Recipient-ID:".  The IA, EI, and
  1153.    version/expiration subfields are generated from a restricted
  1154.    character set, as prescribed by the following BNF (using notation as
  1155.    defined in RFC-822, sections 2 and 3.3):
  1156.  
  1157.    IKsubfld       :=       1*ia-char
  1158.  
  1159.    ia-char        :=       DIGIT / ALPHA / "'" / "+" / "(" / ")" /
  1160.                            "," / "." / "/" / "=" / "?" / "-" / "@" /
  1161.                            "%" / "!" / '"' / "_" / "<" / ">"
  1162.  
  1163.    An example X-Recipient-ID: field is as follows:
  1164.  
  1165.                X-Recipient-ID: linn@ccy.bbn.com:ptf-kmc:2:BMAC:ECB
  1166.  
  1167.    This example field indicates that IA "ptf-kmc" has issued an IK
  1168.    component for use on messages sent to "linn@ccy.bbn.com", that the IA
  1169.  
  1170.  
  1171.  
  1172. Linn                                                           [Page 21]
  1173.  
  1174. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1175.  
  1176.  
  1177.    has provided the number 2 as a version indicator for that IK
  1178.    component, that the BMAC MIC computation algorithm is to be used for
  1179.    the recipient, and that the IK component is to be used in ECB mode.
  1180.  
  1181. 5.2.1  Subfield Definitions
  1182.  
  1183.    The following subsections define the subfields of "X-Sender-ID:" and
  1184.    "X-Recipient-ID:" fields.
  1185.  
  1186. 5.2.1.1  Entity Identifier Subfield
  1187.  
  1188.    An entity identifier is constructed as an IKsubfld.  More
  1189.    restrictively, an entity identifier subfield assumes the following
  1190.    form:
  1191.  
  1192.                       <user>@<domain-qualified-host>
  1193.  
  1194.    In order to support universal interoperability, it is necessary to
  1195.    assume a universal form for the naming information.  For the case of
  1196.    installations which transform local host names before transmission
  1197.    into the broader Internet, it is strongly recommended that the host
  1198.    name as presented to the Internet be employed.
  1199.  
  1200. 5.2.1.2  Issuing Authority Subfield
  1201.  
  1202.    An IA identifier subfield is constructed as an IKsubfld.  IA
  1203.    identifiers must be assigned in a manner which assures uniqueness.
  1204.    This can be done on a centralized or hierarchic basis.
  1205.  
  1206. 5.2.1.3  Version/Expiration Subfield
  1207.  
  1208.    A version/expiration subfield is constructed as an IKsubfld.  The
  1209.    version/expiration subfield format may vary among different IAs, but
  1210.    must satisfy certain functional constraints.  An IA's
  1211.    version/expiration subfields must be sufficient to distinguish among
  1212.    the set of IK components issued by that IA for a given identified
  1213.    entity.  Use of a monotonically increasing number is sufficient to
  1214.    distinguish among the IK components provided for an entity by an IA;
  1215.    use of a timestamp additionally allows an expiration time or date to
  1216.    be prescribed for an IK component.
  1217.  
  1218. 5.2.1.4  MIC Algorithm Identifier Subfield
  1219.  
  1220.    The MIC algorithm identifier, which occurs only within X-Recipient-ID
  1221.    fields, is used to identify the choice of message integrity check
  1222.    algorithm for a given recipient.  Appendix A of this RFC specifies
  1223.    the defined values for this subfield.
  1224.  
  1225.  
  1226.  
  1227.  
  1228. Linn                                                           [Page 22]
  1229.  
  1230. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1231.  
  1232.  
  1233. 5.2.1.5  IK Use Indicator Subfield
  1234.  
  1235.    The IK use indicator subfield is an optional facility, provided to
  1236.    identify the encryption mode in which an IK component is to be used.
  1237.    Currently, this subfield may assume the following reserved string
  1238.    values: "ECB", "EDE", "RSA256", "RSA512", and "RSA1024"; the default
  1239.    value is "ECB".
  1240.  
  1241. 5.2.2  IK Cryptoperiod Issues
  1242.  
  1243.    An IK component's cryptoperiod is dictated in part by a tradeoff
  1244.    between key management overhead and revocation responsiveness.  It
  1245.    would be undesirable to delete an IK component permanently before
  1246.    receipt of a message encrypted using that IK component, as this would
  1247.    render the message permanently undecipherable.  Access to an expired
  1248.    IK component would be needed, for example, to process mail received
  1249.    by a user (or system) which had been inactive for an extended period
  1250.    of time.  In order to enable very old IK components to be deleted, a
  1251.    message's recipient desiring encrypted local long term storage should
  1252.    transform the DEK used for message text encryption via re-encryption
  1253.    under a locally maintained IK, rather than relying on IA maintenance
  1254.    of old IK components for indefinite periods.
  1255.  
  1256. 5.3 Certificates
  1257.  
  1258.    In an asymmetric key management architecture, a certificate binds an
  1259.    entity's public key component to a representation of the entity's
  1260.    identity and other attributes of the entity.  A certificate's issuing
  1261.    authority signs the certificate, vouching for the correspondence
  1262.    between the entity's identity, attributes, and associated public key
  1263.    component.  Once signed, certificate copies may be posted on multiple
  1264.    servers in order to make recipients' certificates directly accessible
  1265.    to originators at dispersed locations.  This allows privacy-enhanced
  1266.    mail to be sent between an originator and a recipient without prior
  1267.    placement of a pairwise key at the originator and recipient, greatly
  1268.    enhancing mail system flexibility.  The properties of a certificate's
  1269.    authority-applied signature make it unnecessary to be concerned about
  1270.    the prospect that servers, or other entities, could undetectably
  1271.    modify certificate contents so as to associate a public key with an
  1272.    inappropriate entity.
  1273.  
  1274.    Per the 1988 CCITT Recommendations X.411 [12] and X.509 [13], a
  1275.    subject's certificate is defined to contain the following parameters:
  1276.  
  1277.            1.  A signature algorithm identifier, identifying the
  1278.                algorithm used by the certificate's issuer to compute the
  1279.                signature applied to the certificate.
  1280.  
  1281.  
  1282.  
  1283.  
  1284. Linn                                                           [Page 23]
  1285.  
  1286. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1287.  
  1288.  
  1289.            2.  Issuer identification, identifying the certificate's
  1290.                issuer with an O/R name.
  1291.  
  1292.            3.  Validity information, providing date and time limits
  1293.                before and after which the certificate should not be
  1294.                used.
  1295.  
  1296.            4.  Subject identification, identifying the certificate's
  1297.                subject with an O/R name.
  1298.  
  1299.            5.  Subject's public key.
  1300.  
  1301.            6.  Algorithm identifier, identifying the algorithm with
  1302.                which the subject's public key is to be used.
  1303.  
  1304.            7.  Signature, an asymmetrically encrypted, hashed version of
  1305.                the above parameters, computed by the certificate's
  1306.                issuer.
  1307.  
  1308.    The Recommendations specify an ASN.1 encoding to define a
  1309.    certificate.  Pending further study, it is recommended that
  1310.    electronic mail privacy enhancement implementations using asymmetric
  1311.    cryptography for key management employ this encoding for
  1312.    certificates.  Section 4.2.3 of RFC-987 [14] specifies a procedure
  1313.    for mapping RFC-822 addresses into the O/R names used in X.411/X.509
  1314.    certificates.
  1315.  
  1316. 6.  User Naming
  1317.  
  1318. 6.1  Current Approach
  1319.  
  1320.    Unique naming of electronic mail users, as is needed in order to
  1321.    select corresponding keys correctly, is an important topic and one
  1322.    requiring significant study.  A logical association exists between
  1323.    key distribution and name/directory server functions; their
  1324.    relationship is a topic deserving further consideration.  These
  1325.    issues have not been fully resolved at this writing.  The current
  1326.    architecture relies on association of IK components with user names
  1327.    represented in a universal form ("user@host"), relying on the
  1328.    following properties:
  1329.  
  1330.        1.  The universal form must be specifiable by an IA as it
  1331.            distributes IK components and known to a UA as it processes
  1332.            received IK components and IK component identifiers.  If a
  1333.            UA or IA uses addresses in a local form which is different
  1334.            from the universal form, it must be able to perform an
  1335.            unambiguous mapping from the universal form into the local
  1336.            representation.
  1337.  
  1338.  
  1339.  
  1340. Linn                                                           [Page 24]
  1341.  
  1342. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1343.  
  1344.  
  1345.        2.  The universal form, when processed by a sender UA, must have
  1346.            a recognizable correspondence with the form of a recipient
  1347.            address as specified by a user (perhaps following local
  1348.            transformation from an alias into a universal form).
  1349.  
  1350.    It is difficult to ensure these properties throughout the Internet.
  1351.    For example, an MTS which transforms address representations between
  1352.    the local form used within an organization and the universal form as
  1353.    used for Internet mail transmission may cause property 2 to be
  1354.    violated.
  1355.  
  1356. 6.2  Issues for Consideration
  1357.  
  1358.    The use of flat (non-hierarchic) electronic mail user identifiers,
  1359.    which are unrelated to the hosts on which the users reside, may offer
  1360.    value.  Personal characteristics, like social security numbers, might
  1361.    be considered.  Individually-selected identifiers could be registered
  1362.    with a central authority, but a means to resolve name conflicts would
  1363.    be necessary.
  1364.  
  1365.    A point of particular note is the desire to accommodate multiple
  1366.    names for a single individual, in order to represent and allow
  1367.    delegation of various roles in which that individual may act.  A
  1368.    naming mechanism that binds user roles to keys is needed.  Bindings
  1369.    cannot be immutable since roles sometimes change (e.g., the
  1370.    comptroller of a corporation is fired).
  1371.  
  1372.    It may be appropriate to examine the prospect of extending the
  1373.    DARPA/DoD domain system and its associated name servers to resolve
  1374.    user names to unique user IDs.  An additional issue arises with
  1375.    regard to mailing list support: name servers do not currently perform
  1376.    (potentially recursive) expansion of lists into users.  ISO and CSNet
  1377.    are working on user-level directory service mechanisms, which may
  1378.    also bear consideration.
  1379.  
  1380. 7.  Example User Interface and Implementation
  1381.  
  1382.    In order to place the mechanisms and approaches discussed in this RFC
  1383.    into context, this section presents an overview of a prototype
  1384.    implementation.  This implementation is a standalone program which is
  1385.    invoked by a user, and lies above the existing UA sublayer.  In the
  1386.    UNIX(tm) system, and possibly in other environments as well, such a
  1387.    program can be invoked as a "filter" within an electronic mail UA or
  1388.    a text editor, simplifying the sequence of operations which must be
  1389.    performed by the user.  This form of integration offers the advantage
  1390.    that the program can be used in conjunction with a range of UA
  1391.    programs, rather than being compatible only with a particular UA.
  1392.    When a user wishes to apply privacy enhancements to an outgoing
  1393.  
  1394.  
  1395.  
  1396. Linn                                                           [Page 25]
  1397.  
  1398. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1399.  
  1400.  
  1401.    message, the user prepares the message's text and invokes the
  1402.    standalone program (interacting with the program in order to provide
  1403.    address information and other data required to perform privacy
  1404.    enhancement processing), which in turn generates output suitable for
  1405.    transmission via the UA.  When a user receives a privacy-enhanced
  1406.    message, the UA delivers the message in encrypted form, suitable for
  1407.    decryption and associated processing by the standalone program.
  1408.  
  1409.    In this prototype implementation, a cache of IK components is
  1410.    maintained in a local file, with entries managed manually based on
  1411.    information provided by originators and recipients.  This cache is,
  1412.    effectively, a simple database.  IK components are selected for
  1413.    transmitted messages based on the sender's identity and on recipient
  1414.    names, and corresponding "X-Sender-ID:" and "X-Recipient-ID:" fields
  1415.    are placed into the message's encapsulated header.  When a message is
  1416.    received, these fields are used as a basis for a lookup in the
  1417.    database, yielding the appropriate IK component entries.  DEKs and
  1418.    IVs are generated dynamically within the program.
  1419.  
  1420.    Options and destination addresses are selected by command line
  1421.    arguments to the standalone program.  The function of specifying
  1422.    destination addresses to the privacy enhancement program is logically
  1423.    distinct from the function of specifying the corresponding addresses
  1424.    to the UA for use by the MTS.  This separation results from the fact
  1425.    that, in many cases, the local form of an address as specified to a
  1426.    UA differs from the Internet global form as used in "X-Sender-ID:"
  1427.    and "X-Recipient-ID:" fields.
  1428.  
  1429. 8.  Areas For Further Study
  1430.  
  1431.    The procedures defined in this RFC are sufficient to support pilot
  1432.    implementation of privacy-enhanced electronic mail transmission among
  1433.    cooperating parties in the Internet.  Further effort will be needed,
  1434.    however, to enhance robustness, generality, and interoperability.  In
  1435.    particular, further work is needed in the following areas:
  1436.  
  1437.        1.  User naming techniques, and their relationship to the domain
  1438.            system, name servers, directory services, and key management
  1439.            functions.
  1440.  
  1441.        2.  Standardization of Issuing Authority functions, including
  1442.            protocols for communications among IAs and between User
  1443.            Agents and IAs.
  1444.  
  1445.        3.  Specification of public key encryption algorithms to encrypt
  1446.            data encrypting keys.
  1447.  
  1448.        4.  Interoperability with X.400 mail.
  1449.  
  1450.  
  1451.  
  1452. Linn                                                           [Page 26]
  1453.  
  1454. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1455.  
  1456.  
  1457.    We anticipate generation of subsequent RFCs which will address these
  1458.    topics.
  1459.  
  1460. 9.  References
  1461.  
  1462.    This section identifies background references which may be useful to
  1463.    those contemplating use of the mechanisms defined in this RFC.
  1464.  
  1465.       ISO 7498/Part 2 - Security Architecture, prepared by ISO/TC97/SC
  1466.       21/WG 1 Ad hoc group on Security, extends the OSI Basic Reference
  1467.       Model to cover security aspects which are general architectural
  1468.       elements of communications protocols, and provides an annex with
  1469.       tutorial and background information.
  1470.  
  1471.       US Federal Information Processing Standards Publication (FIPS PUB)
  1472.       46, Data Encryption Standard, 15 January 1977, defines the
  1473.       encipherment algorithm used for message text encryption and
  1474.       Message Authentication Code (MAC) computation.
  1475.  
  1476.       FIPS PUB 81, DES Modes of Operation, 2 December 1980, defines
  1477.       specific modes in which the Data Encryption Standard algorithm may
  1478.       to be used to perform encryption.
  1479.  
  1480.       FIPS PUB 113, Computer Data Authentication, May 1985, defines a
  1481.       specific procedure for use of the Data Encryption Standard
  1482.       algorithm to compute a MAC.
  1483.  
  1484. A.  Message Integrity Check Algorithms
  1485.  
  1486.    This appendix identifies the alternative algorithms which may be used
  1487.    to compute Message Integrity Check (MIC) values, and assigns them
  1488.    character string identifiers to be incorporated in "X-Recipient-ID:"
  1489.    fields to indicate the choice of algorithm employed for individual
  1490.    message recipients.
  1491.  
  1492.    MIC algorithms which utilize DEA-1 cryptography are computed using a
  1493.    key which is a variant of the DEK used for message text encryption.
  1494.    The variant is formed by modulo-2 addition of the hexadecimal
  1495.    quantity F0F0F0F0F0F0F0F0 to the encryption DEK.
  1496.  
  1497. A.1  Conventional MAC (MAC)
  1498.  
  1499.    A conventional MAC, denoted by the string "MAC", is computed using
  1500.    the DEA-1 algorithm in the fashion defined in FIPS PUB 113 [15].  Use
  1501.    of the conventional MAC is not recommended for multicast messages.
  1502.    The message's encapsulated text is padded at the end, per FIPS PUB
  1503.    113, with zero-valued octets as needed in order to form an integral
  1504.    number of 8-octet encryption quanta.  These padding octets are
  1505.  
  1506.  
  1507.  
  1508. Linn                                                           [Page 27]
  1509.  
  1510. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1511.  
  1512.  
  1513.    inserted implicitly and are not transmitted with a message.  The
  1514.    result of a conventional MAC computation is a single 64-bit value.
  1515.  
  1516. A.2  Bidirectional MAC (BMAC)
  1517.  
  1518.    A bidirectional MAC, denoted by the string "BMAC", yields a result
  1519.    which is transferred as a single 128-bit value.  The BMAC is computed
  1520.    in the following manner:  First, the encapsulated text is padded at
  1521.    the end with zero-valued octets as needed in order to form an
  1522.    integral number of 8-octet encryption quanta.  These padding octets
  1523.    are inserted implicitly and are not transmitted with a message.  A
  1524.    conventional MAC is computed on the padded form, and the resulting
  1525.    64-bits form the high-order 64-bits of the BMAC result.
  1526.  
  1527.    The low-order 64-bits of the BMAC result are also formed by computing
  1528.    a conventional MAC, but the order of the 8-octet encryption quanta is
  1529.    reversed for purposes of computation. In other words, the first
  1530.    quantum entered into this computation is the last quantum in the
  1531.    encapsulated text, and includes any added padding.  The first quantum
  1532.    in the text is the last quantum processed as input to this
  1533.    computation.  The octets within each 8-octet quantum are not
  1534.    reordered.
  1535.  
  1536. NOTES:
  1537.  
  1538.      [1]  Key generation for MIC computation and message text
  1539.           encryption may either be performed by the sending host or
  1540.           by a centralized server.  This RFC does not constrain this
  1541.           design alternative.   Section 5.1 identifies possible
  1542.           advantages of a centralized server approach.
  1543.  
  1544.      [2]  Information Processing Systems: Data Encipherment: Block
  1545.           Cipher Algorithm DEA 1.
  1546.  
  1547.      [3]  Federal Information Processing Standards Publication 46,
  1548.           Data Encryption Standard, 15 January 1977.
  1549.  
  1550.      [4]  Information Processing Systems: Data Encipherment: Modes of
  1551.           Operation of a 64-bit Block Cipher.
  1552.  
  1553.      [5]  Federal Information Processing Standards Publication 81,
  1554.           DES Modes of Operation, 2 December 1980.
  1555.  
  1556.      [6]  Addendum to the Transport Layer Protocol Definition for
  1557.           Providing Connection Oriented End to End Cryptographic Data
  1558.           Protection Using a 64-Bit Block Cipher, X3T1-85-50.3, draft
  1559.           of 19 December 1985, Gaithersburg, MD, p. 15.
  1560.  
  1561.  
  1562.  
  1563.  
  1564. Linn                                                           [Page 28]
  1565.  
  1566. RFC 1040        Privacy Enhancement for Electronic Mail     January 1988
  1567.  
  1568.  
  1569.      [7]  Postel, J., Simple Mail Transfer Protocol (RFC-821), August
  1570.           1982.
  1571.  
  1572.      [8]  This transformation should occur only at an SMTP endpoint,
  1573.           not at an intervening relay, but may take place at a
  1574.           gateway system linking the SMTP realm with other
  1575.           environments.
  1576.  
  1577.      [9]  Use of the SMTP canonicalization procedure at this stage
  1578.           was selected since it is widely used and implemented in the
  1579.           Internet community, not because SMTP interoperability with
  1580.           this intermediate result is required; no privacy-enhanced
  1581.           message will be passed to SMTP for transmission directly
  1582.           from this step in the four-phase transformation procedure.
  1583.  
  1584.      [10] Crocker, D., Standard for the Format of ARPA Internet Text
  1585.           Messages (RFC-822), August 1982.
  1586.  
  1587.      [11] Rose, M. T. and Stefferud, E. A., Proposed Standard for
  1588.           Message Encapsulation (RFC-934), January 1985.
  1589.  
  1590.      [12] CCITT Recommendation X.411 (1988), "Message Handling
  1591.           Systems: Message Transfer System: Abstract Service
  1592.           Definition and Procedures".
  1593.  
  1594.      [13] CCITT Recommendation X.509 (1988), "The Directory -
  1595.           Authentication Framework".
  1596.  
  1597.      [14] Kille, S. E., Mapping between X.400 and RFC-822 (RFC-987),
  1598.           June 1986.
  1599.  
  1600.      [15] Federal Information Processing Standards Publication 113,
  1601.           Computer Data Authentication, May 1985.
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620. Linn                                                           [Page 29]
  1621.  
  1622.