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