idnits 2.17.00 (12 Aug 2021) /tmp/idnits60983/draft-ietf-ipsecme-chacha20-poly1305-03.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 date (April 25, 2015) is 2583 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 (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Y. Nir 3 Internet-Draft Check Point 4 Intended status: Standards Track April 25, 2015 5 Expires: October 27, 2015 7 ChaCha20, Poly1305 and their use in IKE & IPsec 8 draft-ietf-ipsecme-chacha20-poly1305-03 10 Abstract 12 This document describes the use of the ChaCha20 stream cipher along 13 with the Poly1305 authenticator, combined into an AEAD algorithm for 14 the Internet Key Exchange protocol (IKEv2) and for IPsec. 16 Status of This Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at http://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on October 27, 2015. 33 Copyright Notice 35 Copyright (c) 2015 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (http://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 1.1. Conventions Used in This Document . . . . . . . . . . . . 2 52 2. ChaCha20 & Poly1305 for ESP . . . . . . . . . . . . . . . . . 3 53 2.1. AAD Construction . . . . . . . . . . . . . . . . . . . . 4 54 3. Use in IKEv2 . . . . . . . . . . . . . . . . . . . . . . . . 4 55 4. Negotiation in IKEv2 . . . . . . . . . . . . . . . . . . . . 4 56 5. Security Considerations . . . . . . . . . . . . . . . . . . . 5 57 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 58 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5 59 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 60 8.1. Normative References . . . . . . . . . . . . . . . . . . 5 61 8.2. Informative References . . . . . . . . . . . . . . . . . 6 62 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6 64 1. Introduction 66 The Advanced Encryption Standard (AES - [FIPS-197]) has become the 67 gold standard in encryption. Its efficient design, wide 68 implementation, and hardware support allow for high performance in 69 many areas, including IPsec VPNs. On most modern platforms, AES is 70 anywhere from 4x to 10x as fast as the previous most-used cipher, 71 3-key Data Encryption Standard (3DES - [SP800-67]). 3DES also has a 72 64-bit block, which means that the amount of data that can be 73 encrypted before rekeying is required is not great. These reasons 74 make AES not only the best choice, but the only choice. 76 The problem is that if future advances in cryptanalysis reveal a 77 weakness in AES, VPN users will be in an unenviable position. With 78 the only other widely supported cipher being the much slower 3DES, it 79 is not feasible to re-configure IPsec installations to use 3DES. 80 [standby-cipher] describes this issue and the need for a standby 81 cipher in greater detail. 83 This document proposes the ChaCha20 stream cipher as such a standby 84 cipher in an Authenticated Encryption with Associated Data (AEAD) 85 construction with the Poly1305 authenticator for use with the 86 Encapsulated Security Protocol (ESP - [RFC4303]) and the Internet Key 87 Exchange Protocol (IKEv2 - [RFC7296]). The algorithms are described 88 in a separate document ([chacha_poly]). This document only describes 89 the IPsec-specific things. 91 1.1. Conventions Used in This Document 93 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 94 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 95 document are to be interpreted as described in [RFC2119]. 97 2. ChaCha20 & Poly1305 for ESP 99 AEAD_CHACHA20_POLY1305 is a combined mode algorithm, or AEAD. The 100 construction follows the AEAD construction in section 2.8 of 101 [chacha_poly]: 103 o The Initialization Vector (IV) is 64-bit, and is used as part of 104 the nonce. The IV MUST be unique for each invocation for a 105 particular SA but does not need to be unpredictable. The use of a 106 counter or a linear feedback shift register (LFSR) is RECOMMENDED. 107 o A 32-bit Salt is prepended to the 64-bit IV to form the 96-bit 108 nonce. The salt is fixed per SA and it is not transmitted as part 109 of the ESP packet.. 110 o The encryption key is 256-bit. 111 o The Internet Key Exchange protocol generates a bitstring called 112 KEYMAT using a pseudo-random function (PRF). That KEYMAT is 113 divided into keys for encryption, message authentication and 114 whatever else is needed. For the ChaCha20-poly1305 algorithm, 256 115 bits are used for the key, and a subsequent 32 bits are used for 116 the Salt. 118 The ChaCha20 encryption algorithm requires the following parameters: 119 a 256-bit key, a 96-bit nonce, and a 32-bit initial block counter. 120 For ESP we set these as follows: 122 o The key is set as mentioned above. 123 o The 96-bit nonce is formed from a concatenation of the 32-bit Salt 124 and the 64-bit IV, as described above. 125 o The Initial Block Counter is set to one (1). The reason that one 126 is used for the initial counter rather than zero is that zero is 127 reserved for generating the one-time Poly1305 key (see below) 129 As the ChaCha20 block function is not applied directly to the 130 plaintext, no padding should be necessary. However, in keeping with 131 the specification in RFC 4303, the ESP does have padding, so as to 132 align the buffer to an integral multiple of 4 octets. 134 The same key and nonce, along with a block counter of zero are passed 135 to the ChaCha20 block function, and the top 256 bits of the result 136 are used as the Poly1305 key. The nonce passed to the block function 137 here is the same nonce that is used in ChaCha20, including the 32-bit 138 Salt, and the key passed is the same as the encryption key. 140 Finally, the Poly1305 function is run on the data to be 141 authenticated, which is, as specified in section 2.8 of [chacha_poly] 142 a concatenation of the following in the below order: 144 o The Authenticated Additional Data (AAD) - see Section 2.1. 146 o Padding that rounds the length up to 16 bytes. This is 4 or 8 147 bytes depending on whether extended sequence numbers (ESN) is set 148 for the SA. The padding is all zeros. 149 o The ciphertext 150 o Padding that rounds the total length up to an integral multiple of 151 16 bytes. This padding is also all zeros. 152 o The length of the additional authenticated data (AAD) in octets 153 (as a 64-bit little-endian integer). 154 o The length of the ciphertext in octets (as a 64-bit little-endian 155 integer). 157 The 128-bit output of Poly1305 is used as the tag. All 16 bytes are 158 included in the packet. 160 The encryption algorithm transform ID for negotiating this algorithm 161 in IKE is TBA by IANA. 163 2.1. AAD Construction 165 The construction of the Additional Authenticated Data (AAD) is 166 similar to the one in [RFC4106]. For security associations (SAs) 167 with 32-bit sequence numbers the AAD is 8 bytes: 4-byte SPI followed 168 by 4-byte sequence number ordered exactly as it is in the packet. 169 For SAs with ESN the AAD is 12 bytes: 4-byte SPI followed by an 170 8-byte sequence number as a 64-bit network order integer. 172 3. Use in IKEv2 174 AEAD algorithms can be used in IKE, as described in [RFC5282]. More 175 specifically: 177 o The Encrypted Payload is as described in section 3 of that 178 document. 179 o The IV is 64 bits, as described in Section 2. 180 o The AAD is as described in section 5.1 of RFC 5282, so it's 32 181 bytes (28 for the IKEv2 header + 4 bytes for the encrypted payload 182 header) assuming no unencrypted payloads. 184 4. Negotiation in IKEv2 186 When negotiating the ChaCha20-Poly1305 algorithm for use in IKE or 187 IPsec, the value xxx (TBA by IANA) should be used in the transform 188 substructure of the SA payload as the ENCR (type 1) transform ID. As 189 with other AEAD algorithms, INTEG (type 3) transform substructures 190 MUST NOT be specified or just one INTEG transform MAY be included 191 with value NONE (0). 193 5. Security Considerations 195 The ChaCha20 cipher is designed to provide 256-bit security. 197 The Poly1305 authenticator is designed to ensure that forged messages 198 are rejected with a probability of 1-(n/(2^102)) for a 16n-byte 199 message, even after sending 2^64 legitimate messages, so it is SUF- 200 CMA in the terminology of [AE]. 202 The most important security consideration in implementing this draft 203 is the uniqueness of the nonce used in ChaCha20. The nonce should be 204 selected uniquely for a particular key, but unpredictability of the 205 nonce is not required. Counters and LFSRs are both acceptable ways 206 of generating unique nonces. 208 Another issue with implementing these algorithms is avoiding side 209 channels. This is trivial for ChaCha20, but requires some care for 210 Poly1305. Considerations for implementations of these algorithms are 211 in the [chacha_poly] document. 213 6. IANA Considerations 215 IANA is requested to assign one value from the IKEv2 "Transform Type 216 1 - Encryption Algorithm Transform IDs" registry, with name 217 ENCR_CHACHA20_POLY1305, and this document as reference for both ESP 218 and IKEv2. 220 7. Acknowledgements 222 All of the algorithms in this document were designed by D. J. 223 Bernstein. The AEAD construction was designed by Adam Langley. The 224 author would also like to thank Adam for helpful comments, as well as 225 Yaron Sheffer for telling me to write the algorithms draft. Thanks 226 also to Martin Willi for pointing out the discrepancy with the final 227 version of the algorithm document, and to Valery Smyslov and Tero 228 Kivinen for helpful comments on this draft. 230 8. References 232 8.1. Normative References 234 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 235 Requirement Levels", BCP 14, RFC 2119, March 1997. 237 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", RFC 238 4303, December 2005. 240 [RFC5282] Black, D. and D. McGrew, "Using Authenticated Encryption 241 Algorithms with the Encrypted Payload of the Internet Key 242 Exchange version 2 (IKEv2) Protocol", RFC 5282, August 243 2008. 245 [RFC7296] Kivinen, T., Kaufman, C., Hoffman, P., Nir, Y., and P. 246 Eronen, "Internet Key Exchange Protocol Version 2 247 (IKEv2)", RFC 7296, October 2014. 249 [chacha_poly] 250 Langley, A. and Y. Nir, "ChaCha20 and Poly1305 for IETF 251 protocols", draft-nir-cfrg-chacha20-poly1305-01 (work in 252 progress), January 2014. 254 8.2. Informative References 256 [AE] Bellare, M. and C. Namprempre, "Authenticated Encryption: 257 Relations among notions and analysis of the generic 258 composition paradigm", 2000, 259 . 261 [FIPS-197] 262 National Institute of Standards and Technology, "Advanced 263 Encryption Standard (AES)", FIPS PUB 197, November 2001, 264 . 267 [RFC4106] Viega, J. and D. McGrew, "The Use of Galois/Counter Mode 268 (GCM) in IPsec Encapsulating Security Payload (ESP)", RFC 269 4106, June 2005. 271 [SP800-67] 272 National Institute of Standards and Technology, 273 "Recommendation for the Triple Data Encryption Algorithm 274 (TDEA) Block Cipher", FIPS SP800-67, January 2012, 275 . 278 [standby-cipher] 279 McGrew, D., Grieco, A., and Y. Sheffer, "Selection of 280 Future Cryptographic Standards", draft-mcgrew-standby- 281 cipher (work in progress), January 2013. 283 Author's Address 284 Yoav Nir 285 Check Point Software Technologies Ltd. 286 5 Hasolelim st. 287 Tel Aviv 6789735 288 Israel 290 Email: ynir.ietf@gmail.com