home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / pc / crypto / rfc1423.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  33.3 KB  |  790 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8. Network Working Group                                        D. Balenson
  9. Request for Comments: 1423                                           TIS
  10. Obsoletes: 1115                               IAB IRTF PSRG, IETF PEM WG
  11.                                                            February 1993
  12.  
  13.  
  14.            Privacy Enhancement for Internet Electronic Mail:
  15.               Part III: Algorithms, Modes, and Identifiers
  16.  
  17. Status of This Memo
  18.  
  19.    This RFC specifies an IAB standards track protocol for the Internet
  20.    community, and requests discussion and suggestions for improvements.
  21.    Please refer to the current edition of the "IAB Official Protocol
  22.    Standards" for the standardization state and status of this protocol.
  23.    Distribution of this memo is unlimited.
  24.  
  25. Abstract
  26.  
  27.    This document provides definitions, formats, references, and
  28.    citations for cryptographic algorithms, usage modes, and associated
  29.    identifiers and parameters used in support of Privacy Enhanced Mail
  30.    (PEM) in the Internet community.  It is intended to become one member
  31.    of the set of related PEM RFCs.  This document is organized into four
  32.    primary sections, dealing with message encryption algorithms, message
  33.    integrity check algorithms, symmetric key management algorithms, and
  34.    asymmetric key management algorithms (including both asymmetric
  35.    encryption and asymmetric signature algorithms).
  36.  
  37.    Some parts of this material are cited by other documents and it is
  38.    anticipated that some of the material herein may be changed, added,
  39.    or replaced without affecting the citing documents.  Therefore,
  40.    algorithm-specific material has been placed into this separate
  41.    document.
  42.  
  43.    Use of other algorithms and/or modes will require case-by-case study
  44.    to determine applicability and constraints.  The use of additional
  45.    algorithms may be documented first in Prototype or Experimental RFCs.
  46.    As experience is gained, these protocols may be considered for
  47.    incorporation into the standard.  Additional algorithms and modes
  48.    approved for use in PEM in this context will be specified in
  49.    successors to this document.
  50.  
  51. Acknowledgments
  52.  
  53.    This specification was initially developed by the Internet Research
  54.    Task Force's Privacy and Security Research Group (IRTF PSRG) and
  55.    subsequently refined based on discussion in the Internet Engineering
  56.  
  57.  
  58.  
  59. Balenson                                                        [Page 1]
  60. ^L
  61. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  62.  
  63.  
  64.    Task Force's Privacy Enhanced Mail Working Group (IETF PEM WG).  John
  65.    Linn contributed significantly to the predecessor of this document
  66.    (RFC 1115).  I would like to thank the members of the PSRG and PEM
  67.    WG, as well as all participants in discussions on the "pem-
  68.    dev@tis.com" mailing list, for their contributions to this document.
  69.  
  70. Table of Contents
  71.  
  72.       1.  Message Encryption Algorithms ....................... 2
  73.       1.1  DES in CBC Mode (DES-CBC) .......................... 2
  74.       2.  Message Integrity Check Algorithms .................. 4
  75.       2.1  RSA-MD2 Message Digest Algorithm ................... 4
  76.       2.2  RSA-MD5 Message Digest Algorithm ................... 5
  77.       3.  Symmetric Key Management Algorithms ................. 6
  78.       3.1  DES in ECB mode (DES-ECB) .......................... 6
  79.       3.2  DES in EDE mode (DES-EDE) .......................... 7
  80.       4.  Asymmetric Key Management Algorithms ................ 7
  81.       4.1  Asymmetric Keys .................................... 7
  82.       4.1.1  RSA Keys ......................................... 7
  83.       4.2  Asymmetric Encryption Algorithms ..................  9
  84.       4.2.1  RSAEncryption ...................................  9
  85.       4.3  Asymmetric Signature Algorithms ................... 10
  86.       4.3.1  md2WithRSAEncryption ............................ 11
  87.       5.  Descriptive Grammar ................................ 11
  88.       References ............................................. 12
  89.       Patent Statement ....................................... 13
  90.       Security Considerations ................................ 14
  91.       Author's Address ....................................... 14
  92.  
  93. 1.  Message Encryption Algorithms
  94.  
  95.    This section identifies the alternative message encryption algorithms
  96.    and modes that shall be used to encrypt message text and, when
  97.    asymmetric key management is employed in an ENCRYPTED PEM message, for
  98.    encryption of message signatures.  Character string identifiers are
  99.    assigned and any parameters required by the message encryption
  100.    algorithm are defined for incorporation in an encapsulated "DEK-
  101.    Info:" header field.
  102.  
  103.    Only one alternative is currently defined in this category.
  104.  
  105. 1.1  DES in CBC Mode (DES-CBC)
  106.  
  107.    Message text and, if required, message signatures are encrypted using
  108.    the Data Encryption Standard (DES) algorithm in the Cipher Block
  109.    Chaining (CBC) mode of operation.  The DES algorithm is defined in
  110.    FIPS PUB 46-1 [1], and is equivalent to the Data Encryption Algorithm
  111.    (DEA) provided in ANSI X3.92-1981 [2].  The CBC mode of operation of
  112.  
  113.  
  114.  
  115. Balenson                                                        [Page 2]
  116. ^L
  117. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  118.  
  119.  
  120.    DES is defined in FIPS PUB 81 [3], and is equivalent to those
  121.    provided in ANSI X3.106 [4] and in ISO IS 8372 [5].  The character
  122.    string "DES-CBC" within an encapsulated PEM header field indicates
  123.    the use of this algorithm/mode combination.
  124.  
  125.    The input to the DES CBC encryption process shall be padded to a
  126.    multiple of 8 octets, in the following manner.  Let n be the length
  127.    in octets of the input.  Pad the input by appending 8-(n mod 8)
  128.    octets to the end of the message, each having the value 8-(n mod 8),
  129.    the number of octets being added.  In hexadecimal, the possible
  130.    paddings are:  01, 0202, 030303, 04040404, 0505050505, 060606060606,
  131.    07070707070707, and 0808080808080808.  All input is padded with 1 to
  132.    8 octets to produce a multiple of 8 octets in length.  The padding
  133.    can be removed unambiguously after decryption.
  134.  
  135.    The DES CBC encryption process requires a 64-bit cryptographic key.
  136.    A new, pseudorandom key shall be generated for each ENCRYPTED PEM
  137.    message.  Of the 64 bits, 56 are used directly by the DES CBC
  138.    process, and 8 are odd parity bits, with one parity bit occupying the
  139.    right-most bit of each octet.  When symmetric key management is
  140.    employed, the setting and checking of odd parity bits is encouraged,
  141.    since these bits could detect an error in the decryption of a DES key
  142.    encrypted under a symmetric key management algorithm (e.g., DES ECB).
  143.    When asymmetric key management is employed, the setting of odd parity
  144.    bits is encouraged, but the checking of odd parity bits is
  145.    discouraged, in order to facilitate interoperability, and since an
  146.    error in the decryption of a DES key can be detected by other means
  147.    (e.g., an incorrect PKCS #1 encryption-block format).  In all cases,
  148.    the encrypted form of a DES key shall carry all 64 bits of the key,
  149.    including the 8 parity bits, though those bits may have no meaning.
  150.  
  151.    The DES CBC encryption process also requires a 64-bit Initialization
  152.    Vector (IV).  A new, pseudorandom IV shall be generated for each
  153.    ENCRYPTED PEM message.  Section 4.3.1 of [7] provides rationale for
  154.    this requirement, even given the fact that individual DES keys are
  155.    generated for individual messages.  The IV is transmitted with the
  156.    message within an encapsulated PEM header field.
  157.  
  158.    When this algorithm/mode combination is used for message text
  159.    encryption, the "DEK-Info:" header field carries exactly two
  160.    arguments.  The first argument identifies the DES CBC algorithm/mode
  161.    using the character string defined above.  The second argument
  162.    contains the IV, represented as a contiguous string of 16 ASCII
  163.    hexadecimal digits.
  164.  
  165.    When symmetric key management is employed with this algorithm/mode
  166.    combination, a symmetrically encrypted DES key will be represented in
  167.    the third argument of a "Key-Info:" header field as a contiguous
  168.  
  169.  
  170.  
  171. Balenson                                                        [Page 3]
  172. ^L
  173. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  174.  
  175.  
  176.    string of 16 ASCII hexadecimal digits (corresponding to a 64-bit
  177.    key).
  178.  
  179.    To avoid any potential ambiguity regarding the ordering of the octets
  180.    of a DES key that is input as a data value to another encryption
  181.    process (e.g., RSAEncryption), the following holds true.  The first
  182.    (or left-most displayed, if one thinks in terms of a key's "print"
  183.    representation) (For purposes of discussion in this document, data
  184.    values are normalized in terms of their "print" representation.  For a
  185.    octet stream, the "first" octet would appear as the one on the "left",
  186.    and the "last" octet would appear on the "right".) octet of the key
  187.    (i.e., bits 1-8 per FIPS PUB 46-1), when considered as a data value,
  188.    has numerical weight 2**56.  The last (or right-most displayed) octet
  189.    (i.e., bits 57-64 per FIPS PUB 46-1) has numerical weight 2**0.
  190.  
  191. 2.  Message Integrity Check Algorithms
  192.  
  193.    This section identifies the alternative algorithms that shall be used
  194.    to compute Message Integrity Check (MIC) values for PEM messages.
  195.    Character string identifiers and ASN.1 object identifiers are
  196.    assigned for incorporation in encapsulated "MIC-Info:" and "Key-
  197.    Info:" header fields to indicate the choice of MIC algorithm
  198.    employed.
  199.  
  200.    A compliant PEM implementation shall be able to process all of the
  201.    alternative MIC algorithms defined here on incoming messages.  It is
  202.    a sender option as to which alternative is employed on an outbound
  203.    message.
  204.  
  205. 2.1  RSA-MD2 Message Digest Algorithm
  206.  
  207.    The RSA-MD2 message digest is computed using the algorithm defined in
  208.    RFC 1319 [9].  ( An error has been identified in RFC 1319.  The
  209.    statement in the text of Section 3.2 which reads "Set C[j] to S[c xor
  210.    L]" should read "Set C[j] to S[c xor L] xor C[j]".  Note that the C
  211.    source code in the appendix of RFC 1319 is correct.)  The character
  212.    string "RSA-MD2" within an encapsulated PEM header field indicates the
  213.    use of this algorithm.  Also, as defined in RFC 1319, the ASN.1 object
  214.    identifier
  215.  
  216.      md2 OBJECT IDENTIFIER ::= {
  217.          iso(1) member-body(2) US(840) rsadsi(113549)
  218.          digestAlgorithm(2) 2
  219.      }
  220.  
  221.    identifies this algorithm.  When this object identifier is used with
  222.    the ASN.1 type AlgorithmIdentifier, the parameters component of that
  223.    type is the ASN.1 type NULL.
  224.  
  225.  
  226.  
  227. Balenson                                                        [Page 4]
  228. ^L
  229. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  230.  
  231.  
  232.    The RSA-MD2 message digest algorithm accepts as input a message of
  233.    any length and produces as output a 16-octet quantity.  When
  234.    symmetric key management is employed, an RSA-MD2 MIC is encrypted by
  235.    splitting the MIC into two 8-octet halves, independently encrypting
  236.    each half, and concatenating the results.
  237.  
  238.    When symmetric key management is employed with this MIC algorithm,
  239.    the symmetrically encrypted MD2 message digest is represented in a
  240.    the fourth argument of a "Key-Info:" header field as a contiguous
  241.    string of 32 ASCII hexadecimal digits (corresponding to a 128-bit MD2
  242.    message digest).
  243.  
  244.    To avoid any potential ambiguity regarding the ordering of the octets
  245.    of an MD2 message digest that is input as a data value to another
  246.    encryption process (e.g., RSAEncryption), the following holds true.
  247.    The first (or left-most displayed, if one thinks in terms of a
  248.    digest's "print" representation) octet of the digest (i.e., digest[0]
  249.    as specified in RFC 1319), when considered as an RSA data value, has
  250.    numerical weight 2**120.  The last (or right-most displayed) octet
  251.    (i.e., digest[15] as specified in RFC 1319) has numerical weight
  252.    2**0.
  253.  
  254. 2.2  RSA-MD5 Message Digest Algorithm
  255.  
  256.    The RSA-MD5 message digest is computed using the algorithm defined in
  257.    RFC 1321 [10].  The character string "RSA-MD5" within an encapsulated
  258.    PEM header field indicates the use of this algorithm.  Also, as
  259.    defined in RFC 1321, the object identifier
  260.  
  261.      md5 OBJECT IDENTIFIER ::= {
  262.          iso(1) member-body(2) US(840) rsadsi(113549)
  263.          digestAlgorithm(2) 5
  264.      }
  265.  
  266.    identifies this algorithm.  When this object identifier is used with
  267.    the ASN.1 type AlgorithmIdentifier, the parameters component of that
  268.    type is the ASN.1 type NULL.
  269.  
  270.    The RSA-MD5 message digest algorithm accepts as input a message of
  271.    any length and produces as output a 16-octet quantity.  When
  272.    symmetric key management is employed, an RSA-MD5 MIC is encrypted by
  273.    splitting the MIC into two 8-octet halves, independently encrypting
  274.    each half, and concatenating the results.
  275.  
  276.    When symmetric key management is employed with this MIC algorithm,
  277.    the symmetrically encrypted MD5 message digest is represented in the
  278.    fourth argument of a "Key-Info:" header field as a contiguous string
  279.    of 32 ASCII hexadecimal digits (corresponding to a 128-bit MD5
  280.  
  281.  
  282.  
  283. Balenson                                                        [Page 5]
  284. ^L
  285. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  286.  
  287.  
  288.    message digest).
  289.  
  290.    To avoid any potential ambiguity regarding the ordering of the octets
  291.    of a MD5 message digest that is input as an RSA data value to the RSA
  292.    encryption process, the following holds true.  The first (or left-
  293.    most displayed, if one thinks in terms of a digest's "print"
  294.    representation) octet of the digest (i.e., the low-order octet of A
  295.    as specified in RFC 1321), when considered as an RSA data value, has
  296.    numerical weight 2**120.  The last (or right-most displayed) octet
  297.    (i.e., the high-order octet of D as specified in RFC 1321) has
  298.    numerical weight 2**0.
  299.  
  300. 3.  Symmetric Key Management Algorithms
  301.  
  302.    This section identifies the alternative algorithms and modes that
  303.    shall be used when symmetric key management is employed, to encrypt
  304.    data encryption keys (DEKs) and message integrity check (MIC) values.
  305.    Character string identifiers are assigned for incorporation in
  306.    encapsulated "Key-Info:" header fields to indicate the choice of
  307.    algorithm employed.
  308.  
  309.    All alternatives presently defined in this category correspond to
  310.    different usage modes of the DES algorithm, rather than to other
  311.    algorithms.
  312.  
  313.    When symmetric key management is employed, the symmetrically
  314.    encrypted DEK and MIC, carried in the third and fourth arguments of a
  315.    "Key-Info:" header field, respectively, are each represented as a
  316.    string of contiguous ASCII hexadecimal digits.  The manner in which
  317.    to use the following symmetric encryption algorithms and the length
  318.    of the symmetrically encrypted DEK and MIC may vary depending on the
  319.    length of the underlying DEK and MIC.  Section 1, Message Encryption
  320.    Algorithms, and Section 2, Message Integrity Check Algorithms,
  321.    provide information on the proper manner in which a DEK and MIC,
  322.    respectively, are symmetrically encrypted when the size of the DEK or
  323.    MIC is not equal to the symmetric encryption algorithm's input block
  324.    size.  These sections also provide information on the proper format
  325.    and length of the symmetrically encrypted DEK and MIC, respectively.
  326.  
  327. 3.1  DES in ECB Mode (DES-ECB)
  328.  
  329.    The DES algorithm in Electronic Codebook (ECB) mode [1][3] is used
  330.    for DEK and MIC encryption when symmetric key management is employed.
  331.    The character string "DES-ECB" within an encapsulated PEM header
  332.    field indicates use of this algorithm/mode combination.
  333.  
  334.    A compliant PEM implementation supporting symmetric key management
  335.    shall support this algorithm/mode combination.
  336.  
  337.  
  338.  
  339. Balenson                                                        [Page 6]
  340. ^L
  341. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  342.  
  343.  
  344. 3.2  DES in EDE Mode (DES-EDE)
  345.  
  346.    The DES algorithm in Encrypt-Decrypt-Encrypt (EDE) multiple
  347.    encryption mode, as defined by ANSI X9.17 [6] for encryption and
  348.    decryption with pairs of 64-bit keys, may be used for DEK and MIC
  349.    encryption when symmetric key management is employed.  The character
  350.    string "DES-EDE" within an encapsulated a PEM header field indicates
  351.    use of this algorithm/mode combination.
  352.  
  353.    A compliant PEM implementation supporting symmetric key management
  354.    may optionally support this algorithm/mode combination.
  355.  
  356. 4.  Asymmetric Key Management Algorithms
  357.  
  358.    This section identifies the alternative asymmetric keys and the
  359.    alternative asymmetric key management algorithms with which those
  360.    keys shall be used, namely the asymmetric encryption algorithms with
  361.    which DEKs and MICs are encrypted, and the asymmetric signature
  362.    algorithms with which certificates and certificate revocation lists
  363.    (CRLs) are signed.
  364.  
  365. 4.1  Asymmetric Keys
  366.  
  367.    This section describes the asymmetric keys that shall be used with
  368.    the asymmetric encryption algorithms and the signature algorithms
  369.    described later.  ASN.1 object identifiers are identified for
  370.    incorporation in a public-key certificate to identify the
  371.    algorithm(s) with which the accompanying public key is to be
  372.    employed.
  373.  
  374. 4.1.1  RSA Keys
  375.  
  376.    An RSA asymmetric key pair is comprised of matching public and
  377.    private keys.
  378.  
  379.    An RSA public key consists of an encryption exponent e and an
  380.    arithmetic modulus n, which are both public quantities typically
  381.    carried in a public-key certificate.  For the value of e, Annex C to
  382.    X.509 suggests the use of Fermat's Number F4 (65537 decimal, or
  383.    1+2**16) as a value "common to the whole environment in order to
  384.    reduce transmission capacity and complexity of transformation", i.e.,
  385.    the value can be transmitted as 3 octets and at most seventeen (17)
  386.    multiplications are required to effect exponentiation.  As an
  387.    alternative, the number three (3) can be employed as the value for e,
  388.    requiring even less octets for transmission and yielding even faster
  389.    exponentiation.  For purposes of PEM, the value of e shall be either
  390.    F4 or the number three (3).  The use of the number three (3) for the
  391.    value of e is encouraged, to permit rapid certificate validation.
  392.  
  393.  
  394.  
  395. Balenson                                                        [Page 7]
  396. ^L
  397. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  398.  
  399.  
  400.    An RSA private key consists of a decryption exponent d, which should
  401.    be kept secret, and the arithmetic modulus n.  Other values may be
  402.    stored with a private key to facilitate efficient private key
  403.    operations (see PKCS #1 [11]).
  404.  
  405.    For purposes of PEM, the modulus n may vary in size from 508 to 1024
  406.    bits.
  407.  
  408.    Two ASN.1 object identifiers have been defined to identify RSA public
  409.    keys.  In Annex H of X.509 [8], the object identifier
  410.  
  411.      rsa OBJECT IDENTIFIER ::= {
  412.          joint-iso-ccitt(2) ds(5) algorithm(8)
  413.          encryptionAlgorithm(1) 1
  414.      }
  415.  
  416.    is defined to identify an RSA public key.  A single parameter,
  417.    KeySize, the length of the public key modulus in bits, is defined for
  418.    use in conjunction with this object identifier.  When this object
  419.    identifier is used with the ASN.1 type AlgorithmIdentifier, the
  420.    parameters component of that type is the number of bits in the
  421.    modulus, ASN.1 encoded as an INTEGER.
  422.  
  423.    Alternatively, in PKCS #1 [11], the ASN.1 object identifier
  424.  
  425.      rsaEncryption OBJECT IDENTIFIER ::= {
  426.          iso(1) member-body(2) US(840) rsadsi(113549) pkcs(1)
  427.          pkcs-1(1) 1
  428.      }
  429.  
  430.    is defined to identify both an RSA public key and the RSAEncryption
  431.    process.  There are no parameters defined in conjunction with this
  432.    object identifier, hence, when it is used with the ASN.1 type
  433.    AlgorithmIdentifier, the parameters component of that type is the
  434.    ASN.1 type NULL.
  435.  
  436.    A compliant PEM implementation may optionally generate an RSA
  437.    public-key certificate that identifies the enclosed RSA public key
  438.    (within the SubjectPublicKeyInformation component) with either the
  439.    "rsa" or the "rsaEncryption" object identifier.  Use of the "rsa"
  440.    object identifier is encouraged, since it is, in some sense, more
  441.    generic in its identification of a key, without indicating how the
  442.    key will be used.  However, to facilitate interoperability, a
  443.    compliant PEM implementation shall accept RSA public-key certificates
  444.    that identify the enclosed RSA public key with either the "rsa" or
  445.    the "rsaEncryption" object identifier.  In all cases, an RSA public
  446.    key identified in an RSA public-key certificate with either the "rsa"
  447.    or "rsaEncryption" object identifier, shall be used according to the
  448.  
  449.  
  450.  
  451. Balenson                                                        [Page 8]
  452. ^L
  453. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  454.  
  455.  
  456.    procedures defined below for asymmetric encryption algorithms and
  457.    asymmetric signature algorithms.
  458.  
  459. 4.2  Asymmetric Encryption Algorithms
  460.  
  461.    This section identifies the alternative algorithms that shall be used
  462.    when asymmetric key management is employed, to encrypt DEKs and MICs.
  463.    Character string identifiers are assigned for incorporation in "MIC-
  464.    Info:" and "Key-Info:" header fields to indicate the choice of
  465.    algorithm employed.
  466.  
  467.    Only one alternative is presently defined in this category.
  468.  
  469. 4.2.1  RSAEncryption
  470.  
  471.    The RSAEncryption public-key encryption algorithm, defined in PKCS #1
  472.    [11], is used for DEK and MIC encryption when asymmetric key
  473.    management is employed.  The character string "RSA" within a "MIC-
  474.    Info:" or "Key-Info:" header field indicates the use of this
  475.    algorithm.
  476.  
  477.    All PEM implementations supporting asymmetric key management shall
  478.    support this algorithm.
  479.  
  480.    As described in PKCS #1, all quantities input as data values to the
  481.    RSAEncryption process shall be properly justified and padded to the
  482.    length of the modulus prior to the encryption process.  In general,
  483.    an RSAEncryption input value is formed by concatenating a leading
  484.    NULL octet, a block type BT, a padding string PS, a NULL octet, and
  485.    the data quantity D, that is,
  486.  
  487.      RSA input value = 0x00 || BT || PS || 0x00 || D.
  488.  
  489.    To prepare a DEK for RSAEncryption, the PKCS #1 "block type 02"
  490.    encryption-block formatting scheme is employed.  The block type BT is
  491.    a single octet containing the value 0x02 and the padding string PS is
  492.    one or more octets (enough octets to make the length of the complete
  493.    RSA input value equal to the length of the modulus) each containing a
  494.    pseudorandomly generated, non-zero value.  For multiple recipient
  495.    messages, a different, pseudorandom padding string should be used for
  496.    each recipient.  The data quantity D is the DEK itself, which is
  497.    right-justified within the RSA input such that the last (or rightmost
  498.    displayed, if one thinks in terms of the "print" representation)
  499.    octet of the DEK is aligned with the right-most, or least-
  500.    significant, octet of the RSA input.  Proceeding to the left, each of
  501.    the remaining octets of the DEK, up through the first (or left-most
  502.    displayed) octet, are each aligned in the next more significant octet
  503.    of the RSA input.
  504.  
  505.  
  506.  
  507. Balenson                                                        [Page 9]
  508. ^L
  509. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  510.  
  511.  
  512.    To prepare a MIC for RSAEncryption, the PKCS #1 "block type 01"
  513.    encryption-block formatting scheme is employed.  The block type BT is
  514.    a single octet containing the value 0x01 and the padding string PS is
  515.    one or more octets (enough octets to make the length of the complete
  516.    RSA input value equal to the length of the modulus) each containing
  517.    the value 0xFF.  The data quantity D is comprised of the MIC and the
  518.    MIC algorithm identifier which are ASN.1 encoded as the following
  519.    sequence.
  520.  
  521.      SEQUENCE {
  522.          digestAlgorithm   AlgorithmIdentifier,
  523.          digest            OCTET STRING
  524.      }
  525.  
  526.    The ASN.1 type AlgorithmIdentifier is defined in X.509 as follows.
  527.  
  528.      AlgorithmIdentifier ::= SEQUENCE {
  529.          algorithm         OBJECT IDENTIFIER,
  530.          parameters        ANY DEFINED BY algorithm OPTIONAL
  531.      }
  532.  
  533.    An RSA input block is encrypted using the RSA algorithm with the
  534.    first (or left-most) octet taken as the most significant octet, and
  535.    the last (or right-most) octet taken as the least significant octet.
  536.    The resulting RSA output block is interpreted in a similar manner.
  537.  
  538.    When RSAEncryption is used to encrypt a DEK, the second argument in a
  539.    "MIC-Info:" header field, an asymmetrically encrypted DEK, is
  540.    represented using the printable encoding technique defined in Section
  541.    4.3.2.4 of RFC 1421 [12].
  542.  
  543.    When RSAEncryption is used to sign a MIC, the third argument in a
  544.    "MIC-Info:" header field, an asymmetrically signed MIC, is
  545.    represented using the printable encoding technique defined in Section
  546.    4.3.2.4 of RFC 1421.
  547.  
  548. 4.3  Asymmetric Signature Algorithms
  549.  
  550.    This section identifies the alternative algorithms which shall be
  551.    used to asymmetrically sign certificates and certificate revocation
  552.    lists (CRLs) in accordance with the SIGNED macro defined in Annex G
  553.    of X.509.  ASN.1 object identifiers are identified for incorporation
  554.    in certificates and CRLs to indicate the choice of algorithm
  555.    employed.
  556.  
  557.    Only one alternative is presently defined in this category.
  558.  
  559.  
  560.  
  561.  
  562.  
  563. Balenson                                                       [Page 10]
  564. ^L
  565. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  566.  
  567.  
  568. 4.3.1  md2WithRSAEncryption
  569.  
  570.    The md2WithRSAEncryption signature algorithm is used to sign
  571.    certificates and CRLs.  The algorithm is defined in PKCS #1 [11].  It
  572.    combines the RSA-MD2 message digest algorithm described here in
  573.    Section 2.2 with the RSAEncryption asymmetric encryption algorithm
  574.    described here in Section 4.2.1.  As defined in PKCS #1, the ASN.1
  575.    object identifier
  576.  
  577.      md2WithRSAEncryption OBJECT IDENTIFIER ::= {
  578.          iso(1) member-body(2) US(840) rsadsi(113549) pkcs(1)
  579.          pkcs-1(1) 2
  580.      }
  581.  
  582.    identifies this algorithm.  When this object identifier is used with
  583.    the ASN.1 type AlgorithmIdentifier, the parameters component of that
  584.    type is the ASN.1 type NULL.
  585.  
  586.    There is some ambiguity in X.509 regarding the definition of the
  587.    SIGNED macro and, in particular, the representation of a signature in
  588.    a certificate or a CRL.  The interpretation selected for PEM requires
  589.    that the data to be signed (in our case, an MD2 message digest) is
  590.    first ASN.1 encoded as an OCTET STRING and the result is encrypted
  591.    (in our case, using RSAEncryption) to form the signed quantity, which
  592.    is then ASN.1 encoded as a BIT STRING.
  593.  
  594. 5.  Descriptive Grammar
  595.  
  596.    ; Addendum to PEM BNF representation, using RFC 822 notation
  597.    ; Provides specification for official PEM cryptographic algorithms,
  598.    ; modes, identifiers and formats.
  599.  
  600.    ; Imports <hexchar> and <encbin> from RFC [1421]
  601.  
  602.        <dekalgid> ::= "DES-CBC"
  603.        <ikalgid>  ::= "DES-EDE" / "DES-ECB" / "RSA"
  604.        <sigalgid> ::= "RSA"
  605.        <micalgid> ::= "RSA-MD2" / "RSA-MD5"
  606.  
  607.        <dekparameters> ::= <DESCBCparameters>
  608.        <DESCBCparameters> ::= <IV>
  609.        <IV> ::= <hexchar16>
  610.  
  611.        <symencdek> ::= <DESECBencDESCBC> / <DESEDEencDESCBC>
  612.        <DESECBencDESCBC> ::= <hexchar16>
  613.        <DESEDEencDESCBC> ::= <hexchar16>
  614.  
  615.        <symencmic> ::= <DESECBencRSAMD2> / <DESECBencRSAMD5>
  616.  
  617.  
  618.  
  619. Balenson                                                       [Page 11]
  620. ^L
  621. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  622.  
  623.  
  624.        <DESECBencRSAMD2> ::= 2*2<hexchar16>
  625.        <DESECBencRSAMD5> ::= 2*2<hexchar16>
  626.  
  627.        <asymsignmic> ::= <RSAsignmic>
  628.        <RSAsignmic> ::= <encbin>
  629.  
  630.        <asymencdek> ::= <RSAencdek>
  631.        <RSAencdek> ::= <encbin>
  632.  
  633.        <hexchar16> ::= 16*16<hexchar>
  634.  
  635. References
  636.  
  637.    [1] Federal Information Processing Standards Publication (FIPS PUB)
  638.        46-1, Data Encryption Standard, Reaffirmed 1988 January 22
  639.        (supersedes FIPS PUB 46, 1977 January 15).
  640.  
  641.    [2] ANSI X3.92-1981, American National Standard Data Encryption
  642.        Algorithm, American National Standards Institute, Approved 30
  643.        December 1980.
  644.  
  645.    [3] Federal Information Processing Standards Publication (FIPS PUB)
  646.        81, DES Modes of Operation, 1980 December 2.
  647.  
  648.    [4] ANSI X3.106-1983, American National Standard for Information
  649.        Systems - Data Encryption Algorithm - Modes of Operation,
  650.        American National Standards Institute, Approved 16 May 1983.
  651.  
  652.    [5] ISO 8372, Information Processing Systems: Data Encipherment:
  653.        Modes of Operation of a 64-bit Block Cipher.
  654.  
  655.    [6] ANSI X9.17-1985, American National Standard, Financial
  656.        Institution Key Management (Wholesale), American Bankers
  657.        Association, April 4, 1985, Section 7.2.
  658.  
  659.    [7] Voydock, V. L. and Kent, S. T., "Security Mechanisms in High-
  660.        Level Network Protocols", ACM Computing Surveys, Vol. 15, No. 2,
  661.        June 1983, pp. 135-171.
  662.  
  663.    [8] CCITT Recommendation X.509, "The Directory - Authentication
  664.        Framework", November 1988, (Developed in collaboration, and
  665.        technically aligned, with ISO 9594-8).
  666.  
  667.    [9] Kaliski, B., "The MD2 Message-Digest Algorithm", RFC 1319, RSA
  668.        Laboratories, April 1992.
  669.  
  670.   [10] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, MIT
  671.        Laboratory for Computer Science and RSA Data Security, Inc.,
  672.  
  673.  
  674.  
  675. Balenson                                                       [Page 12]
  676. ^L
  677. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  678.  
  679.  
  680.        April 1992.
  681.  
  682.   [11] PKCS #1: RSA Encryption Standard, Version 1.4, RSA Data Security,
  683.        Inc., June 3, 1991.
  684.  
  685.   [12] Linn, J., "Privacy Enhancement for Internet Electronic Mail: Part
  686.        I: Message Encryption and Authentication Procedures", RFC 1421,
  687.        DEC, February 1993.
  688.  
  689.   [13] Kent, S., "Privacy Enhancement for Internet Electronic Mail: Part
  690.        II: Certificate-Based Key Management", RFC 1422, BBN, February
  691.        1993.
  692.  
  693.   [14] Kaliski, B., "Privacy Enhancement for Internet Electronic Mail:
  694.        Part IV: Key Certification and Related Services", RFC 1424, RSA
  695.        Laboratories, February 1993.
  696.  
  697. Patent Statement
  698.  
  699.    This version of Privacy Enhanced Mail (PEM) relies on the use of
  700.    patented public key encryption technology for authentication and
  701.    encryption.  The Internet Standards Process as defined in RFC 1310
  702.    requires a written statement from the Patent holder that a license
  703.    will be made available to applicants under reasonable terms and
  704.    conditions prior to approving a specification as a Proposed, Draft or
  705.    Internet Standard.
  706.  
  707.    The Massachusetts Institute of Technology and the Board of Trustees
  708.    of the Leland Stanford Junior University have granted Public Key
  709.    Partners (PKP) exclusive sub-licensing rights to the following
  710.    patents issued in the United States, and all of their corresponding
  711.    foreign patents:
  712.  
  713.       Cryptographic Apparatus and Method
  714.       ("Diffie-Hellman")............................... No. 4,200,770
  715.  
  716.       Public Key Cryptographic Apparatus
  717.       and Method ("Hellman-Merkle").................... No. 4,218,582
  718.  
  719.       Cryptographic Communications System and
  720.       Method ("RSA")................................... No. 4,405,829
  721.  
  722.       Exponential Cryptographic Apparatus
  723.       and Method ("Hellman-Pohlig").................... No. 4,424,414
  724.  
  725.    These patents are stated by PKP to cover all known methods of
  726.    practicing the art of Public Key encryption, including the variations
  727.    collectively known as El Gamal.
  728.  
  729.  
  730.  
  731. Balenson                                                       [Page 13]
  732. ^L
  733. RFC 1423         PEM: Algorithms, Modes and Identifiers    February 1993
  734.  
  735.  
  736.    Public Key Partners has provided written assurance to the Internet
  737.    Society that parties will be able to obtain, under reasonable,
  738.    nondiscriminatory terms, the right to use the technology covered by
  739.    these patents.  This assurance is documented in RFC 1170 titled
  740.    "Public Key Standards and Licenses".  A copy of the written assurance
  741.    dated April 20, 1990, may be obtained from the Internet Assigned
  742.    Number Authority (IANA).
  743.  
  744.    The Internet Society, Internet Architecture Board, Internet
  745.    Engineering Steering Group and the Corporation for National Research
  746.    Initiatives take no position on the validity or scope of the patents
  747.    and patent applications, nor on the appropriateness of the terms of
  748.    the assurance.  The Internet Society and other groups mentioned above
  749.    have not made any determination as to any other intellectual property
  750.    rights which may apply to the practice of this standard. Any further
  751.    consideration of these matters is the user's own responsibility.
  752.  
  753. Security Considerations
  754.  
  755.    This entire document is about security.
  756.  
  757. Author's Address
  758.  
  759.    David Balenson
  760.    Trusted Information Systems
  761.    3060 Washington Road
  762.    Glenwood, Maryland 21738
  763.  
  764.    Phone: 301-854-6889
  765.    EMail: balenson@tis.com
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787. Balenson                                                       [Page 14]
  788. ^L
  789.  
  790.