idnits 2.17.00 (12 Aug 2021) /tmp/idnits64316/draft-ietf-ipsecme-chacha20-poly1305-01.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 doesn't use any RFC 2119 keywords, yet seems to have RFC 2119 boilerplate text. -- The document date (March 31, 2015) is 2608 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 Network Working Group Y. Nir 3 Internet-Draft Check Point 4 Intended status: Standards Track March 31, 2015 5 Expires: October 2, 2015 7 ChaCha20, Poly1305 and their use in IKE & IPsec 8 draft-ietf-ipsecme-chacha20-poly1305-01 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 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 2, 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. Security Considerations . . . . . . . . . . . . . . . . . . . 4 56 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 57 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5 58 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 59 7.1. Normative References . . . . . . . . . . . . . . . . . . 5 60 7.2. Informative References . . . . . . . . . . . . . . . . . 5 61 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6 63 1. Introduction 65 The Advanced Encryption Standard (AES - [FIPS-197]) has become the 66 gold standard in encryption. Its efficient design, wide 67 implementation, and hardware support allow for high performance in 68 many areas, including IPsec VPNs. On most modern platforms, AES is 69 anywhere from 4x to 10x as fast as the previous most-used cipher, 70 3-key Data Encryption Standard (3DES - [FIPS-46]), which makes it not 71 only the best choice, but the only choice. 73 The problem is that if future advances in cryptanalysis reveal a 74 weakness in AES, VPN users will be in an unenviable position. With 75 the only other widely supported cipher being the much slower 3DES, it 76 is not feasible to re-configure IPsec installations to use 3DES. 77 [standby-cipher] describes this issue and the need for a standby 78 cipher in greater detail. 80 This document proposes the ChaCha20 stream cipher as such a standby 81 cipher in an Authenticated Encryption with Associated Data (AEAD) 82 construction with the Poly1305 authenticator for use with the 83 Encapsulated Security Protocol (ESP - [RFC4303]) and the Internet Key 84 Exchange Protocol (IKEv2 - [RFC7296]). The algorithms are described 85 in a separate document ([chacha_poly]). This document only describes 86 the IPsec-specific things. 88 1.1. Conventions Used in This Document 90 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 91 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 92 document are to be interpreted as described in [RFC2119]. 94 2. ChaCha20 & Poly1305 for ESP 96 AEAD_CHACHA20_POLY1305 is a combined mode algorithm, or AEAD. The 97 construction follows the AEAD construction in section 2.7 of 98 [chacha_poly]: 100 o The IV is 64-bit, and is used as part of the nonce. TBD: do we 101 want to skip the IV altogether and just use the packet counter? 102 o A 32-bit sender ID is prepended to the 64-bit IV to form the 103 96-bit nonce. For regular IPsec, this is set to all zeros. IPsec 104 extensions that allow multiple senders, such as GDOI ([RFC6407]) 105 or [RFC6054] may set this to different values. 106 o The encryption key is 256-bit. 107 o The Internet Key Exchange protocol generates a bitstring called 108 KEYMAT that is generated from a PRF. That KEYMAT is divided into 109 keys for encryption, message authentication and whatever else is 110 needed. For the ChaCha20 algorithm, 256 bits are used for the 111 key. TBD: do we want an extra 32 bits as salt for the nonce like 112 in GCM? 113 o The ChaCha20 encryption algorithm requires the following 114 parameters: a 256-bit key, a 96-bit nonce, and a 32-bit initial 115 block counter. For ESP we set these as follows: 117 * The key is set to the key mentioned above. 118 * The 96-bit nonce is formed from a concatenation of the 32-bit 119 sender ID and the 64-bit IV, as described above. 120 * The Initial Block Counter is set to one (1). The reason that 121 one is used for the initial counter rather than zero is that 122 zero is reserved for generating the one-time Poly1305 key (see 123 below) 124 o As ChaCha20 is not a block cipher, no padding should be necessary. 125 However, in keeping with the specification in RFC 4303, the ESP 126 does have padding, so as to align the buffer to an integral 127 multiple of 4 octets. 128 o The same key and nonce, along with a block counter of zero are 129 passed to the ChaCha20 block function, and the top 256 bits of the 130 result are used as the Poly1305 key. The nonce passed to the 131 block function here is the same nonce that is used in ChaCha20, 132 including the 32-bit Sender ID bits, and the key passed is the 133 same as the encryption key. 134 o Finally, the Poly1305 function is run on the data to be 135 authenticated, which is, as specified in section 2.7 of 136 [chacha_poly] a concatenation of the following in the below order: 138 * The Authenticated Additional Data (AAD) - see Section 2.1. 139 * The AAD length in bytes as a 32-bit network order quantity. 140 * The ciphertext 141 * The length of the ciphertext as a 32-bit network order 142 quantity. 143 o The 128-bit output of Poly1305 is used as the tag. All 16 bytes 144 are included in the packet. 146 The encryption algorithm transform ID for negotiating this algorithm 147 in IKE is TBA by IANA. 149 2.1. AAD Construction 151 The construction of the Additional Authenticated Data (AAD) is 152 similar to the one in [RFC4106]. For security associations (SAs) 153 with 32-bit sequence numbers the AAD is 8 bytes: 4-byte SPI followed 154 by 4-byte sequence number ordered exactly as it is in the packet. 155 For SAs with ESN the AAD is 12 bytes: 4-byte SPI followed by an 156 8-byte sequence number as a 64-bit network order integer. 158 3. Use in IKEv2 160 AEAD algorithms can be used in IKE, as described in [RFC5282]. More 161 specifically, the Encrypted Payload is as described in section 3 of 162 that document, the IV is 64 bits, as described in Section 2, and the 163 AAD is as described in section 5.1 of RFC 5282, so it's 32 bytes (28 164 for the IKEv2 header + 4 bytes for the encrypted payload header) 165 assuming no unencrypted payloads. 167 4. Security Considerations 169 The ChaCha20 cipher is designed to provide 256-bit security. 171 The Poly1305 authenticator is designed to ensure that forged messages 172 are rejected with a probability of 1-(n/(2^102)) for a 16n-byte 173 message, even after sending 2^64 legitimate messages, so it is SUF- 174 CMA in the terminology of [AE]. 176 The most important security consideration in implementing this draft 177 is the uniqueness of the nonce used in ChaCha20. The nonce should be 178 selected uniquely for a particular key, but unpredictability of the 179 nonce is not required. Counters and LFSRs are both acceptable ways 180 of generating unique nonces, as is encrypting a counter using a 181 64-bit cipher such as DES. Note that it is not acceptable to use a 182 truncation of a counter encrypted with a 128-bit or 256-bit cipher, 183 because such a truncation may repeat after a short time. 185 Another issue with implementing these algorithms is avoiding side 186 channels. This is trivial for ChaCha20, but requires some care for 187 Poly1305. Considerations for implementations of these algorithms are 188 in the [chacha_poly] document. 190 5. IANA Considerations 192 IANA is requested to assign one value from the IKEv2 "Transform Type 193 1 - Encryption Algorithm Transform IDs" registry, with name 194 ENCR_ChaCha20_Poly1305, and this document as reference. 196 6. Acknowledgements 198 All of the algorithms in this document were designed by D. J. 199 Bernstein. The AEAD construction was designed by Adam Langley. The 200 author would also like to thank Adam for helpful comments, as well as 201 Yaron Sheffer for telling me to write the algorithms draft. 203 7. References 205 7.1. Normative References 207 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 208 Requirement Levels", BCP 14, RFC 2119, March 1997. 210 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", RFC 211 4303, December 2005. 213 [RFC5282] Black, D. and D. McGrew, "Using Authenticated Encryption 214 Algorithms with the Encrypted Payload of the Internet Key 215 Exchange version 2 (IKEv2) Protocol", RFC 5282, August 216 2008. 218 [RFC6054] McGrew, D. and B. Weis, "Using Counter Modes with 219 Encapsulating Security Payload (ESP) and Authentication 220 Header (AH) to Protect Group Traffic", RFC 6054, November 221 2010. 223 [RFC7296] Kivinen, T., Kaufman, C., Hoffman, P., Nir, Y., and P. 224 Eronen, "Internet Key Exchange Protocol Version 2 225 (IKEv2)", RFC 7296, October 2014. 227 [chacha_poly] 228 Langley, A. and Y. Nir, "ChaCha20 and Poly1305 for IETF 229 protocols", draft-nir-cfrg-chacha20-poly1305-01 (work in 230 progress), January 2014. 232 7.2. Informative References 234 [AE] Bellare, M. and C. Namprempre, "Authenticated Encryption: 235 Relations among notions and analysis of the generic 236 composition paradigm", 2000, 237 . 239 [FIPS-197] 240 National Institute of Standards and Technology, "Advanced 241 Encryption Standard (AES)", FIPS PUB 197, November 2001, 242 . 245 [FIPS-46] National Institute of Standards and Technology, "Data 246 Encryption Standard", FIPS PUB 46-2, December 1993, 247 . 249 [RFC4106] Viega, J. and D. McGrew, "The Use of Galois/Counter Mode 250 (GCM) in IPsec Encapsulating Security Payload (ESP)", RFC 251 4106, June 2005. 253 [RFC6407] Weis, B., Rowles, S., and T. Hardjono, "The Group Domain 254 of Interpretation", RFC 6407, October 2011. 256 [standby-cipher] 257 McGrew, D., Grieco, A., and Y. Sheffer, "Selection of 258 Future Cryptographic Standards", draft-mcgrew-standby- 259 cipher (work in progress), January 2013. 261 Author's Address 263 Yoav Nir 264 Check Point Software Technologies Ltd. 265 5 Hasolelim st. 266 Tel Aviv 6789735 267 Israel 269 Email: ynir.ietf@gmail.com