idnits 2.17.1 draft-ietf-tls-chacha20-poly1305-04.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 : ---------------------------------------------------------------------------- ** There are 7 instances of too long lines in the document, the longest one being 5 characters in excess of 72. == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. -- The draft header indicates that this document updates RFC6347, but the abstract doesn't seem to mention this, which it should. -- The draft header indicates that this document updates RFC5246, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC5246, updated by this document, for RFC5378 checks: 2006-03-02) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (December 16, 2015) is 3047 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 4492 (Obsoleted by RFC 8422) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Downref: Normative reference to an Informational RFC: RFC 5489 ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) ** Obsolete normative reference: RFC 7539 (Obsoleted by RFC 8439) Summary: 6 errors (**), 0 flaws (~~), 2 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Langley 3 Internet-Draft W. Chang 4 Updates: 5246, 6347 (if approved) Google Inc 5 Intended status: Standards Track N. Mavrogiannopoulos 6 Expires: June 18, 2016 Red Hat 7 J. Strombergson 8 Secworks Sweden AB 9 S. Josefsson 10 SJD AB 11 December 16, 2015 13 ChaCha20-Poly1305 Cipher Suites for Transport Layer Security (TLS) 14 draft-ietf-tls-chacha20-poly1305-04 16 Abstract 18 This document describes the use of the ChaCha stream cipher and 19 Poly1305 authenticator in the Transport Layer Security (TLS) and 20 Datagram Transport Layer Security (DTLS) protocols. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on June 18, 2016. 39 Copyright Notice 41 Copyright (c) 2015 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 57 2. ChaCha20 Cipher Suites . . . . . . . . . . . . . . . . . . . 3 58 3. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 59 4. Security Considerations . . . . . . . . . . . . . . . . . . . 4 60 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5 61 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 62 6.1. Normative References . . . . . . . . . . . . . . . . . . 5 63 6.2. Informative References . . . . . . . . . . . . . . . . . 6 64 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7 66 1. Introduction 68 This document describes the use of the ChaCha stream cipher and 69 Poly1305 authenticator in version 1.2 or later of the the Transport 70 Layer Security (TLS) [RFC5246] protocol, as well as version 1.2 or 71 later of the Datagram Transport Layer Security (DTLS) protocol 72 [RFC6347]. 74 ChaCha [CHACHA] is a stream cipher developed by D. J. Bernstein in 75 2008. It is a refinement of Salsa20, which is one of the selected 76 ciphers in the eSTREAM portfolio [ESTREAM], and was used as the core 77 of the SHA-3 finalist, BLAKE. 79 The variant of ChaCha used in this document has 20 rounds, a 96-bit 80 nonce and a 256-bit key, and will be referred to as ChaCha20. This 81 is the conservative variant (with respect to security) of the ChaCha 82 family and is described in [RFC7539]. 84 Poly1305 [POLY1305] is a Wegman-Carter, one-time authenticator 85 designed by D. J. Bernstein. Poly1305 takes a 256-bit, one-time 86 key and a message, and produces a 16-byte tag that authenticates the 87 message such that an attacker has a negligible chance of producing a 88 valid tag for an inauthentic message. It is also described in 89 [RFC7539]. 91 ChaCha and Poly1305 have both been designed for high performance in 92 software implementations. They typically admit a compact 93 implementation that uses few resources and inexpensive operations, 94 which makes them suitable on a wide range of architectures. They 95 have also been designed to minimize leakage of information through 96 side channels. 98 Recent attacks [CBC-ATTACK] have indicated problems with the CBC-mode 99 cipher suites in TLS and DTLS, as well as issues with the only 100 supported stream cipher (RC4) [RC4-ATTACK]. While the existing AEAD 101 cipher suites (based on AES-GCM) address some of these issues, there 102 are concerns about their performance and ease of software 103 implementation. 105 Therefore, a new stream cipher to replace RC4 and address all the 106 previous issues is needed. It is the purpose of this document to 107 describe a secure stream cipher for both TLS and DTLS that is 108 comparable to RC4 in speed on a wide range of platforms and can be 109 implemented easily without being vulnerable to software side-channel 110 attacks. 112 2. ChaCha20 Cipher Suites 114 The ChaCha20 and Poly1305 primitives are built into an AEAD algorithm 115 [RFC5116], AEAD_CHACHA20_POLY1305, as described in [RFC7539]. This 116 AEAD is incorporated into TLS and DTLS as specified in section 117 6.2.3.3 of [RFC5246]. 119 AEAD_CHACHA20_POLY1305 requires a 96-bit nonce, which is formed as 120 follows: 122 1. The 64-bit record sequence number is serialized as an 8-byte, 123 big-endian value and padded on the left with four 0x00 bytes. 125 2. The padded sequence number is XORed with the client_write_IV 126 (when the client is sending) or server_write_IV (when the server 127 is sending). 129 In DTLS, the 64-bit seq_num is the 16-bit epoch concatenated with the 130 48-bit seq_num. 132 This nonce construction is different from the one used with AES-GCM 133 in TLS 1.2 but matches the scheme expected to be used in TLS 1.3. 134 The nonce is constructed from the record sequence number and shared 135 secret, both of which are known to the recipient. The advantage is 136 that no per-record, explicit nonce need be transmitted, which saves 137 eight bytes per record and prevents implementations from mistakenly 138 using a random nonce. Thus, in the terms of [RFC5246], 139 SecurityParameters.fixed_iv_length is twelve bytes and 140 SecurityParameters.record_iv_length is zero bytes. 142 The following cipher suites are defined. 144 TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} 145 TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} 146 TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} 148 TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} 149 TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} 150 TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} 151 TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} 153 The DHE_RSA, ECDHE_RSA, ECDHE_ECDSA, PSK, ECDHE_PSK, DHE_PSK and 154 RSA_PSK key exchanges for these cipher suites are unaltered and thus 155 are performed as defined in [RFC5246], [RFC4492], and [RFC5489]. 157 The pseudorandom function (PRF) for all the cipher suites defined in 158 this document is the TLS PRF with SHA-256 as the hash function. 160 3. IANA Considerations 162 IANA is requested to add the following entries in the TLS Cipher 163 Suite Registry: 165 TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} {0xCC, 0xA8} 166 TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} {0xCC, 0xA9} 167 TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} {0xCC, 0xAA} 169 TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} {0xCC, 0xAB} 170 TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} {0xCC, 0xAC} 171 TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} {0xCC, 0xAD} 172 TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xTBD, 0xTBD} {0xCC, 0xAE} 174 The cipher suite numbers listed in the second column are numbers used 175 for cipher suite interoperability testing and it's suggested that 176 IANA use these values for assignment. 178 4. Security Considerations 180 ChaCha20 follows the same basic principle as Salsa20[SALSA20SPEC], a 181 cipher with significant security review [SALSA20-SECURITY][ESTREAM]. 182 At the time of writing this document, there are no known significant 183 security problems with either cipher, and ChaCha20 is shown to be 184 more resistant in certain attacks than Salsa20 [SALSA20-ATTACK]. 185 Furthermore, ChaCha20 was used as the core of the BLAKE hash 186 function, a SHA3 finalist, that has received considerable 187 cryptanalytic attention [NIST-SHA3]. 189 Poly1305 is designed to ensure that forged messages are rejected with 190 a probability of 1-(n/2^107), where n is the maximum length of the 191 input to Poly1305. In the case of (D)TLS, this means a maximum 192 forgery probability of about 1 in 2^93. 194 The cipher suites described in this document require that a nonce is 195 never repeated under the same key. The design presented ensures this 196 by using the TLS sequence number, which is unique and does not wrap 197 [RFC5246]. 199 It should be noted that AEADs, such as ChaCha20-Poly1305, are not 200 intended to hide the lengths of plaintexts. When this document 201 speaks of side-channel attacks, it is not considering traffic 202 analysis, but rather timing and cache side-channels. Traffic 203 analysis, while a valid concern, is outside the scope of the AEAD and 204 is being addressed elsewhere in future versions of TLS. 206 Otherwise, this document should not introduce any additional security 207 considerations other than those that follow from the use of the 208 AEAD_CHACHA20_POLY1305 construction, thus the reader is directed to 209 the Security Considerations section of [RFC7539]. 211 5. Acknowledgements 213 The authors would like to thank Zooko Wilcox-OHearn, Samuel Neves and 214 Colm MacCarthaigh for their suggestions and guidance. 216 6. References 218 6.1. Normative References 220 [RFC4492] Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C., and B. 221 Moeller, "Elliptic Curve Cryptography (ECC) Cipher Suites 222 for Transport Layer Security (TLS)", RFC 4492, 223 DOI 10.17487/RFC4492, May 2006, 224 . 226 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 227 (TLS) Protocol Version 1.2", RFC 5246, 228 DOI 10.17487/RFC5246, August 2008, 229 . 231 [RFC5489] Badra, M. and I. Hajjeh, "ECDHE_PSK Cipher Suites for 232 Transport Layer Security (TLS)", RFC 5489, 233 DOI 10.17487/RFC5489, March 2009, 234 . 236 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 237 Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, 238 January 2012, . 240 [RFC7539] Nir, Y. and A. Langley, "ChaCha20 and Poly1305 for IETF 241 Protocols", RFC 7539, DOI 10.17487/RFC7539, May 2015, 242 . 244 6.2. Informative References 246 [CHACHA] Bernstein, D., "ChaCha, a variant of Salsa20", January 247 2008, . 249 [POLY1305] 250 Bernstein, D., "The Poly1305-AES message-authentication 251 code.", March 2005, 252 . 254 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 255 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 256 . 258 [SALSA20SPEC] 259 Bernstein, D., "Salsa20 specification", April 2005, 260 . 262 [SALSA20-SECURITY] 263 Bernstein, D., "Salsa20 security", April 2005, 264 . 266 [ESTREAM] Babbage, S., DeCanniere, C., Cantenaut, A., Cid, C., 267 Gilbert, H., Johansson, T., Parker, M., Preneel, B., 268 Rijmen, V., and M. Robshaw, "The eSTREAM Portfolio (rev. 269 1)", September 2008, 270 . 272 [CBC-ATTACK] 273 AlFardan, N. and K. Paterson, "Lucky Thirteen: Breaking 274 the TLS and DTLS Record Protocols", IEEE Symposium on 275 Security and Privacy , 2013. 277 [RC4-ATTACK] 278 Isobe, T., Ohigashi, T., Watanabe, Y., and M. Morii, "Full 279 Plaintext Recovery Attack on Broadcast RC4", International 280 Workshop on Fast Software Encryption , 2013. 282 [SALSA20-ATTACK] 283 Aumasson, J-P., Fischer, S., Khazaei, S., Meier, W., and 284 C. Rechberger, "New Features of Latin Dances: Analysis of 285 Salsa, ChaCha, and Rumba", 2007, 286 . 288 [NIST-SHA3] 289 Chang, S., Burr, W., Kelsey, J., Paul, S., and L. Bassham, 290 "Third-Round Report of the SHA-3 Cryptographic Hash 291 Algorithm Competition", 2012, 292 . 294 Authors' Addresses 296 Adam Langley 297 Google Inc 299 Email: agl@google.com 301 Wan-Teh Chang 302 Google Inc 304 Email: wtc@google.com 306 Nikos Mavrogiannopoulos 307 Red Hat 309 Email: nmav@redhat.com 311 Joachim Strombergson 312 Secworks Sweden AB 314 Email: joachim@secworks.se 315 URI: http://secworks.se/ 317 Simon Josefsson 318 SJD AB 320 Email: simon@josefsson.org 321 URI: http://josefsson.org/