RFC 7251

AES-CCM Elliptic Curve Cryptography (ECC) Cipher Suites for TLS

πŸ“… published June 2014, from ietf

RFC 7251: AES-CCM Elliptic Curve Cryptography (ECC) Cipher Suites for TLS ✨

Okay bestie, let's get the basics down first πŸ’…

  • Number: RFC 7251
  • Stream: Internet Engineering Task Force (IETF)
  • Category: Informational, so it's published for information and is not a Standards Track spec πŸŽ€
  • Date: June 2014
  • ISSN: 2070-1721
  • Authors: D. McGrew (Cisco Systems), D. Bailey (Ruhr-University Bochum), M. Campagna and R. Dugal (Certicom Corp.)
  • Obsoletes / Updates: Nothing listed in the header, so it doesn't obsolete or update any other RFC πŸ¦‹

Abstract

Okay so this memo is all about using AES in Counter and CBC-MAC Mode (CCM) inside Transport Layer Security (TLS) πŸ” to get confidentiality and data-origin authentication. AES-CCM is super compact to implement, which makes it perfect for constrained environments, and it still gives you a high level of security. ✨ The cipher suites in here use Elliptic Curve Cryptography (ECC), and they're extra helpful on networks with limited bandwidth. πŸ“

Status of This Memo

Real talk, this one is not an Internet Standards Track spec. It's just published for informational purposes 🧚

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community, it got public review, and the Internet Engineering Steering Group (IESG) approved it for publication. Not every IESG-approved document is a candidate for any level of Internet Standard, though. See Section 2 of RFC 5741 for the deets. πŸ™ˆ

Want the current status, any errata, or a way to send feedback? Check http://www.rfc-editor.org/info/rfc7251 πŸ’œ

Copyright (c) 2014 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 stand on the publication date. Please read these carefully, because they explain your rights and restrictions for this document. Code Components pulled out of this document have to include the Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as the Simplified BSD License describes. πŸ“œ

Table of Contents

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
  1.1.  Conventions Used in This Document . . . . . . . . . . . .   3
2.  ECC-Based AES-CCM Cipher Suites . . . . . . . . . . . . . . .   3
  2.1.  AEAD Algorithms . . . . . . . . . . . . . . . . . . . . .   5
  2.2.  Requirements on Curves and Hashes . . . . . . . . . . . .   5
3.  TLS Versions  . . . . . . . . . . . . . . . . . . . . . . . .   5
4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   6
5.  Security Considerations . . . . . . . . . . . . . . . . . . .   6
  5.1.  Perfect Forward Secrecy . . . . . . . . . . . . . . . . .   6
  5.2.  Counter Reuse . . . . . . . . . . . . . . . . . . . . . .   6
  5.3.  Hardware Security Modules . . . . . . . . . . . . . . . .   6
6.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .   6
7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   7
  7.1.  Normative References  . . . . . . . . . . . . . . . . . .   7
  7.2.  Informative References  . . . . . . . . . . . . . . . . .   8
Appendix A.  Recommended Curves and Algorithms  . . . . . . . . .   9

1. Introduction πŸ¦‹

Okay, the intro: this doc describes using Advanced Encryption Standard (AES) [AES] in Counter with CBC-MAC Mode (CCM) [CCM] in several TLS cipher suites. AES-CCM gives you both authentication and confidentiality (encryption and decryption), and its only primitive is the AES encrypt block cipher operation. That's why it's so compact to implement, which is great for constrained environments. Of course, it also needs to be adopted outside constrained environments so things can interoperate, like web clients talking to embedded servers, or embedded clients talking to web servers 🌐 AES-CCM has already been specified for the IPsec Encapsulating Security Payload (ESP) [RFC4309] and for 802.15.4 wireless networks [IEEE802154]. Iconic. πŸ‘‘

Authenticated encryption doesn't just keep the plaintext confidential, it also gives you a way to check that the plaintext hasn't been messed with and really came from who it says. Authenticated Encryption with Associated Data, or AEAD [RFC5116], goes one step further: it can also check the integrity and authenticity of some associated data that doesn't get encrypted. This memo uses the AEAD facility inside TLS 1.2 [RFC5246], along with the AES-CCM-based AEAD algorithms from [RFC5116] and [RFC6655]. All of these algorithms use AES-CCM. Some have shorter authentication tags, which makes them a better fit for networks where bandwidth is tight and messages might be small. πŸ₯Ί

The cipher suites in this document use Ephemeral Elliptic Curve Diffie-Hellman (ECDHE) as their key establishment mechanism, and they can be used with DTLS [RFC6347] too πŸ’–

1.1. Conventions Used in This Document

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. πŸ“–


2. ECC-Based AES-CCM Cipher Suites 🌸

Okay the main event ✨ The cipher suites here are built on the AES-CCM Authenticated Encryption with Associated Data (AEAD) algorithms AEAD_AES_128_CCM and AEAD_AES_256_CCM from [RFC5116]. These four are defined:

CipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CCM = {0xC0,0xAC}
CipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CCM = {0xC0,0xAD}
CipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 = {0xC0,0xAE}
CipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 = {0xC0,0xAF}

These cipher suites use the AEAD capability in TLS 1.2 [RFC5246]. Every one of these AEAD algorithms uses AES-CCM, so no shade there πŸ’… Suites ending in "8" use eight-octet authentication tags, and the others have 16-octet authentication tags. Easy way to remember it: the "8" ones are the shorter-tag, bandwidth-friendly babies 🧚

The HMAC truncation option from Section 7 of [RFC6066] (the one that negotiates the "truncated_hmac" TLS extension) doesn't do anything to the cipher suites in this note, because they don't use HMAC to protect TLS records. Not on my watch, HMAC πŸ™…β€β™€οΈ

The "nonce" input to the AEAD algorithm is defined in [RFC6655]. πŸ”’

In DTLS, the 64-bit seq_num field is the 16-bit DTLS epoch field concatenated with the 48-bit sequence_number field. The epoch and sequence_number show up in the DTLS record layer. Bestie, that's a whole combo πŸ’œ

This construction lets the internal counter be 32 bits long, which is a super convenient size for CCM. πŸŽ€

These cipher suites use the default TLS 1.2 Pseudorandom Function (PRF), which runs HMAC with the SHA-256 hash function. ✨

The ECDHE_ECDSA key exchange is done as defined in [RFC4492], with these extra stipulations:

  • Curves with a cofactor equal to one SHOULD be used; this simplifies their use. πŸ¦‹
  • The uncompressed point format MUST be supported. Other point formats MAY be used. πŸ’…
  • The client SHOULD offer the elliptic_curves extension, and the server SHOULD expect to receive it. 🫢
  • The client MAY offer the ec_point_formats extension, but the server need not expect to receive it. 🌈
  • Fundamental ECC algorithms [RFC6090] MAY be used as an implementation method. πŸ“
  • If the server uses a certificate, then the requirements in RFC 4492 apply: "The server's certificate MUST contain an ECDSA-capable public key and be signed with ECDSA." Guidance on acceptable choices of hashes and curves for each cipher suite is in Section 2.2. The Signature Algorithms extension (Section 7.4.1.4.1 of [RFC5246]) SHOULD be used to indicate support for those signature and hash algorithms. If a client certificate is used, the same criteria SHOULD apply to it. πŸ”

Implementations of these cipher suites will interoperate with [RFC4492], but they can be more compact than a full implementation of that RFC. Compact AND interoperable? Iconic πŸ’–

2.1. AEAD Algorithms

These AEAD algorithms are used:

AEAD_AES_128_CCM is used in the TLS_ECDHE_ECDSA_WITH_AES_128_CCM
cipher suite,

AEAD_AES_256_CCM is used in the TLS_ECDHE_ECDSA_WITH_AES_256_CCM
cipher suite,

AEAD_AES_128_CCM_8 is used in the
TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 cipher suite, and

AEAD_AES_256_CCM_8 is used in the
TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 cipher suite.

2.2. Requirements on Curves and Hashes

Okay here's the vibe check for picking your crypto parameters 🌈 Implementations SHOULD select elliptic curves and hash functions so that AES-128 is paired with a curve and a hash function that support a 128-bit security level, and AES-256 is paired with a curve and a hash function that support a 192-bit or 256-bit security level. More detailed guidance on picking cryptographic parameters is in [SP800-57] (see especially Tables 2 and 3). πŸ“Š

Appendix A describes suitable curves and hash functions that are widely available. 🧚


3. TLS Versions πŸ‘‘

These cipher suites use the authenticated encryption with additional data defined in TLS 1.2 [RFC5288]. Important, so listen up: they MUST NOT be negotiated in older versions of TLS. Clients MUST NOT offer these cipher suites if they don't offer TLS 1.2 or later. Servers that pick an earlier version of TLS MUST NOT pick one of these cipher suites. 🚫

Earlier versions don't support AEAD. For example, the TLSCiphertext structure doesn't have the "aead" option in TLS 1.1. πŸ™ˆ

Because TLS has no way for the client to say "I support TLS 1.2 but not earlier," a non-compliant server might negotiate TLS 1.1 or earlier and pick one of the cipher suites in this document. Ugh, that's so messy 😭 So, Clients MUST check the TLS version and generate a fatal "illegal_parameter" alert if they detect an incorrect version. 🚨


4. IANA Considerations πŸŽ€

IANA has assigned the values for the cipher suites defined in Section 2 from the "TLS Cipher Suite Registry". The DTLS-OK column has been marked as "Y" for each of these algorithms. βœ…


5. Security Considerations πŸ”

Heads up, this section is serious business, so no skipping it. πŸ’€

5.1. Perfect Forward Secrecy

The perfect forward secrecy properties of ephemeral Diffie-Hellman cipher suites are discussed in the security analysis of [RFC5246]. This analysis applies to the ECDHE cipher suites. πŸ’œ

5.2. Counter Reuse

AES-CCM security requires that the counter NEVER be reused, bestie. Never. 😱 The IV construction in Section 2 is designed to prevent counter reuse. πŸ›‘οΈ

5.3. Hardware Security Modules ✨

okay bestie, so a cipher suite can be set up so the secret keys and private keys live inside a Hardware Security Module (HSM) πŸ”. The crypto operations on those keys are done by the HSM, and the app talks to it through something like the Cryptographic Token Interface Standard [PKCS11] πŸ’…. Here's the tea: when an AEAD cipher suite (like the ones in this note) gets built this way, the nonce needs special handling πŸ™ˆ. The "salt" part of the nonce is set to the client_write_IV or server_write_IV, and that value is a function of the TLS master secret, so it's not a casual thing to mess with πŸ‘‘.

Another lowkey tricky bit with the Cryptographic Token Interface Standard: you can't use the DecryptUpdate function with the CCM decrypt operation, or with the decrypt operation of any other authenticated encryption method πŸ’€. Why? DecryptUpdate needs the post-decryption plaintext to be handed back before the authentication check is finished, and that just doesn't work for AEAD 😭.


6. Acknowledgements 🫢

This document borrows heavily from [RFC5288] πŸŽ€. Huge thanks to Robert Cragie for helping make this work complete, correct, and useful, and to Peter Dettman for reviewing it 🌸. Thanks also to Mike StJohns for pointing out the HSM issues 🧚.

This document is motivated by the considerations raised in the Zigbee Smart Energy 2.0 working group πŸ¦‹.

7. References πŸ“š

7.1. Normative References

  • [AES] National Institute of Standards and Technology, "Specification for the Advanced Encryption Standard (AES)", FIPS 197, November 2001.
  • [CCM] National Institute of Standards and Technology, "Recommendation for Block Cipher Modes of Operation: The CCM Mode for Authentication and Confidentiality", SP 800-38C, May 2004.
  • [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  • [RFC4492] Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C., and B. Moeller, "Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS)", RFC 4492, May 2006.
  • [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated Encryption", RFC 5116, January 2008.
  • [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, August 2008.
  • [RFC5288] Salowey, J., Choudhury, A., and D. McGrew, "AES Galois Counter Mode (GCM) Cipher Suites for TLS", RFC 5288, August 2008.
  • [RFC5639] Lochter, M. and J. Merkle, "Elliptic Curve Cryptography (ECC) Brainpool Standard Curves and Curve Generation", RFC 5639, March 2010.
  • [RFC6066] Eastlake, D., "Transport Layer Security (TLS) Extensions: Extension Definitions", RFC 6066, January 2011.
  • [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic Curve Cryptography Algorithms", RFC 6090, February 2011.
  • [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer Security Version 1.2", RFC 6347, January 2012.
  • [RFC6655] McGrew, D. and D. Bailey, "AES-CCM Cipher Suites for Transport Layer Security (TLS)", RFC 6655, July 2012.
  • [SP800-57] National Institute of Standards and Technology, "Recommendation for Key Management - Part 1: General (Revision 3)", SP 800-57 Part 1, July 2012.

7.2. Informative References

  • [IEEE802154] IEEE, "Wireless Personal Area Networks", IEEE Standard 802.15.4-2006, 2006.
  • [PKCS11] RSA Laboratories, "PKCS #11: Cryptographic Token Interface Standard version 2.20", Public Key Cryptography Standards PKCS#11-v2.20, 2004.
  • [RFC4309] Housley, R., "Using Advanced Encryption Standard (AES) CCM Mode with IPsec Encapsulating Security Payload (ESP)", RFC 4309, December 2005.

This memo doesn't mandate any particular elliptic curves or cryptographic algorithms, for the sake of flexibility πŸ’–. BUT, since the main motivation for the AES-CCM-ECC cipher suites is their suitability for constrained environments, it's valuable to identify a particular suitable set of curves and algorithms ✨.

This appendix identifies a set of elliptic curves and cryptographic algorithms that meet the requirements of this note and that are widely supported and believed to be secure πŸ”₯.

The curves and hash algorithms recommended for each cipher suite are:

  • An implementation that includes either TLS_ECDHE_ECDSA_WITH_AES_128_CCM or TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 SHOULD support the secp256r1 curve and the SHA-256 hash function.
  • An implementation that includes either TLS_ECDHE_ECDSA_WITH_AES_256_CCM or TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 SHOULD support the secp384r1 curve and the SHA-384 hash function, and MAY support the secp521r1 curve and the SHA-512 hash function.

More information about the secp256r1, secp384r1, and secp521r1 curves is available in Appendix A of [RFC4492] 🧚.

It is not necessary to implement the above curves and hash functions in order to conform to this specification. Other elliptic curves, such as the Brainpool curves [RFC5639], for example, meet the criteria laid out in this memo πŸ¦‹.

Authors' Addresses πŸŽ€

David McGrew Cisco Systems 13600 Dulles Technology Drive Herndon, VA 20171 USA

EMail: mcgrew@cisco.com

Daniel V. Bailey Ruhr-University Bochum Universitatsstr. 150 44801 Bochum Germany

EMail: danbailey@sth.rub.de

Matthew Campagna Certicom Corp. 5520 Explorer Drive #400 Mississauga, Ontario L4W 5L1 Canada

EMail: mcampagna@gmail.com

Robert Dugal Certicom Corp. 4701 Tahoe Blvd., Building A Mississauga, Ontario L4W 0B5 Canada

EMail: rdugal@certicom.com

πŸ“¦ where this page comes from