home *** CD-ROM | disk | FTP | other *** search
/ Internet Core Protocols / Oreilly-InternetCoreProtocols.iso / RFCs / rfc2405.txt < prev    next >
Encoding:
Text File  |  1999-10-14  |  20.3 KB  |  564 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          C. Madson
  8. Request for Comments: 2405                           Cisco Systems, Inc.
  9. Category: Standards Track                                   N. Doraswamy
  10.                                                       Bay Networks, Inc.
  11.                                                            November 1998
  12.  
  13.  
  14.                     The ESP DES-CBC Cipher Algorithm
  15.                             With Explicit IV
  16.  
  17. Status of this Memo
  18.  
  19.    This document specifies an Internet standards track protocol for the
  20.    Internet community, and requests discussion and suggestions for
  21.    improvements.  Please refer to the current edition of the "Internet
  22.    Official Protocol Standards" (STD 1) for the standardization state
  23.    and status of this protocol.  Distribution of this memo is unlimited.
  24.  
  25. Copyright Notice
  26.  
  27.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  28.  
  29. Abstract
  30.  
  31.    This document describes the use of the DES Cipher algorithm in Cipher
  32.    Block Chaining Mode, with an explicit IV, as a confidentiality
  33.    mechanism within the context of the IPSec Encapsulating Security
  34.    Payload (ESP).
  35.  
  36. 1. Introduction
  37.  
  38.    This document describes the use of the DES Cipher algorithm in Cipher
  39.    Block Chaining Mode as a confidentiality mechanism within the context
  40.    of the Encapsulating Security Payload.
  41.  
  42.    DES is a symmetric block cipher algorithm. The algorithm is described
  43.    in [FIPS-46-2][FIPS-74][FIPS-81]. [Schneier96] provides a general
  44.    description of Cipher Block Chaining Mode, a mode which is applicable
  45.    to several encryption algorithms.
  46.  
  47.    As specified in this memo, DES-CBC is not an authentication
  48.    mechanism. [Although DES-MAC, described in [Schneier96] amongst other
  49.    places, does provide authentication, DES-MAC is not discussed here.]
  50.  
  51.    For further information on how the various pieces of ESP fit together
  52.    to provide security services, refer to [ESP] and [road].
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Madson & Doraswamy          Standards Track                     [Page 1]
  59.  
  60. RFC 2405            The ESP DES-CBC Cipher Algorithm       November 1998
  61.  
  62.  
  63.    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  64.    "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this
  65.    document are to be interpreted as described in [RFC-2119].
  66.  
  67. 2. Algorithm and Mode
  68.  
  69.    DES-CBC is a symmetric secret-key block algorithm. It has a block
  70.    size of 64 bits.
  71.  
  72.    [FIPS-46-2][FIPS-74] and [FIPS-81] describe the DES algorithm, while
  73.    [Schneier96] provides a good description of CBC mode.
  74.  
  75. 2.1 Performance
  76.  
  77.    Phil Karn has tuned DES-CBC software to achieve 10.45 Mbps with a 90
  78.    MHz Pentium, scaling to 15.9 Mbps with a 133 MHz Pentium.  Other DES
  79.    speed estimates may be found in [Schneier96].
  80.  
  81. 3. ESP Payload
  82.  
  83.    DES-CBC requires an explicit Initialization Vector (IV) of 8 octets
  84.    (64 bits).  This IV immediately precedes the protected (encrypted)
  85.    payload. The IV MUST be a random value.
  86.  
  87.    Including the IV in each datagram ensures that decryption of each
  88.    received datagram can be performed, even when some datagrams are
  89.    dropped, or datagrams are re-ordered in transit.
  90.  
  91.    Implementation note:
  92.  
  93.       Common practice is to use random data for the first IV and the
  94.       last 8 octets of encrypted data from an encryption process as the
  95.       IV for the next encryption process; this logically extends the CBC
  96.       across the packets. It also has the advantage of limiting the
  97.       leakage of information from the random number genrator. No matter
  98.       which mechnism is used, the receiver MUST NOT assume any meaning
  99.       for this value, other than that it is an IV.
  100.  
  101.       To avoid ECB encryption of very similar plaintext blocks in
  102.       different packets, implementations MUST NOT use a counter or other
  103.       low-Hamming distance source for IVs.
  104.  
  105.    The payload field, as defined in [ESP], is broken down according to
  106.    the following diagram:
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Madson & Doraswamy          Standards Track                     [Page 2]
  115.  
  116. RFC 2405            The ESP DES-CBC Cipher Algorithm       November 1998
  117.  
  118.  
  119.       +---------------+---------------+---------------+---------------+
  120.       |                                                               |
  121.       +                   Initialization Vector (IV)                  +
  122.       |                                                               |
  123.       +---------------+---------------+---------------+---------------+
  124.       |                                                               |
  125.       ~              Encrypted Payload (variable length)              ~
  126.       |                                                               |
  127.       +---------------------------------------------------------------+
  128.        1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
  129.  
  130. 3.1 Block Size and Padding
  131.  
  132.    The DES-CBC algorithm described in this document MUST use a block
  133.    size of 8 octets (64 bits).
  134.  
  135.    When padding is required, it MUST be done according to the
  136.    conventions specified in [ESP].
  137.  
  138. 4. Key Material
  139.  
  140.    DES-CBC is a symmetric secret key algorithm. The key size is 64-bits.
  141.    [It is commonly known as a 56-bit key as the key has 56 significant
  142.    bits; the least significant bit in every byte is the parity bit.]
  143.  
  144.    [arch] describes the general mechanism to derive keying material for
  145.    the ESP transform. The derivation of the key from some amount of
  146.    keying material does not differ between the manually- and
  147.    automatically-keyed security associations.
  148.  
  149.    This mechanism MUST derive a 64-bit key value for use by this cipher.
  150.    The mechanism will derive raw key values, the derivation process
  151.    itself is not responsible for handling parity or weak key checks.
  152.  
  153.    Weak key checks SHOULD be performed. If such a key is found, the key
  154.    SHOULD be rejected and a new SA requested.
  155.  
  156.    Implementation note:
  157.  
  158.       If an implementation chooses to do weak key checking, it should
  159.       recognize that the known weak keys [FIPS74] have been adjusted for
  160.       parity. Otherwise the handling of parity is a local issue.
  161.  
  162.    A strong pseudo-random function MUST be used to generate the required
  163.    key. For a discussion on this topic, reference [RFC1750].
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Madson & Doraswamy          Standards Track                     [Page 3]
  171.  
  172. RFC 2405            The ESP DES-CBC Cipher Algorithm       November 1998
  173.  
  174.  
  175. 4.1 Weak Keys
  176.  
  177.    DES has 16 known weak keys, including so-called semi-weak keys.  The
  178.    list of weak keys can be found in [FIPS74].
  179.  
  180. 4.2 Key Lifetime
  181.  
  182.    [Blaze96] discusses the costs and key recovery time for brute force
  183.    attacks. It presents various combinations of total cost/time to
  184.    recover a key/cost per key recovered for 40-bit and 56-bit DES keys,
  185.    based on late 1995 estimates.
  186.  
  187.    While a brute force search of a 56-bit DES keyspace can be considered
  188.    infeasable for the so-called casual hacker, who is simply using spare
  189.    CPU cycles or other low-cost resources, it is within reach of someone
  190.    willing to spend a bit more money.
  191.  
  192.    For example, for a cost of $300,000, a 56-bit DES key can be
  193.    recovered in an average of 19 days using off-the-shelf technology and
  194.    in only 3 hours using a custom developed chip.
  195.  
  196.    It should be noted that there are other attacks which can recover the
  197.    key faster, that brute force attacks are considered the "worst case",
  198.    although the easiest to implement.
  199.  
  200.    [Wiener94] also discusses a $1M machine which can break a DES key in
  201.    3.5 hours (1993 estimates), using a known-plaintext attack. As
  202.    discussed in the Security Considerations section, a known plaintext
  203.    attack is reasonably likely.
  204.  
  205.    It should also be noted that over time, the total and average search
  206.    costs as well as the average key recovery time will continue to drop.
  207.  
  208.    While the above does not provide specific recommendations for key
  209.    lifetime, it does reinforce the point that for a given application
  210.    the desired key lifetime is dependent upon the perceived threat (an
  211.    educated guess as to the amount of resources available to the
  212.    attacker) relative to the worth of the data to be protected.
  213.  
  214.    While there are no recommendations for volume-based lifetimes made
  215.    here, it shoud be noted that given sufficient volume there is an
  216.    increased probabilty that known plaintext can be accumulated.
  217.  
  218. 5. Interaction with Authentication Algorithms
  219.  
  220.    As of this writing, there are no known issues which preclude the use
  221.    of the DES-CBC algorithm with any specific authentication algorithm.
  222.  
  223.  
  224.  
  225.  
  226. Madson & Doraswamy          Standards Track                     [Page 4]
  227.  
  228. RFC 2405            The ESP DES-CBC Cipher Algorithm       November 1998
  229.  
  230.  
  231. 6. Security Considerations
  232.  
  233.    [Much of this section was originally written by William Allen Simpson
  234.    and Perry Metzger.]
  235.  
  236.    Users need to understand that the quality of the security provided by
  237.    this specification depends completely on the strength of the DES
  238.    algorithm, the correctness of that algorithm's implementation, the
  239.    security of the Security Association management mechanism and its
  240.    implementation, the strength of the key [CN94], and upon the
  241.    correctness of the implementations in all of the participating nodes.
  242.  
  243.    [Bell95] and [Bell96] describe a cut and paste splicing attack which
  244.    applies to all Cipher Block Chaining algorithms. This attack can be
  245.    addressed with the use of an authentication mechanism.
  246.  
  247.    The use of the cipher mechanism without any corresponding
  248.    authentication mechanism is strongly discouraged. This cipher can be
  249.    used in an ESP transform that also includes authentication; it can
  250.    also be used in an ESP transform that doesn't include authentication
  251.    provided there is an companion AH header. Refer to [ESP], [AH],
  252.    [arch], and [road] for more details.
  253.  
  254.    When the default ESP padding is used, the padding bytes have a
  255.    predictable value.  They provide a small measure of tamper detection
  256.    on their own block and the previous block in CBC mode.  This makes it
  257.    somewhat harder to perform splicing attacks, and avoids a possible
  258.    covert channel.  This small amount of known plaintext does not create
  259.    any problems for modern ciphers.
  260.  
  261.    At the time of writing of this document, [BS93] demonstrated a
  262.    differential cryptanalysis based chosen-plaintext attack requiring
  263.    2^47 plaintext-ciphertext pairs, where the size of a pair is the size
  264.    of a DES block (64 bits). [Matsui94] demonstrated a linear
  265.    cryptanalysis based known-plaintext attack requiring only 2^43
  266.    plaintext-ciphertext pairs.  Although these attacks are not
  267.    considered practical, they must be taken into account.
  268.  
  269.    More disturbingly, [Wiener94] has shown the design of a DES cracking
  270.    machine costing $1 Million that can crack one key every 3.5 hours.
  271.    This is an extremely practical attack.
  272.  
  273.    One or two blocks of known plaintext suffice to recover a DES key.
  274.    Because IP datagrams typically begin with a block of known and/or
  275.    guessable header text, frequent key changes will not protect against
  276.    this attack.
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Madson & Doraswamy          Standards Track                     [Page 5]
  283.  
  284. RFC 2405            The ESP DES-CBC Cipher Algorithm       November 1998
  285.  
  286.  
  287.    It is suggested that DES is not a good encryption algorithm for the
  288.    protection of even moderate value information in the face of such
  289.    equipment.  Triple DES is probably a better choice for such purposes.
  290.  
  291.    However, despite these potential risks, the level of privacy provided
  292.    by use of ESP DES-CBC in the Internet environment is far greater than
  293.    sending the datagram as cleartext.
  294.  
  295.    The case for using random values for IVs has been refined with the
  296.    following summary provided by Steve Bellovin. Refer to [Bell97] for
  297.    further information.
  298.  
  299.       "The problem arises if you use a counter as an IV, or some other
  300.       source with a low Hamming distance between successive IVs, for
  301.       encryption in CBC mode.  In CBC mode, the "effective plaintext"
  302.       for an encryption is the XOR of the actual plaintext and the
  303.       ciphertext of the preceeding block.  Normally, that's a random
  304.       value, which means that the effective plaintext is quite random.
  305.       That's good, because many blocks of actual plaintext don't change
  306.       very much from packet to packet, either.
  307.  
  308.       For the first block of plaintext, though, the IV takes the place
  309.       of the previous block of ciphertext.  If the IV doesn't differ
  310.       much from the previous IV, and the actual plaintext block doesn't
  311.       differ much from the previous packet's, then the effective
  312.       plaintext won't differ much, either.  This means that you have
  313.       pairs of ciphertext blocks combined with plaintext blocks that
  314.       differ in just a few bit positions.  This can be a wedge for
  315.       assorted cryptanalytic attacks."
  316.  
  317.    The discussion on IVs has been updated to require that an
  318.    implementation not use a low-Hamming distance source for IVs.
  319.  
  320. 7. References
  321.  
  322.    [Bell95]     Bellovin, S., "An Issue With DES-CBC When Used Without
  323.                 Strong Integrity", Presentation at the 32nd Internet
  324.                 Engineering Task Force, Danvers Massachusetts, April
  325.                 1995.
  326.  
  327.    [Bell96]     Bellovin, S., "Problem Areas for the IP Security
  328.                 Protocols", Proceedings of the Sixth Usenix Security
  329.                 Symposium, July 1996.
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Madson & Doraswamy          Standards Track                     [Page 6]
  339.  
  340. RFC 2405            The ESP DES-CBC Cipher Algorithm       November 1998
  341.  
  342.  
  343.    [Bell97]     Bellovin, S., "Probable Plaintext Cryptanalysis of the
  344.                 IP Security Protocols", Proceedings of the Symposium on
  345.                 Network and Distributed System Security, San Diego, CA,
  346.                 pp. 155-160, February 1997 (also
  347.                 http://www.research.att.com/~smb/papers/probtxt.{ps,
  348.                 pdf}).
  349.  
  350.    [BS93]       Biham, E., and A. Shamir, "Differential Cryptanalysis of
  351.                 the Data Encryption Standard", Berlin: Springer-Verlag,
  352.                 1993.
  353.  
  354.    [Blaze96]    Blaze, M., Diffie, W., Rivest, R., Schneier, B.,
  355.                 Shimomura, T., Thompson, E., and M. Wiener, "Minimal Key
  356.                 Lengths for Symmetric Ciphers to Provide Adequate
  357.                 Commercial Security", currently available at
  358.                 http://www.bsa.org/policy/encryption/cryptographers.html.
  359.  
  360.    [CN94]       Carroll, J.M., and S. Nudiati, "On Weak Keys and Weak
  361.                 Data:  Foiling the Two Nemeses", Cryptologia, Vol. 18
  362.                 No. 23 pp.  253-280, July 1994.
  363.  
  364.    [FIPS-46-2]  US National Bureau of Standards, "Data Encryption
  365.                 Standard", Federal Information Processing Standard
  366.                 (FIPS) Publication 46-2, December 1993,
  367.                 http://www.itl.nist.gov/div897/pubs/fip46-2.htm
  368.                 (supercedes FIPS-46-1).
  369.  
  370.    [FIPS-74]    US National Bureau of Standards, "Guidelines for
  371.                 Implementing and Using the Data Encryption Standard",
  372.                 Federal Information Processing Standard (FIPS)
  373.                 Publication 74, April 1981,
  374.                 http://www.itl.nist.gov/div897/pubs/fip74.htm.
  375.  
  376.    [FIPS-81]    US National Bureau of Standards, "DES Modes of
  377.                 Operation", Federal Information Processing Standard
  378.                 (FIPS) Publication 81, December 1980,
  379.                 http://www.itl.nist.gov/div897/pubs/fip81.htm.
  380.  
  381.    [Matsui94]   Matsui, M., "Linear Cryptanalysis method for DES
  382.                 Cipher", Advances in Cryptology -- Eurocrypt '93
  383.                 Proceedings, Berlin:  Springer-Verlag, 1994.
  384.  
  385.    [RFC-1750]   Eastlake, D., Crocker, S., and J. Schiller, "Randomness
  386.                 Recommendations for Security", RFC 1750, December 1994.
  387.  
  388.    [RFC-2119]   Bradner, S., "Key words for use in RFCs to Indicate
  389.                 Requirement Levels", BCP 14, RFC 2119, March 1997.
  390.  
  391.  
  392.  
  393.  
  394. Madson & Doraswamy          Standards Track                     [Page 7]
  395.  
  396. RFC 2405            The ESP DES-CBC Cipher Algorithm       November 1998
  397.  
  398.  
  399.    [Schneier96] Schneier, B., "Applied Cryptography Second Edition",
  400.                 John Wiley & Sons, New York, NY, 1996.  ISBN 0-471-
  401.                 12845-7.
  402.  
  403.    [Wiener94]   Wiener, M.J., "Efficient DES Key Search", School of
  404.                 Computer Science, Carleton University, Ottawa, Canada,
  405.                 TR-244, May 1994.  Presented at the Rump Session of
  406.                 Crypto '93. [Reprinted in "Practical Cryptography for
  407.                 Data Internetworks", W.Stallings, editor, IEEE Computer
  408.                 Society Press, pp.31-79 (1996).  Currently available at
  409.                 ftp://ripem.msu.edu/pub/crypt/docs/des-key-search.ps.]
  410.  
  411.    [ESP]        Kent, S., and R. Atkinson, "IP Encapsulating Security
  412.                 Payload (ESP)", RFC 2406, November 1998.
  413.  
  414.    [AH]         Kent, S., and R. Atkinson, "IP Authentication Header
  415.                 (AH)", RFC 2402, November 1998.
  416.  
  417.    [arch]       Kent, S., and R. Atkinson, "Security Architecture for
  418.                 the Internet Protocol", RFC 2401, November 1998.
  419.  
  420.    [road]       Thayer, R., Doraswamy, N., and R. Glenn, "IP Security
  421.                 Document Roadmap", RFC 2411, November 1998.
  422.  
  423. 8. Acknowledgments
  424.  
  425.    Much of the information provided here originated with various ESP-DES
  426.    documents authored by Perry Metzger and William Allen Simpson,
  427.    especially the Security Considerations section.
  428.  
  429.    This document is also derived in part from previous works by Jim
  430.    Hughes, those people that worked with Jim on the combined DES-
  431.    CBC+HMAC-MD5 ESP transforms, the ANX bakeoff participants, and the
  432.    members of the IPsec working group.
  433.  
  434.    Thanks to Rob Glenn for assisting with the nroff formatting.
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. Madson & Doraswamy          Standards Track                     [Page 8]
  451.  
  452. RFC 2405            The ESP DES-CBC Cipher Algorithm       November 1998
  453.  
  454.  
  455.    The IPSec working group can be contacted via the IPSec working
  456.    group's mailing list (ipsec@tis.com) or through its chairs:
  457.  
  458.      Robert Moskowitz
  459.      International Computer Security Association
  460.  
  461.      EMail: rgm@icsa.net
  462.  
  463.  
  464.      Theodore Y. Ts'o
  465.      Massachusetts Institute of Technology
  466.  
  467.      EMail: tytso@MIT.EDU
  468.  
  469.  
  470. 9. Editors' Addresses
  471.  
  472.    Cheryl Madson
  473.    Cisco Systems, Inc.
  474.  
  475.    EMail: cmadson@cisco.com
  476.  
  477.  
  478.    Naganand Doraswamy
  479.    Bay Networks, Inc.
  480.  
  481.    EMail: naganand@baynetworks.com
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506. Madson & Doraswamy          Standards Track                     [Page 9]
  507.  
  508. RFC 2405            The ESP DES-CBC Cipher Algorithm       November 1998
  509.  
  510.  
  511. 10.  Full Copyright Statement
  512.  
  513.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  514.  
  515.    This document and translations of it may be copied and furnished to
  516.    others, and derivative works that comment on or otherwise explain it
  517.    or assist in its implementation may be prepared, copied, published
  518.    and distributed, in whole or in part, without restriction of any
  519.    kind, provided that the above copyright notice and this paragraph are
  520.    included on all such copies and derivative works.  However, this
  521.    document itself may not be modified in any way, such as by removing
  522.    the copyright notice or references to the Internet Society or other
  523.    Internet organizations, except as needed for the purpose of
  524.    developing Internet standards in which case the procedures for
  525.    copyrights defined in the Internet Standards process must be
  526.    followed, or as required to translate it into languages other than
  527.    English.
  528.  
  529.    The limited permissions granted above are perpetual and will not be
  530.    revoked by the Internet Society or its successors or assigns.
  531.  
  532.    This document and the information contained herein is provided on an
  533.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  534.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  535.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  536.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  537.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562. Madson & Doraswamy          Standards Track                    [Page 10]
  563.  
  564.