RFC 7905
ChaCha20-Poly1305 Cipher Suites for Transport Layer Security (TLS)
RFC 7905: ChaCha20-Poly1305 Cipher Suites for Transport Layer Security (TLS) π¦ (Part 1 of 2)
okay bestie, this is RFC 7905, and it's giving ChaCha20-Poly1305 realness β¨. It came out in June 2016 as a Standards Track document, so it's an actual Internet standard and not just a suggestion π . Five people wrote it: A. Langley and W. Chang from Google, N. Mavrogiannopoulos from Red Hat, J. Strombergson from Secworks Sweden AB, and S. Josefsson from SJD AB π«Ά. It's identified as RFC 7905 and ISSN 2070-1721. The big news is that it updates RFC 5246 and RFC 6347, which are TLS 1.2 and DTLS 1.2. So it's basically adding new cipher suites to the existing protocols, which is so iconic π₯.
Abstract
okay so the whole point of this doc is to explain how the ChaCha stream cipher and the Poly1305 authenticator get used in TLS and DTLS πΈ. That's it, that's the tea. And yes, it updates RFCs 5246 and 6347 π.
Status of This Memo
this bit is the official paperwork π. It's an Internet Standards Track document, and it's a product of the IETF, which represents the consensus of the IETF community π€. It got public review and was approved for publication by the Internet Engineering Steering Group (IESG) π. If you want more on Internet Standards, check Section 2 of RFC 7841 β¨. The current status, any errata, and how to give feedback live at http://www.rfc-editor.org/info/rfc7905 π.
Copyright Notice
more paperwork but make it cute π. Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they were in effect on the date of publication. Please actually read these, because they're about your rights and restrictions for this doc π. Code Components pulled out of this document must include the Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, as the Simplified BSD License describes π
.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. ChaCha20 Cipher Suites . . . . . . . . . . . . . . . . . . . 4
3. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
4. Security Considerations . . . . . . . . . . . . . . . . . . . 5
5. References . . . . . . . . . . . . . . . . . . . . . . . . . 6
5.1. Normative References . . . . . . . . . . . . . . . . . . 6
5.2. Informative References . . . . . . . . . . . . . . . . . 6
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 8
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8
1. Introduction β¨
okay so this doc describes how ChaCha20 and Poly1305 get used in version 1.2 or later of TLS [RFC5246], and also in version 1.2 or later of DTLS [RFC6347] π¦.
now the cipher itself. ChaCha [CHACHA] is a stream cipher that D. J. Bernstein made in 2008 π§. It's a refinement of Salsa20, which is one of the ciphers picked for the eSTREAM portfolio [ESTREAM], and it was the core of the SHA-3 finalist BLAKE π. Iconic lineage, honestly.
the version of ChaCha in this doc has 20 rounds, a 96-bit nonce, and a 256-bit key. It's called "ChaCha20" π. It's the conservative option when it comes to security in the ChaCha family, and it's described in [RFC7539] π«Ά.
Poly1305 [POLY1305] is a Wegman-Carter, one-time authenticator that D. J. Bernstein designed π. It takes a 256-bit one-time key and a message, and it spits out a 16-byte tag. The tag authenticates the message so that an attacker has a negligible chance of making a valid tag for a fake message π. It's also described in [RFC7539] π .
ChaCha and Poly1305 were both built for high performance in software β‘. They usually have compact implementations that use few resources and cheap operations, so they fit a wide range of architectures πΈ. They were also designed to minimize information leaking through side channels π.
now the drama. Recent attacks [CBC-ATTACK] showed problems with the CBC-mode cipher suites in TLS and DTLS π. There were also issues with RC4, which was the only supported stream cipher [RC4-ATTACK] π. The existing AEAD cipher suites based on AES-GCM fix some of these issues, but people are worried about their performance and how easy they are to implement in software π.
so the plan is a new stream cipher to replace RC4 and fix all the earlier problems π. This doc describes a secure stream cipher for both TLS and DTLS. It's comparable to RC4 in speed on a wide range of platforms, and it can be implemented easily without being vulnerable to software side-channel attacks π¦. Main character energy π.
2. ChaCha20 Cipher Suites π
the ChaCha20 and Poly1305 primitives get built into an AEAD algorithm [RFC5116] called AEAD_CHACHA20_POLY1305, as described in [RFC7539] π. This AEAD gets put into TLS and DTLS the way Section 6.2.3.3 of [RFC5246] says π«Ά.
AEAD_CHACHA20_POLY1305 needs a 96-bit nonce, and it gets built like this π:
- Take the 64-bit record sequence number, serialize it as an 8-byte, big-endian value, and pad it on the left with four
0x00bytes π§. - XOR the padded sequence number with the
client_write_IVwhen the client is sending, or with theserver_write_IVwhen the server is sending β¨.
in DTLS, the 64-bit seq_num is the 16-bit epoch concatenated with the 48-bit sequence_number πΈ.
okay so this nonce construction is different from the one AES-GCM uses in TLS 1.2, but it matches the scheme that's expected for TLS 1.3 π. The nonce comes from the record sequence number and the shared secret, and the recipient knows both π. The best part is that no explicit per-record nonce has to be sent π. That saves eight bytes per record, and it stops implementations from accidentally using a random nonce π. In the terms of [RFC5246], SecurityParameters.fixed_iv_length is twelve bytes and SecurityParameters.record_iv_length is zero bytes π¦.
the nonce thing is the big gotcha here, bestie. The nonce is built from the sequence number and the shared secret, so there's no random nonce to mess up π.
these cipher suites are defined β¨:
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = {0xCC, 0xA8}
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = {0xCC, 0xA9}
TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = {0xCC, 0xAA}
TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xCC, 0xAB}
TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xCC, 0xAC}
TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xCC, 0xAD}
TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 = {0xCC, 0xAE}
the DHE_RSA, ECDHE_RSA, ECDHE_ECDSA, PSK, ECDHE_PSK, DHE_PSK, and RSA_PSK key exchanges for these suites are unchanged π·. So they work the way [RFC5246], [RFC4492], and [RFC5489] already define them π«Ά.
the pseudorandom function (PRF) for every cipher suite in this doc is the TLS PRF with SHA-256 [FIPS180-4] as its hash function π.
(continued in part 2, stay tuned π«Άπ )
5.2. Informative References β¨
okay so these are the informative ones, aka the "good to know" sources. they're not required reading, but they're where the receipts are π
[CBC-ATTACK]AlFardan, N. and K. Paterson, "Lucky Thirteen: Breaking the TLS and DTLS Record Protocols", IEEE Symposium on Security and Privacy, 2013,http://www.ieee-security.org/TC/SP2013/papers/4977a526.pdf.[CHACHA]Bernstein, D., "ChaCha, a variant of Salsa20", January 2008,http://cr.yp.to/chacha/chacha-20080128.pdf.[ESTREAM]Babbage, S., DeCanniere, C., Cantenaut, A., Cid, C., Gilbert, H., Johansson, T., Parker, M., Preneel, B., Rijmen, V., and M. Robshaw, "The eSTREAM Portfolio (rev. 1)", September 2008,http://www.ecrypt.eu.org/stream/finallist.html.[NIST-SHA3]Chang, S., Perlner, R., Burr, W., Turan, M., Kelsey, J., Paul, S., and L. Bassham, "Third-Round Report of the SHA-3 Cryptographic Hash Algorithm Competition", DOI 10.6028/NIST.IR.7896, November 2012,http://dx.doi.org/10.6028/NIST.IR.7896.[POLY1305]Bernstein, D., "The Poly1305-AES message-authentication code", FSE '05 Proceedings of the 12th international conference on Fast Software Encryption Pages 32-49, DOI 10.1007/11502760_3, February 2005,http://cr.yp.to/mac/poly1305-20050329.pdf.[RC4-ATTACK]Isobe, T., Ohigashi, T., Watanabe, Y., and M. Morii, "Full Plaintext Recovery Attack on Broadcast RC4", International Workshop on Fast Software Encryption FSE, DOI 10.1007/978-3-662-43933-3_10, 2013,http://www.iacr.org/archive/fse2013/84240167/84240167.pdf.[RFC5116]McGrew, D., "An Interface and Algorithms for Authenticated Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008,http://www.rfc-editor.org/info/rfc5116.[SALSA20-ATTACK]Aumasson, J-P., Fischer, S., Khazaei, S., Meier, W., and C. Rechberger, "New Features of Latin Dances: Analysis of Salsa, ChaCha, and Rumba", DOI 10.1007/978-3-540-71039-4_30, 2007,http://eprint.iacr.org/2007/472.pdf.[SALSA20-SECURITY]Bernstein, D., "Salsa20 security", April 2005,http://cr.yp.to/snuffle/security.pdf.[SALSA20SPEC]Bernstein, D., "Salsa20 specification", April 2005,http://cr.yp.to/snuffle/spec.pdf.
Acknowledgements
The authors would like to thank Zooko Wilcox-O'Hearn, Samuel Neves, and Colm MacCarthaigh for their suggestions and guidance. π«Ά
Authors' Addresses π
- Adam Langley, Google, Inc., Email:
agl@google.comπ - Wan-Teh Chang, Google, Inc., Email:
wtc@google.comπΈ - Nikos Mavrogiannopoulos, Red Hat, Email:
nmav@redhat.comπ¦ - Joachim Strombergson, Secworks Sweden AB, Email:
joachim@secworks.se, URI:http://secworks.se/π§ - Simon Josefsson, SJD AB, Email:
simon@josefsson.org, URI:http://josefsson.org/π
the whole crew, iconic. the end of RFC 7905, periodt πβ¨
π¦ where this page comes from
- ietf: rfc7905 2016-06
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms