idnits 2.17.1 draft-ietf-ipsecme-implicit-iv-08.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (October 16, 2019) is 1654 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'IANA' is defined on line 335, but no explicit reference was found in the text Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IPSECME D. Migault 3 Internet-Draft Ericsson 4 Intended status: Standards Track T. Guggemos 5 Expires: April 18, 2020 LMU Munich 6 Y. Nir 7 Dell EMC 8 October 16, 2019 10 Implicit IV for Counter-based Ciphers in Encapsulating Security Payload 11 (ESP) 12 draft-ietf-ipsecme-implicit-iv-08 14 Abstract 16 Encapsulating Security Payload (ESP) sends an initialization vector 17 (IV) in each packet. The size of IV depends on the applied 18 transform, being usually 8 or 16 octets for the transforms defined by 19 the time this document is written. Some algorithms such as AES-GCM, 20 AES-CCM and ChaCha20-Poly1305 when used with IPsec, take the IV to 21 generate a nonce that is used as an input parameter for encrypting 22 and decrypting. These algorithms require a unique IV but do not 23 require an unpredictable IV. As a result, the value provided in the 24 ESP Sequence Number (SN) can be used instead to generate the nonce. 25 This avoids sending the IV itself, and saves in the case of AES-GCM, 26 AES-CCM and ChaCha20-Poly1305 8 octets per packet. This document 27 describes how to do this. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on April 18, 2020. 46 Copyright Notice 48 Copyright (c) 2019 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (https://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Requirements notation . . . . . . . . . . . . . . . . . . . . 2 64 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 65 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 66 4. Implicit IV . . . . . . . . . . . . . . . . . . . . . . . . . 3 67 5. IKEv2 Initiator Behavior . . . . . . . . . . . . . . . . . . 4 68 6. IKEv2 Responder Behavior . . . . . . . . . . . . . . . . . . 5 69 7. Security Considerations . . . . . . . . . . . . . . . . . . . 5 70 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 71 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 6 72 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 73 10.1. Normative References . . . . . . . . . . . . . . . . . . 6 74 10.2. Informational References . . . . . . . . . . . . . . . . 8 75 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 77 1. Requirements notation 79 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 80 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 81 "OPTIONAL" in this document are to be interpreted as described BCP 14 82 [RFC2119], [RFC8174] when, and only when, they appear in all 83 capitals, as shown here. 85 2. Introduction 87 Counter-based AES modes of operation such as AES-CCM ([RFC4309]), and 88 AES-GCM ([RFC4106]) require the specification of an nonce for each 89 ESP packet. The same applies for ChaCha20-Poly1305 ([RFC7634]). 90 Currently this nonce is generated thanks to the Initialize Vector 91 (IV) provided in each ESP packet ([RFC4303]). This practice is 92 designated in this document as "explicit IV". 94 In some contexts, such as IoT, it may be preferable to avoid carrying 95 the extra bytes associated to the IV and instead generate it locally 96 on each peer. The local generation of the IV is designated in this 97 document as "implicit IV". 99 The size of this IV depends on the specific algorithm, but all of the 100 algorithms mentioned above take an 8-octet IV. 102 This document defines how to compute the IV locally when it is 103 implicit. It also specifies how peers agree with the Internet Key 104 Exchange version 2 (IKEv2 - [RFC7296]) on using an implicit IV versus 105 an explicit IV. 107 This document limits its scope to the algorithms mentioned above. 108 Other algorithms with similar properties may later be defined to use 109 similar mechanism. 111 This document does not consider AES-CBC ([RFC3602]) as AES-CBC 112 requires the IV to be unpredictable. Deriving it directly from the 113 packet counter as described below is insecure as mentioned in 114 Security Consideration of [RFC3602] and has led to real world chosen 115 plain-text attack such as BEAST [BEAST]. 117 This document does not consider AES-CTR [RFC3686] as it focuses on 118 the recommended AEAD suites provided in [RFC8221]. 120 3. Terminology 122 o IoT: Internet of Things. 124 o IV: Initialization Vector. 126 o IIV: Implicit Initialization Vector. 128 o Nonce: a fixed-size octet string used only once. In our case, the 129 nonce takes the IV as input and is provided as an input parameter 130 for encryption/decryption. 132 4. Implicit IV 134 With the algorithms listed in Section 2, the 8-byte IV MUST NOT 135 repeat for a given key. The binding between an ESP packet and its IV 136 is provided using the Sequence Number or the Extended Sequence 137 Number. Figure 1 and Figure 2 represent the IV with a regular 4-byte 138 Sequence Number and with an 8-byte Extended Sequence Number 139 respectively. 141 0 1 2 3 142 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 143 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 144 | Zero | 145 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 146 | Sequence Number | 147 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 149 Figure 1: Implicit IV with a 4 byte Sequence Number 151 o Sequence Number: the 4 byte Sequence Number carried in the ESP 152 packet. 154 o Zero: a 4 byte array with all bits set to zero. 156 0 1 2 3 157 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 158 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 159 | Extended | 160 | Sequence Number | 161 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 163 Figure 2: Implicit IV with an 8-byte Extended Sequence Number 165 o Extended Sequence Number: the 8-byte Extended Sequence Number of 166 the Security Association. The 4 byte low order bytes are carried 167 in the ESP packet. 169 This document solely defines the IV generation of the algorithms 170 defined in [RFC4106] for AES-GCM, [RFC4309] for AES-CCM and [RFC7634] 171 for ChaCha20-Poly1305. All other aspects and parameters of those 172 algorithms are unchanged, and are used as defined in their respective 173 specifications. 175 5. IKEv2 Initiator Behavior 177 An initiator supporting this feature SHOULD propose implicit IV (IIV) 178 algorithms in the Transform Type 1 (Encryption Algorithm) 179 Substructure of the Proposal Substructure inside the Security 180 Association Payload (SA Payload) in the IKEv2 Exchange. To 181 facilitate backward compatibility with non-supporting peers the 182 initiator SHOULD also include those same algorithms with explicit IV 183 as separate transforms. 185 6. IKEv2 Responder Behavior 187 The rules of SA Payload processing require that responder picks its 188 algorithms from the proposal sent by the initiator, thus this will 189 ensure that the responder will never send an SA payload containing 190 the IIV transform to an initiator that did not propose it. 192 7. Security Considerations 194 Nonce generation for these algorithms has not been explicitly 195 defined. It has been left to the implementation as long as certain 196 security requirements are met. Typically, for AES-GCM, AES-CCM and 197 ChaCha20-Poly1305, the IV is not allowed to be repeated for one 198 particular key. This document provides an explicit and normative way 199 to generate IVs. The mechanism described in this document meets the 200 IV security requirements of all relevant algorithms. 202 As the IV must not repeat for one SA when Counter-Mode ciphers are 203 used, implicit IV as described in this document MUST NOT be used in 204 setups with the chance that the Sequence Number overlaps for one SA. 205 The sender's counter and the receiver's counter MUST be reset (by 206 establishing a new SA and thus a new key) prior to the transmission 207 of the 2^32nd packet for an SA that uses a non extended Sequence 208 Number (respectively the 2^64nd packet for an SA that uses an 209 Extended Sequence Number). This prevents sequence number overlaps 210 for the mundane point-to-point case. Multicast as described in 211 [RFC5374], [RFC6407] and [I-D.yeung-g-ikev2] is a prominent example, 212 where many senders share one secret and thus one SA. As such, 213 Implicit IV may only be used with Multicast if some mechanisms are 214 employed that prevent Sequence Number to overlap for one SA, 215 otherwise Implicit IV MUST NOT be used with Multicast. 217 This document defines three new encryption transforms that use 218 implicit IV. Unlike most encryption transforms defined to date, 219 which can be used for both ESP and IKEv2, these transforms are 220 defined for ESP only and cannot be used in IKEv2. The reason is that 221 IKEv2 messages don't contain a unique per-message value that can be 222 used for IV generation. The Message-ID field in IKEv2 header is 223 similar to the SN field in ESP header, but recent IKEv2 extensions 224 ([RFC6311], [RFC7383]) do allow it to repeat, so there is not an easy 225 way to derive unique IV from IKEv2 header fields. 227 8. IANA Considerations 229 The IANA has assigned the following code points: 231 - ENCR_AES_CCM_8_IIV: 29 232 - ENCR_AES_GCM_16_IIV: 30 234 - ENCR_CHACHA20_POLY1305_IIV: 31 236 These algorithms should be added with this document as ESP Reference 237 and "Not Allowed" for IKEv2 Reference. 239 9. Acknowledgements 241 We would like to thank Valery Smyslov, Eric Vyncke, Magnus Nystrom 242 (security directorate), as well as our three ADs Eric Rescorla, 243 Benjamin Kaduk and Roman Danyliw for their valuable comments. We 244 also would like to thank David Schinazi for its implementation, as 245 well as the ipseceme chairs Tero Kivinen and David Waltermire for 246 moving this work forward. 248 NOTE TO THE EDITOR Eric has a accent on E and Magnus has double 249 points on o. 251 10. References 253 10.1. Normative References 255 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 256 Requirement Levels", BCP 14, RFC 2119, 257 DOI 10.17487/RFC2119, March 1997, 258 . 260 [RFC3602] Frankel, S., Glenn, R., and S. Kelly, "The AES-CBC Cipher 261 Algorithm and Its Use with IPsec", RFC 3602, 262 DOI 10.17487/RFC3602, September 2003, 263 . 265 [RFC3686] Housley, R., "Using Advanced Encryption Standard (AES) 266 Counter Mode With IPsec Encapsulating Security Payload 267 (ESP)", RFC 3686, DOI 10.17487/RFC3686, January 2004, 268 . 270 [RFC4106] Viega, J. and D. McGrew, "The Use of Galois/Counter Mode 271 (GCM) in IPsec Encapsulating Security Payload (ESP)", 272 RFC 4106, DOI 10.17487/RFC4106, June 2005, 273 . 275 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 276 RFC 4303, DOI 10.17487/RFC4303, December 2005, 277 . 279 [RFC4309] Housley, R., "Using Advanced Encryption Standard (AES) CCM 280 Mode with IPsec Encapsulating Security Payload (ESP)", 281 RFC 4309, DOI 10.17487/RFC4309, December 2005, 282 . 284 [RFC5374] Weis, B., Gross, G., and D. Ignjatic, "Multicast 285 Extensions to the Security Architecture for the Internet 286 Protocol", RFC 5374, DOI 10.17487/RFC5374, November 2008, 287 . 289 [RFC6311] Singh, R., Ed., Kalyani, G., Nir, Y., Sheffer, Y., and D. 290 Zhang, "Protocol Support for High Availability of IKEv2/ 291 IPsec", RFC 6311, DOI 10.17487/RFC6311, July 2011, 292 . 294 [RFC6407] Weis, B., Rowles, S., and T. Hardjono, "The Group Domain 295 of Interpretation", RFC 6407, DOI 10.17487/RFC6407, 296 October 2011, . 298 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 299 Kivinen, "Internet Key Exchange Protocol Version 2 300 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 301 2014, . 303 [RFC7383] Smyslov, V., "Internet Key Exchange Protocol Version 2 304 (IKEv2) Message Fragmentation", RFC 7383, 305 DOI 10.17487/RFC7383, November 2014, 306 . 308 [RFC7634] Nir, Y., "ChaCha20, Poly1305, and Their Use in the 309 Internet Key Exchange Protocol (IKE) and IPsec", RFC 7634, 310 DOI 10.17487/RFC7634, August 2015, 311 . 313 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 314 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 315 May 2017, . 317 [RFC8221] Wouters, P., Migault, D., Mattsson, J., Nir, Y., and T. 318 Kivinen, "Cryptographic Algorithm Implementation 319 Requirements and Usage Guidance for Encapsulating Security 320 Payload (ESP) and Authentication Header (AH)", RFC 8221, 321 DOI 10.17487/RFC8221, October 2017, 322 . 324 10.2. Informational References 326 [BEAST] Thai, T. and J. Juliano, "Here Come The xor Ninjas", , 327 May 2011, . 330 [I-D.yeung-g-ikev2] 331 Weis, B. and V. Smyslov, "Group Key Management using 332 IKEv2", draft-yeung-g-ikev2-16 (work in progress), July 333 2019. 335 [IANA] "IANA IKEv2 Parameter - Type 1 - Encryption Algorithm 336 Transform IDs", . 339 Authors' Addresses 341 Daniel Migault 342 Ericsson 343 8275 Trans Canada Route 344 Saint Laurent, QC H4S 0B6 345 Canada 347 Email: daniel.migault@ericsson.com 349 Tobias Guggemos 350 LMU Munich 351 Oettingenstr. 67 352 80538 Munich, Bavaria 353 Germany 355 Email: guggemos@mnm-team.org 356 URI: http://mnm-team.org/~guggemos 358 Yoav Nir 359 Dell EMC 360 9 Andrei Sakharov St 361 Haifa 3190500 362 Israel 364 Email: ynir.ietf@gmail.com