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

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          C. Madson
  8. Request for Comments: 2403                            Cisco Systems Inc.
  9. Category: Standards Track                                       R. Glenn
  10.                                                                     NIST
  11.                                                            November 1998
  12.  
  13.  
  14.                 The Use of HMAC-MD5-96 within ESP and AH
  15.  
  16. Status of this Memo
  17.  
  18.    This document specifies an Internet standards track protocol for the
  19.    Internet community, and requests discussion and suggestions for
  20.    improvements.  Please refer to the current edition of the "Internet
  21.    Official Protocol Standards" (STD 1) for the standardization state
  22.    and status of this protocol.  Distribution of this memo is unlimited.
  23.  
  24. Copyright Notice
  25.  
  26.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  27.  
  28. Abstract
  29.  
  30.    This memo describes the use of the HMAC algorithm [RFC-2104] in
  31.    conjunction with the MD5 algorithm [RFC-1321] as an authentication
  32.    mechanism within the revised IPSEC Encapsulating Security Payload
  33.    [ESP] and the revised IPSEC Authentication Header [AH]. HMAC with MD5
  34.    provides data origin authentication and integrity protection.
  35.  
  36.    Further information on the other components necessary for ESP and AH
  37.    implementations is provided by [Thayer97a].
  38.  
  39. 1.  Introduction
  40.  
  41.    This memo specifies the use of MD5 [RFC-1321] combined with HMAC
  42.    [RFC-2104] as a keyed authentication mechanism within the context of
  43.    the Encapsulating Security Payload and the Authentication Header.
  44.    The goal of HMAC-MD5-96 is to ensure that the packet is authentic and
  45.    cannot be modified in transit.
  46.  
  47.    HMAC is a secret key authentication algorithm. Data integrity and
  48.    data origin authentication as provided by HMAC are dependent upon the
  49.    scope of the distribution of the secret key. If only the source and
  50.    destination know the HMAC key, this provides both data origin
  51.    authentication and data integrity for packets sent between the two
  52.    parties; if the HMAC is correct, this proves that it must have been
  53.    added by the source.
  54.  
  55.  
  56.  
  57.  
  58. Madson & Glenn              Standards Track                     [Page 1]
  59.  
  60. RFC 2403        The Use of HMAC-MD5-96 within ESP and AH   November 1998
  61.  
  62.  
  63.    In this memo, HMAC-MD5-96 is used within the context of ESP and AH.
  64.    For further information on how the various pieces of ESP - including
  65.    the confidentiality mechanism -- fit together to provide security
  66.    services, refer to [ESP] and [Thayer97a]. For further information on
  67.    AH, refer to [AH] and [Thayer97a].
  68.  
  69.    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  70.    "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this
  71.    document are to be interpreted as described in [RFC-2119].
  72.  
  73. 2. Algorithm and Mode
  74.  
  75.    [RFC-1321] describes the underlying MD5 algorithm, while [RFC-2104]
  76.    describes the HMAC algorithm. The HMAC algorithm provides a framework
  77.    for inserting various hashing algorithms such as MD5.
  78.  
  79.    HMAC-MD5-96 operates on 64-byte blocks of data.  Padding requirements
  80.    are specified in [RFC-1321] and are part of the MD5 algorithm.  If
  81.    MD5 is built according to [RFC-1321], there is no need to add any
  82.    additional padding as far as HMAC-MD5-96 is concerned.  With regard
  83.    to "implicit packet padding" as defined in [AH], no implicit packet
  84.    padding is required.
  85.  
  86.    HMAC-MD5-96 produces a 128-bit authenticator value.  This 128-bit
  87.    value can be truncated as described in RFC 2104.  For use with either
  88.    ESP or AH, a truncated value using the first 96 bits MUST be
  89.    supported.  Upon sending, the truncated value is stored within the
  90.    authenticator field.  Upon receipt, the entire 128-bit value is
  91.    computed and the first 96 bits are compared to the value stored in
  92.    the authenticator field.  No other authenticator value lengths are
  93.    supported by HMAC-MD5-96.
  94.  
  95.    The length of 96 bits was selected because it is the default
  96.    authenticator length as specified in [AH] and meets the security
  97.    requirements described in [RFC-2104].
  98.  
  99. 2.1  Performance
  100.  
  101.    [Bellare96a] states that "(HMAC) performance is essentially that of
  102.    the underlying hash function".  [RFC-1810] provides some performance
  103.    analysis and recommendations of the use of MD5 with Internet
  104.    protocols.  As of this writing no performance analysis has been done
  105.    of HMAC or HMAC combined with MD5.
  106.  
  107.    [RFC-2104] outlines an implementation modification which can improve
  108.    per-packet performance without affecting interoperability.
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Madson & Glenn              Standards Track                     [Page 2]
  115.  
  116. RFC 2403        The Use of HMAC-MD5-96 within ESP and AH   November 1998
  117.  
  118.  
  119. 3. Keying Material
  120.  
  121.    HMAC-MD5-96 is a secret key algorithm. While no fixed key length is
  122.    specified in [RFC-2104], for use with either ESP or AH a fixed key
  123.    length of 128-bits MUST be supported.  Key lengths other than 128-
  124.    bits MUST NOT be supported (i.e. only 128-bit keys are to be used by
  125.    HMAC-MD5-96).  A key length of 128-bits was chosen based on the
  126.    recommendations in [RFC-2104] (i.e. key lengths less than the
  127.    authenticator length decrease security strength and keys longer than
  128.    the authenticator length do not significantly increase security
  129.    strength).
  130.  
  131.    [RFC-2104] discusses requirements for key material, which includes a
  132.    discussion on requirements for strong randomness.  A strong pseudo-
  133.    random function MUST be used to generate the required 128-bit key.
  134.  
  135.    At the time of this writing there are no specified weak keys for use
  136.    with HMAC.  This does not mean to imply that weak keys do not exist.
  137.    If, at some point, a set of weak keys for HMAC are identified, the
  138.    use of these weak keys must be rejected followed by a request for
  139.    replacement keys or a newly negotiated Security Association.
  140.  
  141.    [ARCH] describes the general mechanism for obtaining keying material
  142.    when multiple keys are required for a single SA (e.g. when an ESP SA
  143.    requires a key for confidentiality and a key for authentication).
  144.  
  145.    In order to provide data origin authentication, the key distribution
  146.    mechanism must ensure that unique keys are allocated and that they
  147.    are distributed only to the parties participating in the
  148.    communication.
  149.  
  150.    [RFC-2104] makes the following recommendation with regard to
  151.    rekeying.  Current attacks do not indicate a specific recommended
  152.    frequency for key changes as these attacks are practically
  153.    infeasible.  However, periodic key refreshment is a fundamental
  154.    security practice that helps against potential weaknesses of the
  155.    function and keys, reduces the information avaliable to a
  156.    cryptanalyst, and limits the damage of an exposed key.
  157.  
  158. 4.  Interaction with the ESP Cipher Mechanism
  159.  
  160.    As of this writing, there are no known issues which preclude the use
  161.    of the HMAC-MD5-96 algorithm with any specific cipher algorithm.
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Madson & Glenn              Standards Track                     [Page 3]
  171.  
  172. RFC 2403        The Use of HMAC-MD5-96 within ESP and AH   November 1998
  173.  
  174.  
  175. 5.  Security Considerations
  176.  
  177.    The security provided by HMAC-MD5-96 is based upon the strength of
  178.    HMAC, and to a lesser degree, the strength of MD5. [RFC-2104] claims
  179.    that HMAC does not depend upon the property of strong collision
  180.    resistance, which is important to consider when evaluating the use of
  181.    MD5, an algorithm which has, under recent scrutiny, been shown to be
  182.    much less collision-resistant than was first thought. At the time of
  183.    this writing there are no practical cryptographic attacks against
  184.    HMAC-MD5-96.
  185.  
  186.    [RFC-2104] states that for "minimally reasonable hash functions" the
  187.    "birthday attack", the strongest attack know against HMAC, is
  188.    impractical. For a 64-byte block hash such as HMAC-MD5-96, an attack
  189.    involving the successful processing of 2**64 blocks would be
  190.    infeasible unless it were discovered that the underlying hash had
  191.    collisions after processing 2**30 blocks. A hash with such weak
  192.    collision-resistance characteristics would generally be considered to
  193.    be unusable.
  194.  
  195.    It is also important to consider that while MD5 was never developed
  196.    to be used as a keyed hash algorithm, HMAC had that criteria from the
  197.    onset. While the use of MD5 in the context of data security is
  198.    undergoing reevaluation, the combined HMAC with MD5 algorithm has
  199.    held up to cryptographic scrutiny.
  200.  
  201.    [RFC-2104] also discusses the potential additional security which is
  202.    provided by the truncation of the resulting hash. Specifications
  203.    which include HMAC are strongly encouraged to perform this hash
  204.    truncation.
  205.  
  206.    As [RFC-2104] provides a framework for incorporating various hash
  207.    algorithms with HMAC, it is possible to replace MD5 with other
  208.    algorithms such as SHA-1. [RFC-2104] contains a detailed discussion
  209.    on the strengths and weaknesses of HMAC algorithms.
  210.  
  211.    As is true with any cryptographic algorithm, part of its strength
  212.    lies in the correctness of the algorithm implementation, the security
  213.    of the key management mechanism and its implementation, the strength
  214.    of the associated secret key, and upon the correctness of the
  215.    implementation in all of the participating systems.  [RFC-2202]
  216.    contains test vectors and example code to assist in verifying the
  217.    correctness of HMAC-MD5-96 code.
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Madson & Glenn              Standards Track                     [Page 4]
  227.  
  228. RFC 2403        The Use of HMAC-MD5-96 within ESP and AH   November 1998
  229.  
  230.  
  231. 6.  Acknowledgments
  232.  
  233.    This document is derived in part from previous works by Jim Hughes,
  234.    those people that worked with Jim on the combined DES/CBC+HMAC-MD5
  235.    ESP transforms, the ANX bakeoff participants, and the members of the
  236.    IPsec working group.
  237.  
  238.    We would also like to thank Hugo Krawczyk for his comments and
  239.    recommendations regarding some of the cryptographic specific text in
  240.    this document.
  241.  
  242. 7.  References
  243.  
  244.    [RFC-1321]   Rivest, R., "MD5 Digest Algorithm", RFC 1321, April
  245.                 1992.
  246.  
  247.    [RFC-2104]   Krawczyk, H., Bellare, M., and R. Canetti, "HMAC:
  248.                 Keyed-Hashing for Message Authentication", RFC 2104,
  249.                 February 1997.
  250.  
  251.    [RFC-1810]   Touch, J., "Report on MD5 Performance", RFC 1810, June
  252.                 1995.
  253.  
  254.    [Bellare96a] Bellare, M., Canetti, R., and H. Krawczyk, "Keying Hash
  255.                 Functions for Message Authentication", Advances in
  256.                 Cryptography, Crypto96 Proceeding, June 1996.
  257.  
  258.    [ARCH]       Kent, S., and R. Atkinson, "Security Architecture for
  259.                 the Internet Protocol", RFC 2401, November 1998.
  260.  
  261.    [ESP]        Kent, S., and R. Atkinson, "IP Encapsulating Security
  262.                 Payload", RFC 2406, November 1998.
  263.  
  264.    [AH]         Kent, S., and R. Atkinson, "IP Authentication Header",
  265.                 RFC 2402, November 1998.
  266.  
  267.    [Thayer97a]  Thayer, R., Doraswamy, N., and R. Glenn, "IP Security
  268.                 Document Roadmap", RFC 2411, November 1998.
  269.  
  270.    [RFC-2202]   Cheng, P., and R. Glenn, "Test Cases for HMAC-MD5 and
  271.                 HMAC-SHA-1", RFC 2202, March 1997.
  272.  
  273.    [RFC-2119]   Bradner, S., "Key words for use in RFCs to Indicate
  274.                 Requirement Levels", BCP 14, RFC 2119, March 1997.
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Madson & Glenn              Standards Track                     [Page 5]
  283.  
  284. RFC 2403        The Use of HMAC-MD5-96 within ESP and AH   November 1998
  285.  
  286.  
  287. 8.  Editors' Address
  288.  
  289.    Cheryl Madson
  290.    Cisco Systems, Inc.
  291.  
  292.    EMail: cmadson@cisco.com
  293.  
  294.  
  295.    Rob Glenn
  296.    NIST
  297.  
  298.    EMail: <rob.glenn@nist.gov>
  299.  
  300.  The IPsec working group can be contacted through the chairs:
  301.  
  302.    Robert Moskowitz
  303.    ICSA
  304.  
  305.    EMail: rgm@icsa.net
  306.  
  307.  
  308.    Ted T'so
  309.    Massachusetts Institute of Technology
  310.  
  311.    EMail: tytso@mit.edu
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Madson & Glenn              Standards Track                     [Page 6]
  339.  
  340. RFC 2403        The Use of HMAC-MD5-96 within ESP and AH   November 1998
  341.  
  342.  
  343. 9.  Full Copyright Statement
  344.  
  345.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  346.  
  347.    This document and translations of it may be copied and furnished to
  348.    others, and derivative works that comment on or otherwise explain it
  349.    or assist in its implementation may be prepared, copied, published
  350.    and distributed, in whole or in part, without restriction of any
  351.    kind, provided that the above copyright notice and this paragraph are
  352.    included on all such copies and derivative works.  However, this
  353.    document itself may not be modified in any way, such as by removing
  354.    the copyright notice or references to the Internet Society or other
  355.    Internet organizations, except as needed for the purpose of
  356.    developing Internet standards in which case the procedures for
  357.    copyrights defined in the Internet Standards process must be
  358.    followed, or as required to translate it into languages other than
  359.    English.
  360.  
  361.    The limited permissions granted above are perpetual and will not be
  362.    revoked by the Internet Society or its successors or assigns.
  363.  
  364.    This document and the information contained herein is provided on an
  365.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  366.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  367.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  368.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  369.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Madson & Glenn              Standards Track                     [Page 7]
  395.  
  396.