8573
PROPOSED STANDARD

Message Authentication Code for the Network Time Protocol

Authors: A. Malhotra, S. Goldberg
Date: June 2019
Area: int
Working Group: ntp
Stream: IETF
Updates: RFC 5905
Updated by: RFC 9748

Abstract

The Network Time Protocol (NTP), as described in RFC 5905, states that NTP packets should be authenticated by appending NTP data to a 128-bit key and hashing the result with MD5 to obtain a 128-bit tag. This document deprecates MD5-based authentication, which is considered too weak, and recommends the use of AES-CMAC as described in RFC 4493 as a replacement.

RFC 8573: Message Authentication Code for the Network Time Protocol [RFC Home] [TEXT|PDF|HTML] [Tracker] [IPR] [Info page]

PROPOSED STANDARD
Updated by: 9748
Internet Engineering Task Force (IETF)                       A. Malhotra
Request for Comments: 8573                                   S. Goldberg
Updates: <a href="./rfc5905">5905</a>                                          Boston University
Category: Standards Track                                      June 2019
ISSN: 2070-1721


       <span class="h1">Message Authentication Code for the Network Time Protocol</span>

Abstract

   The Network Time Protocol (NTP), as described in <a href="./rfc5905">RFC 5905</a>, states
   that NTP packets should be authenticated by appending NTP data to a
   128-bit key and hashing the result with MD5 to obtain a 128-bit tag.
   This document deprecates MD5-based authentication, which is
   considered too weak, and recommends the use of AES-CMAC as described
   in <a href="./rfc4493">RFC 4493</a> as a replacement.

Status of This Memo

   This is an Internet Standards Track document.

   This document is a product of the Internet Engineering Task Force
   (IETF).  It represents the consensus of the IETF community.  It has
   received public review and has been approved for publication by the
   Internet Engineering Steering Group (IESG).  Further information on
   Internet Standards is available in <a href="./rfc7841#section-2">Section 2 of RFC 7841</a>.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   <a href="https://www.rfc-editor.org/info/rfc8573">https://www.rfc-editor.org/info/rfc8573</a>.

Copyright Notice

   Copyright (c) 2019 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (<a href="https://trustee.ietf.org/license-info">https://trustee.ietf.org/license-info</a>) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.





<span class="grey">Malhotra & Goldberg          Standards Track                    [Page 1]</span>

<span id="page-2" ></span>
<span class="grey"><a href="./rfc8573">RFC 8573</a>                       MAC for NTP                     June 2019</span>


Table of Contents

   <a href="#section-1">1</a>.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   <a href="#page-2">2</a>
     <a href="#section-1.1">1.1</a>.  Requirements Language . . . . . . . . . . . . . . . . . .   <a href="#page-2">2</a>
   <a href="#section-2">2</a>.  Deprecating the Use of MD5  . . . . . . . . . . . . . . . . .   <a href="#page-2">2</a>
   <a href="#section-3">3</a>.  Replacement Recommendation  . . . . . . . . . . . . . . . . .   <a href="#page-2">2</a>
   <a href="#section-4">4</a>.  Motivation  . . . . . . . . . . . . . . . . . . . . . . . . .   <a href="#page-3">3</a>
   <a href="#section-5">5</a>.  Test Vectors  . . . . . . . . . . . . . . . . . . . . . . . .   <a href="#page-3">3</a>
   <a href="#section-6">6</a>.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   <a href="#page-3">3</a>
   <a href="#section-7">7</a>.  Security Considerations . . . . . . . . . . . . . . . . . . .   <a href="#page-3">3</a>
   <a href="#section-8">8</a>.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   <a href="#page-4">4</a>
     <a href="#section-8.1">8.1</a>.  Normative References  . . . . . . . . . . . . . . . . . .   <a href="#page-4">4</a>
     <a href="#section-8.2">8.2</a>.  Informative References  . . . . . . . . . . . . . . . . .   <a href="#page-4">4</a>
   Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . .  <a href="#page-5">5</a>
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .   <a href="#page-5">5</a>

<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>.  Introduction</span>

   The Network Time Protocol [<a href="./rfc5905" title=""Network Time Protocol Version 4: Protocol and Algorithms Specification"">RFC5905</a>] states that NTP packets should be
   authenticated by appending NTP data to a 128-bit key and hashing the
   result with MD5 to obtain a 128-bit tag.  This document deprecates
   MD5-based authentication, which is considered too weak, and
   recommends the use of AES-CMAC [<a href="./rfc4493" title=""The AES-CMAC Algorithm"">RFC4493</a>] as a replacement.

<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>.  Requirements Language</span>

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a> [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>] [<a href="./rfc8174" title=""Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"">RFC8174</a>] when, and only when, they appear in all
   capitals, as shown here.

<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>.  Deprecating the Use of MD5</span>

   <a href="./rfc5905">RFC 5905</a> [<a href="./rfc5905" title=""Network Time Protocol Version 4: Protocol and Algorithms Specification"">RFC5905</a>] defines how the MD5 digest algorithm described in
   <a href="./rfc1321">RFC 1321</a> [<a href="./rfc1321" title=""The MD5 Message-Digest Algorithm"">RFC1321</a>] can be used as a Message Authentication Code (MAC)
   for authenticating NTP packets.  However, as discussed in [<a href="#ref-BCK" title=""Keying Hash Functions and Message Authentication"">BCK</a>] and
   <a href="./rfc6151">RFC 6151</a> [<a href="./rfc6151" title=""Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms"">RFC6151</a>], this is not a secure MAC and therefore MUST be
   deprecated.

<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>.  Replacement Recommendation</span>

   If NTP authentication is implemented, then AES-CMAC as specified in
   <a href="./rfc4493">RFC 4493</a> [<a href="./rfc4493" title=""The AES-CMAC Algorithm"">RFC4493</a>] MUST be computed over all fields in the NTP header
   and any extension fields that are present in the NTP packet as
   described in <a href="./rfc5905">RFC 5905</a> [<a href="./rfc5905" title=""Network Time Protocol Version 4: Protocol and Algorithms Specification"">RFC5905</a>].  The MAC key for NTP MUST be an
   AES-128 key that is 128 bits in length, and the resulting MAC tag




<span class="grey">Malhotra & Goldberg          Standards Track                    [Page 2]</span>

<span id="page-3" ></span>
<span class="grey"><a href="./rfc8573">RFC 8573</a>                       MAC for NTP                     June 2019</span>


   MUST be at least 128 bits in length, as stated in Section 2.4 of <a href="./rfc4493">RFC</a>
   <a href="./rfc4493">4493</a> [<a href="./rfc4493" title=""The AES-CMAC Algorithm"">RFC4493</a>].  NTP makes this transition possible as it supports
   algorithm agility as described in <a href="./rfc7696#section-2.1">Section 2.1 of RFC 7696</a> [<a href="./rfc7696" title=""Guidelines for Cryptographic Algorithm Agility and Selecting Mandatory-to-Implement Algorithms"">RFC7696</a>].

   The hosts that wish to use NTP authentication share a symmetric key
   out of band.  So they MUST implement AES-CMAC and share the
   corresponding symmetric key.  A symmetric key is a triplet of ID,
   type (e.g., MD5 and AES-CMAC) and the key itself.  All three have to
   match in order to successfully authenticate packets between two
   hosts.  Old implementations that don't support AES-CMAC will not
   accept and will not send packets authenticated with such a key.

<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>.  Motivation</span>

   AES-CMAC is recommended for the following reasons:

   1.  It is an IETF specification that is supported in many open source
       implementations.

   2.  It is immune to nonce-reuse vulnerabilities (e.g., [<a href="#ref-Joux" title=""Authentication Failures in NIST version of GCM"">Joux</a>])
       because it does not use a nonce.

   3.  It has fine performance in terms of latency and throughput.

   4.  It benefits from native hardware support, for instance, Intel's
       New Instruction set GUE [<a href="#ref-GUE" title=""Intel Advanced Encryption Standard (AES) New Instructions Set"">GUE</a>].

<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>.  Test Vectors</span>

   For test vectors and their outputs, refer to <a href="./rfc4493#section-4">Section 4 of RFC 4493</a>
   [<a href="./rfc4493" title=""The AES-CMAC Algorithm"">RFC4493</a>].

<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>.  IANA Considerations</span>

   This document has no IANA actions.

<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>.  Security Considerations</span>

   Refer to Appendices A, B, and C of the NIST document [<a href="#ref-NIST" title=""Recommendation for Block Cipher Modes of Operation: The CMAC Mode for Authentication"">NIST</a>] for a
   recommendation for the CMAC mode of authentication; see the Security
   Considerations of <a href="./rfc4493">RFC 4493</a> [<a href="./rfc4493" title=""The AES-CMAC Algorithm"">RFC4493</a>] for discussion on security
   guarantees of AES-CMAC.









<span class="grey">Malhotra & Goldberg          Standards Track                    [Page 3]</span>

<span id="page-4" ></span>
<span class="grey"><a href="./rfc8573">RFC 8573</a>                       MAC for NTP                     June 2019</span>


<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>.  References</span>

<span class="h3"><a class="selflink" id="section-8.1" href="#section-8.1">8.1</a>.  Normative References</span>

   [<a id="ref-NIST">NIST</a>]     Dworkin, M., "Recommendation for Block Cipher Modes of
              Operation: The CMAC Mode for Authentication", NIST Special
              Publication 800-38B, DOI 10.6028/NIST.SP.800-38B, October
              2016, <<a href="https://www.nist.gov/publications/recommendation-block-cipher-modes-operation-cmac-mode-authentication-0">https://www.nist.gov/publications/recommendation-</a>
              <a href="https://www.nist.gov/publications/recommendation-block-cipher-modes-operation-cmac-mode-authentication-0">block-cipher-modes-operation-cmac-mode-authentication-0</a>>.

   [<a id="ref-RFC2119">RFC2119</a>]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>,
              DOI 10.17487/RFC2119, March 1997,
              <<a href="https://www.rfc-editor.org/info/rfc2119">https://www.rfc-editor.org/info/rfc2119</a>>.

   [<a id="ref-RFC4493">RFC4493</a>]  Song, JH., Poovendran, R., Lee, J., and T. Iwata, "The
              AES-CMAC Algorithm", <a href="./rfc4493">RFC 4493</a>, DOI 10.17487/RFC4493, June
              2006, <<a href="https://www.rfc-editor.org/info/rfc4493">https://www.rfc-editor.org/info/rfc4493</a>>.

   [<a id="ref-RFC5905">RFC5905</a>]  Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch,
              "Network Time Protocol Version 4: Protocol and Algorithms
              Specification", <a href="./rfc5905">RFC 5905</a>, DOI 10.17487/RFC5905, June 2010,
              <<a href="https://www.rfc-editor.org/info/rfc5905">https://www.rfc-editor.org/info/rfc5905</a>>.

   [<a id="ref-RFC8174">RFC8174</a>]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in <a href="./rfc2119">RFC</a>
              <a href="./rfc2119">2119</a> Key Words", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc8174">RFC 8174</a>, DOI 10.17487/RFC8174,
              May 2017, <<a href="https://www.rfc-editor.org/info/rfc8174">https://www.rfc-editor.org/info/rfc8174</a>>.

<span class="h3"><a class="selflink" id="section-8.2" href="#section-8.2">8.2</a>.  Informative References</span>

   [<a id="ref-BCK">BCK</a>]      Bellare, M., Canetti, R., and H. Krawczyk, "Keying Hash
              Functions and Message Authentication", Advances in
              Cryptology - Crypto 96 Proceedings, Lecture Notes in
              Computer Science, Vol. 1109, N. Koblitz ed, Springer-
              Verlag, 1996.

   [<a id="ref-GUE">GUE</a>]      Geuron, S., "Intel Advanced Encryption Standard (AES) New
              Instructions Set", May 2010,
              <<a href="https://www.intel.com/content/dam/doc/white-paper/advanced-encryption-standard-new-instructions-set-paper.pdf">https://www.intel.com/content/dam/doc/white-paper/</a>
              <a href="https://www.intel.com/content/dam/doc/white-paper/advanced-encryption-standard-new-instructions-set-paper.pdf">advanced-encryption-standard-new-instructions-set-</a>
              <a href="https://www.intel.com/content/dam/doc/white-paper/advanced-encryption-standard-new-instructions-set-paper.pdf">paper.pdf</a>>.

   [<a id="ref-Joux">Joux</a>]     Joux, A., "Authentication Failures in NIST version of
              GCM",
              <<a href="http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/comments/800-38_Series-Drafts/GCM/Joux_comments.pdf">http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/</a>
              <a href="http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/comments/800-38_Series-Drafts/GCM/Joux_comments.pdf">comments/800-38_Series-Drafts/GCM/Joux_comments.pdf</a>>.





<span class="grey">Malhotra & Goldberg          Standards Track                    [Page 4]</span>

<span id="page-5" ></span>
<span class="grey"><a href="./rfc8573">RFC 8573</a>                       MAC for NTP                     June 2019</span>


   [<a id="ref-RFC1321">RFC1321</a>]  Rivest, R., "The MD5 Message-Digest Algorithm", <a href="./rfc1321">RFC 1321</a>,
              DOI 10.17487/RFC1321, April 1992,
              <<a href="https://www.rfc-editor.org/info/rfc1321">https://www.rfc-editor.org/info/rfc1321</a>>.

   [<a id="ref-RFC6151">RFC6151</a>]  Turner, S. and L. Chen, "Updated Security Considerations
              for the MD5 Message-Digest and the HMAC-MD5 Algorithms",
              <a href="./rfc6151">RFC 6151</a>, DOI 10.17487/RFC6151, March 2011,
              <<a href="https://www.rfc-editor.org/info/rfc6151">https://www.rfc-editor.org/info/rfc6151</a>>.

   [<a id="ref-RFC7696">RFC7696</a>]  Housley, R., "Guidelines for Cryptographic Algorithm
              Agility and Selecting Mandatory-to-Implement Algorithms",
              <a href="https://www.rfc-editor.org/bcp/bcp201">BCP 201</a>, <a href="./rfc7696">RFC 7696</a>, DOI 10.17487/RFC7696, November 2015,
              <<a href="https://www.rfc-editor.org/info/rfc7696">https://www.rfc-editor.org/info/rfc7696</a>>.

Acknowledgements

   The authors wish to acknowledge useful discussions with Leen
   Alshenibr, Daniel Franke, Ethan Heilman, Kenny Paterson, Leonid
   Reyzin, Harlan Stenn, and Mayank Varia.

Authors' Addresses

   Aanchal Malhotra
   Boston University
   111 Cummington St
   Boston, MA  02215
   United States of America

   Email: [email protected]


   Sharon Goldberg
   Boston University
   111 Cummington St
   Boston, MA  02215
   United States of America

   Email: [email protected]













Malhotra & Goldberg          Standards Track                    [Page 5]

Additional Resources