idnits 2.17.1 draft-ietf-ipsecme-implicit-iv-11.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 21, 2019) is 1646 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) No issues found here. Summary: 0 errors (**), 0 flaws (~~), 2 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 23, 2020 LMU Munich 6 Y. Nir 7 Dell EMC 8 October 21, 2019 10 Implicit IV for Counter-based Ciphers in Encapsulating Security Payload 11 (ESP) 12 draft-ietf-ipsecme-implicit-iv-11 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. This IV must be unique but can be predictable. As a 23 result, the value provided in the ESP Sequence Number (SN) can be 24 used instead to generate the nonce. This avoids sending the IV 25 itself, and saves in the case of AES-GCM, AES-CCM and 26 ChaCha20-Poly1305 8 octets per packet. This document describes how 27 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 23, 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 Initialization 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 mechanisms. 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 updated the "Internet Key Exchange Version 2 (IKEv2) 230 Parameters" [RFC7296] by adding new code points to the "Transform 231 Type Values"/"Transform Type 1 - Encryption Algorithm Transform IDs" 232 registry [IANA]: 234 - ENCR_AES_CCM_8_IIV: 29 236 - ENCR_AES_GCM_16_IIV: 30 238 - ENCR_CHACHA20_POLY1305_IIV: 31 240 These algorithms should be added with this document as ESP Reference 241 and "Not Allowed" for IKEv2 Reference. 243 9. Acknowledgements 245 We would like to thank Valery Smyslov, Eric Vyncke, Alexey Melnikov, 246 Adam Roach, Magnus Nystrom (security directorate), as well as our 247 three Security ADs Eric Rescorla, Benjamin Kaduk and Roman Danyliw 248 for their valuable comments. We also would like to thank David 249 Schinazi for its implementation, as well as the ipseceme chairs Tero 250 Kivinen and David Waltermire for moving this work forward. 252 NOTE TO THE EDITOR Eric has a accent on E and Magnus has double 253 points on o. 255 10. References 257 10.1. Normative References 259 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 260 Requirement Levels", BCP 14, RFC 2119, 261 DOI 10.17487/RFC2119, March 1997, 262 . 264 [RFC3602] Frankel, S., Glenn, R., and S. Kelly, "The AES-CBC Cipher 265 Algorithm and Its Use with IPsec", RFC 3602, 266 DOI 10.17487/RFC3602, September 2003, 267 . 269 [RFC3686] Housley, R., "Using Advanced Encryption Standard (AES) 270 Counter Mode With IPsec Encapsulating Security Payload 271 (ESP)", RFC 3686, DOI 10.17487/RFC3686, January 2004, 272 . 274 [RFC4106] Viega, J. and D. McGrew, "The Use of Galois/Counter Mode 275 (GCM) in IPsec Encapsulating Security Payload (ESP)", 276 RFC 4106, DOI 10.17487/RFC4106, June 2005, 277 . 279 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 280 RFC 4303, DOI 10.17487/RFC4303, December 2005, 281 . 283 [RFC4309] Housley, R., "Using Advanced Encryption Standard (AES) CCM 284 Mode with IPsec Encapsulating Security Payload (ESP)", 285 RFC 4309, DOI 10.17487/RFC4309, December 2005, 286 . 288 [RFC5374] Weis, B., Gross, G., and D. Ignjatic, "Multicast 289 Extensions to the Security Architecture for the Internet 290 Protocol", RFC 5374, DOI 10.17487/RFC5374, November 2008, 291 . 293 [RFC6311] Singh, R., Ed., Kalyani, G., Nir, Y., Sheffer, Y., and D. 294 Zhang, "Protocol Support for High Availability of IKEv2/ 295 IPsec", RFC 6311, DOI 10.17487/RFC6311, July 2011, 296 . 298 [RFC6407] Weis, B., Rowles, S., and T. Hardjono, "The Group Domain 299 of Interpretation", RFC 6407, DOI 10.17487/RFC6407, 300 October 2011, . 302 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 303 Kivinen, "Internet Key Exchange Protocol Version 2 304 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 305 2014, . 307 [RFC7383] Smyslov, V., "Internet Key Exchange Protocol Version 2 308 (IKEv2) Message Fragmentation", RFC 7383, 309 DOI 10.17487/RFC7383, November 2014, 310 . 312 [RFC7634] Nir, Y., "ChaCha20, Poly1305, and Their Use in the 313 Internet Key Exchange Protocol (IKE) and IPsec", RFC 7634, 314 DOI 10.17487/RFC7634, August 2015, 315 . 317 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 318 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 319 May 2017, . 321 [RFC8221] Wouters, P., Migault, D., Mattsson, J., Nir, Y., and T. 322 Kivinen, "Cryptographic Algorithm Implementation 323 Requirements and Usage Guidance for Encapsulating Security 324 Payload (ESP) and Authentication Header (AH)", RFC 8221, 325 DOI 10.17487/RFC8221, October 2017, 326 . 328 10.2. Informational References 330 [BEAST] Thai, T. and J. Juliano, "Here Come The xor Ninjas", , 331 May 2011, . 334 [I-D.yeung-g-ikev2] 335 Weis, B. and V. Smyslov, "Group Key Management using 336 IKEv2", draft-yeung-g-ikev2-16 (work in progress), July 337 2019. 339 [IANA] "IANA IKEv2 Parameter - Type 1 - Encryption Algorithm 340 Transform IDs", . 343 Authors' Addresses 345 Daniel Migault 346 Ericsson 347 8275 Trans Canada Route 348 Saint Laurent, QC H4S 0B6 349 Canada 351 Email: daniel.migault@ericsson.com 353 Tobias Guggemos 354 LMU Munich 355 Oettingenstr. 67 356 80538 Munich, Bavaria 357 Germany 359 Email: guggemos@mnm-team.org 360 URI: http://mnm-team.org/~guggemos 362 Yoav Nir 363 Dell EMC 364 9 Andrei Sakharov St 365 Haifa 3190500 366 Israel 368 Email: ynir.ietf@gmail.com