RFC 8750
Implicit Initialization Vector (IV) for Counter-Based Ciphers in Encapsulating Security Payload (ESP)
RFC 8750: Implicit IV for Counter-Based Ciphers in ESP π¦
okay bestie, RFC 8750 is giving main character energy β¨ It's a Standards Track document from March 2020, so it's an actual Internet standard and not just a suggestion π It was written by D. Migault (Ericsson), T. Guggemos (LMU Munich), and Y. Nir (Dell Technologies), and it's published under ISSN 2070-1721. It doesn't obsolete or update anything, so it stands alone πΈ
Abstract
okay so ESP (Encapsulating Security Payload) sends an initialization vector (IV) in every single packet π¦ The size depends on which transform you use, and for the transforms that existed when this was written it's usually 8 or 16 octets. When you're using IPsec, some algorithms, like AES-GCM, AES-CCM, and ChaCha20-Poly1305, use that IV to build a nonce, and the nonce is what goes into encrypting and decrypting. The IV has to be unique, but it's allowed to be predictable π§ That means you can use the ESP Sequence Number (SN) to build the nonce instead. Then you don't have to send the IV at all, which saves 8 octets per packet for AES-GCM, AES-CCM, and ChaCha20-Poly1305. This document explains how to do it π
Status of This Memo
this part is the boring legal bit, but it's still part of the spec so it stays π«Ά
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 Section 2 of RFC 7841.
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8750.
Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) 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.
Table of Contents
1. Introduction
2. Requirements Notation
3. Terminology
4. Implicit IV
5. IKEv2 Initiator Behavior
6. IKEv2 Responder Behavior
7. Security Considerations
8. IANA Considerations
9. References
9.1. Normative References
9.2. Informative References
Acknowledgements
Authors' Addresses
1. Introduction β¨
okay so counter-based AES modes like AES-CCM [RFC4309] and AES-GCM [RFC4106] need a nonce for every ESP packet π ChaCha20-Poly1305 [RFC7634] needs one too. Right now that nonce gets made from the IV that rides along in each ESP packet [RFC4303]. This document calls that approach "explicit IV" π
in some situations, like the Internet of Things (IoT), it can be better to skip carrying those extra bytes and just have each peer generate the IV locally π Generating it locally is what this document calls "implicit IV" π¦
The size of this IV depends on the specific algorithm, but every algorithm mentioned above takes an 8-octet IV π
This document defines how to compute the IV locally when it's implicit. It also covers how peers use the Internet Key Exchange version 2 (IKEv2) [RFC7296] to agree on implicit IV versus explicit IV π«Ά
The scope here is limited to the algorithms listed above. Other algorithms with similar properties may later be defined to use similar mechanisms π₯
This document does not consider AES-CBC [RFC3602], because AES-CBC needs the IV to be unpredictable π Deriving the IV straight from the packet counter, like described below, is insecure, as mentioned in Section 6 of [RFC3602]. It has led to real-world chosen plaintext attacks such as BEAST [BEAST] π
This document also does not consider AES-CTR [RFC3686], since it focuses on the recommended Authenticated Encryption with Associated Data (AEAD) suites provided in [RFC8221] π
2. Requirements Notation
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 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here π
3. Terminology π§
- IoT: Internet of Things
- IV: Initialization Vector
- IIV: Implicit Initialization Vector
- Nonce: A fixed-size octet string used only once. In this document, the IV is used to generate the nonce input for the encryption/decryption.
4. Implicit IV πΈ
okay this is the core of the whole thing π With the algorithms listed in Section 1, the 8-byte IV MUST NOT repeat for a given key π The binding between an ESP packet and its IV is provided using the Sequence Number or the Extended Sequence Number. Figures 1 and 2 show the IV with a regular 4-byte Sequence Number and an 8-byte Extended Sequence Number, respectively π
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Zero |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: Implicit IV with a 4-Byte Sequence Number
- Sequence Number: The 4-byte Sequence Number carried in the ESP packet.
- Zero: A 4-byte array with all bits set to zero.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Extended |
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2: Implicit IV with an 8-Byte Extended Sequence Number
- Extended Sequence Number: The 8-byte Extended Sequence Number of the Security Association. The four low-order bytes are carried in the ESP packet.
This document solely defines the IV generation of the algorithms defined in [RFC4106] for AES-GCM, [RFC4309] for AES-CCM, and [RFC7634] for ChaCha20-Poly1305. All other aspects and parameters of those algorithms are unchanged and are used as defined in their respective specifications π
5. IKEv2 Initiator Behavior π¦
okay so an initiator that supports this feature SHOULD propose implicit IV (IIV) algorithms in the Transform Type 1 (Encryption Algorithm) Substructure of the Proposal Substructure inside the Security Association (SA) payload in the IKEv2 Exchange β¨ To keep things backward compatible with peers that don't support it, the initiator SHOULD also include those same algorithms with explicit IV as separate transforms π«Ά
6. IKEv2 Responder Behavior π§
the SA payload processing rules require the responder to pick its algorithms from the proposal the initiator sent π That's what guarantees the responder will never send an SA payload containing the IIV transform to an initiator that didn't propose it π
part 2 picks up at Section 7 π
9.1. Normative References β¨
Okay bestie, these are the docs the spec leans on the hardest, so you need them in your back pocket π
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. - [RFC3602] Frankel, S., Glenn, R., and S. Kelly, "The AES-CBC Cipher Algorithm and Its Use with IPsec", RFC 3602, DOI 10.17487/RFC3602, September 2003,
<https://www.rfc-editor.org/info/rfc3602>. - [RFC3686] Housley, R., "Using Advanced Encryption Standard (AES) Counter Mode With IPsec Encapsulating Security Payload (ESP)", RFC 3686, DOI 10.17487/RFC3686, January 2004,
<https://www.rfc-editor.org/info/rfc3686>. - [RFC4106] Viega, J. and D. McGrew, "The Use of Galois/Counter Mode (GCM) in IPsec Encapsulating Security Payload (ESP)", RFC 4106, DOI 10.17487/RFC4106, June 2005,
<https://www.rfc-editor.org/info/rfc4106>. - [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", RFC 4303, DOI 10.17487/RFC4303, December 2005,
<https://www.rfc-editor.org/info/rfc4303>. - [RFC4309] Housley, R., "Using Advanced Encryption Standard (AES) CCM Mode with IPsec Encapsulating Security Payload (ESP)", RFC 4309, DOI 10.17487/RFC4309, December 2005,
<https://www.rfc-editor.org/info/rfc4309>. - [RFC5374] Weis, B., Gross, G., and D. Ignjatic, "Multicast Extensions to the Security Architecture for the Internet Protocol", RFC 5374, DOI 10.17487/RFC5374, November 2008,
<https://www.rfc-editor.org/info/rfc5374>. - [RFC6311] Singh, R., Ed., Kalyani, G., Nir, Y., Sheffer, Y., and D. Zhang, "Protocol Support for High Availability of IKEv2/IPsec", RFC 6311, DOI 10.17487/RFC6311, July 2011,
<https://www.rfc-editor.org/info/rfc6311>. - [RFC6407] Weis, B., Rowles, S., and T. Hardjono, "The Group Domain of Interpretation", RFC 6407, DOI 10.17487/RFC6407, October 2011,
<https://www.rfc-editor.org/info/rfc6407>. - [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. Kivinen, "Internet Key Exchange Protocol Version 2 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 2014,
<https://www.rfc-editor.org/info/rfc7296>. - [RFC7383] Smyslov, V., "Internet Key Exchange Protocol Version 2 (IKEv2) Message Fragmentation", RFC 7383, DOI 10.17487/RFC7383, November 2014,
<https://www.rfc-editor.org/info/rfc7383>. - [RFC7634] Nir, Y., "ChaCha20, Poly1305, and Their Use in the Internet Key Exchange Protocol (IKE) and IPsec", RFC 7634, DOI 10.17487/RFC7634, August 2015,
<https://www.rfc-editor.org/info/rfc7634>. - [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017,
<https://www.rfc-editor.org/info/rfc8174>. - [RFC8221] Wouters, P., Migault, D., Mattsson, J., Nir, Y., and T. Kivinen, "Cryptographic Algorithm Implementation Requirements and Usage Guidance for Encapsulating Security Payload (ESP) and Authentication Header (AH)", RFC 8221, DOI 10.17487/RFC8221, October 2017,
<https://www.rfc-editor.org/info/rfc8221>.
9.2. Informative References π¦
- [BEAST] Duong, T. and J. Rizzo, "Here Come The xor Ninjas", May 2011,
<https://www.researchgate.net/publication/266529975_Here_Come_The_Ninjas>. - [G-IKEv2] Weis, B. and V. Smyslov, "Group Key Management using IKEv2", Work in Progress, Internet-Draft, draft-ietf-ipsecme-g-ikev2-00, 8 January 2020,
<https://tools.ietf.org/html/draft-ietf-ipsecme-g-ikev2-00>. - [IANA] IANA, "Internet Key Exchange Version 2 (IKEv2) Parameters",
<https://www.iana.org/assignments/ikev2-parameters>.
Acknowledgements π«Ά
Huge thank-yous to Valery Smyslov, Γric Vyncke, Alexey Melnikov, Adam Roach, and Magnus NystrΓΆm (security directorate) πΈ Also big love to the three Security ADs, Eric Rescorla, Benjamin Kaduk, and Roman Danyliw, for their super valuable comments β¨ Shoutout to David Schinazi for his implementation π And thanks to Tero Kivinen and David Waltermire (the IPSECME Chairs) for moving this work forward π
Authors' Addresses π
Daniel Migault
Ericsson
8275 Trans Canada Route
Saint Laurent QC H4S 0B6
Canada
Email: daniel.migault@ericsson.com
Tobias Guggemos
LMU Munich
Oettingenstr. 67
80538 Munich
Germany
Email: guggemos@nm.ifi.lmu.de
URI: http://mnm-team.org/~guggemos
Yoav Nir
Dell Technologies
9 Andrei Sakharov St
Haifa 3190500
Israel
Email: ynir.ietf@gmail.com
π¦ where this page comes from
- ietf: rfc8750 2020-03
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms