idnits 2.17.1 draft-ietf-cose-rfc8152bis-algs-11.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: ---------------------------------------------------------------------------- == There is 1 instance of lines with non-ascii characters in the document. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The draft header indicates that this document obsoletes RFC8152, but the abstract doesn't seem to directly say this. It does mention RFC8152 though, so this could be OK. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (1 July 2020) is 1393 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-15) exists of draft-ietf-cose-rfc8152bis-struct-10 ** Obsolete normative reference: RFC 7049 (Obsoleted by RFC 8949) -- Obsolete informational reference (is this intentional?): RFC 8152 (Obsoleted by RFC 9052, RFC 9053) == Outdated reference: A later version (-21) exists of draft-ietf-core-oscore-groupcomm-09 == Outdated reference: A later version (-04) exists of draft-mattsson-cfrg-det-sigs-with-noise-02 == Outdated reference: A later version (-34) exists of draft-ietf-quic-tls-29 Summary: 1 error (**), 0 flaws (~~), 6 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 COSE Working Group J. Schaad 3 Internet-Draft August Cellars 4 Obsoletes: 8152 (if approved) 1 July 2020 5 Intended status: Informational 6 Expires: 2 January 2021 8 CBOR Object Signing and Encryption (COSE): Initial Algorithms 9 draft-ietf-cose-rfc8152bis-algs-11 11 Abstract 13 Concise Binary Object Representation (CBOR) is a data format designed 14 for small code size and small message size. There is a need for the 15 ability to have basic security services defined for this data format. 16 THis document defines a set of algorithms that can be used with the 17 CBOR Object Signing and Encryption (COSE) protocol RFC XXXX. 19 Contributing to this document 21 This note is to be removed before publishing as an RFC. 23 The source for this draft is being maintained in GitHub. Suggested 24 changes should be submitted as pull requests at https://github.com/ 25 cose-wg/cose-rfc8152bis. Instructions are on that page as well. 26 Editorial changes can be managed in GitHub, but any substantial 27 issues need to be discussed on the COSE mailing list. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on 2 January 2021. 46 Copyright Notice 48 Copyright (c) 2020 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 53 license-info) in effect on the date of publication of this document. 54 Please review these documents carefully, as they describe your rights 55 and restrictions with respect to this document. Code Components 56 extracted from this document must include Simplified BSD License text 57 as described in Section 4.e of the Trust Legal Provisions and are 58 provided without warranty as described in the Simplified BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 63 1.1. Requirements Terminology . . . . . . . . . . . . . . . . 4 64 1.2. Changes from RFC8152 . . . . . . . . . . . . . . . . . . 4 65 1.3. Document Terminology . . . . . . . . . . . . . . . . . . 4 66 1.4. CBOR Grammar . . . . . . . . . . . . . . . . . . . . . . 5 67 1.5. Examples . . . . . . . . . . . . . . . . . . . . . . . . 5 68 2. Signature Algorithms . . . . . . . . . . . . . . . . . . . . 5 69 2.1. ECDSA . . . . . . . . . . . . . . . . . . . . . . . . . . 5 70 2.1.1. Security Considerations for ECDSA . . . . . . . . . . 7 71 2.2. Edwards-Curve Digital Signature Algorithms (EdDSAs) . . . 8 72 2.2.1. Security Considerations for EdDSA . . . . . . . . . . 9 73 3. Message Authentication Code (MAC) Algorithms . . . . . . . . 9 74 3.1. Hash-Based Message Authentication Codes (HMACs) . . . . . 9 75 3.1.1. Security Considerations for HMAC . . . . . . . . . . 11 76 3.2. AES Message Authentication Code (AES-CBC-MAC) . . . . . . 11 77 3.2.1. Security Considerations AES-CBC_MAC . . . . . . . . . 12 78 4. Content Encryption Algorithms . . . . . . . . . . . . . . . . 12 79 4.1. AES GCM . . . . . . . . . . . . . . . . . . . . . . . . . 12 80 4.1.1. Security Considerations for AES-GCM . . . . . . . . . 13 81 4.2. AES CCM . . . . . . . . . . . . . . . . . . . . . . . . . 14 82 4.2.1. Security Considerations for AES-CCM . . . . . . . . . 17 83 4.3. ChaCha20 and Poly1305 . . . . . . . . . . . . . . . . . . 18 84 4.3.1. Security Considerations for ChaCha20/Poly1305 . . . . 19 85 5. Key Derivation Functions (KDFs) . . . . . . . . . . . . . . . 19 86 5.1. HMAC-Based Extract-and-Expand Key Derivation Function 87 (HKDF) . . . . . . . . . . . . . . . . . . . . . . . . . 19 88 5.2. Context Information Structure . . . . . . . . . . . . . . 21 89 6. Content Key Distribution Methods . . . . . . . . . . . . . . 26 90 6.1. Direct Encryption . . . . . . . . . . . . . . . . . . . . 27 91 6.1.1. Direct Key . . . . . . . . . . . . . . . . . . . . . 27 92 6.1.2. Direct Key with KDF . . . . . . . . . . . . . . . . . 28 93 6.2. Key Wrap . . . . . . . . . . . . . . . . . . . . . . . . 29 94 6.2.1. AES Key Wrap . . . . . . . . . . . . . . . . . . . . 30 95 6.3. Direct Key Agreement . . . . . . . . . . . . . . . . . . 31 96 6.3.1. Direct ECDH . . . . . . . . . . . . . . . . . . . . . 31 97 6.4. Key Agreement with Key Wrap . . . . . . . . . . . . . . . 34 98 6.4.1. ECDH with Key Wrap . . . . . . . . . . . . . . . . . 35 99 7. Key Object Parameters . . . . . . . . . . . . . . . . . . . . 37 100 7.1. Elliptic Curve Keys . . . . . . . . . . . . . . . . . . . 37 101 7.1.1. Double Coordinate Curves . . . . . . . . . . . . . . 38 102 7.2. Octet Key Pair . . . . . . . . . . . . . . . . . . . . . 39 103 7.3. Symmetric Keys . . . . . . . . . . . . . . . . . . . . . 40 104 8. COSE Capabilities . . . . . . . . . . . . . . . . . . . . . . 41 105 8.1. Assignments for Existing Algorithms . . . . . . . . . . . 42 106 8.2. Assignments for Existing Key Types . . . . . . . . . . . 42 107 8.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . 42 108 9. CBOR Encoding Restrictions . . . . . . . . . . . . . . . . . 45 109 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 45 110 10.1. Changes to "COSE Key Types" registry. . . . . . . . . . 45 111 10.2. Changes to "COSE Algorithms" registry . . . . . . . . . 46 112 10.3. Changes to the "COSE Key Type Parameters" registry . . . 46 113 10.4. COSE Header Algorithm Parameters Registry . . . . . . . 47 114 10.5. Expert Review Instructions . . . . . . . . . . . . . . . 47 115 11. Security Considerations . . . . . . . . . . . . . . . . . . . 48 116 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 50 117 12.1. Normative References . . . . . . . . . . . . . . . . . . 50 118 12.2. Informative References . . . . . . . . . . . . . . . . . 52 119 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 54 120 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 55 122 1. Introduction 124 There has been an increased focus on small, constrained devices that 125 make up the Internet of Things (IoT). One of the standards that has 126 come out of this process is "Concise Binary Object Representation 127 (CBOR)" [RFC7049]. CBOR extended the data model of JavaScript Object 128 Notation (JSON) [STD90] by allowing for binary data, among other 129 changes. CBOR is being adopted by several of the IETF working groups 130 dealing with the IoT world as their encoding of data structures. 131 CBOR was designed specifically to be both small in terms of messages 132 transported and implementation size and be a schema-free decoder. A 133 need exists to provide message security services for IoT, and using 134 CBOR as the message-encoding format makes sense. 136 The core COSE specification consists of two documents. 137 [I-D.ietf-cose-rfc8152bis-struct] contains the serialization 138 structures and the procedures for using the different cryptographic 139 algorithms. This document provides an initial set of algorithms for 140 use with those structures. 142 1.1. Requirements Terminology 144 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 145 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 146 "OPTIONAL" in this document are to be interpreted as described in BCP 147 14 [RFC2119] [RFC8174] when, and only when, they appear in all 148 capitals, as shown here. 150 1.2. Changes from RFC8152 152 * Extract the sections dealing with specific algorithms into this 153 document. The sections dealing with structure and general 154 processing rules are placed in [I-D.ietf-cose-rfc8152bis-struct]. 156 * Text clarifications and changes in terminology. 158 1.3. Document Terminology 160 In this document, we use the following terminology: 162 Byte is a synonym for octet. 164 Constrained Application Protocol (CoAP) is a specialized web transfer 165 protocol for use in constrained systems. It is defined in [RFC7252]. 167 Authenticated Encryption (AE) [RFC5116] algorithms are encryption 168 algorithms that provide an authentication check of the contents with 169 the encryption service. An example of an AE algorithm used in COSE 170 is AES Key Wrap [RFC3394]. These algorithms are used for key 171 encryption algorithms, but AEAD algorithms would be preferred. 173 Authenticated Encryption with Associated Data (AEAD) [RFC5116] 174 algorithms provide the same authentication service of the content as 175 AE algorithms do. They also allow for associated data to be included 176 in the authentication service, but which is not part of the encrypted 177 body. An example of an AEAD algorithm used in COSE is AES-GCM 178 [RFC5116]. These algorithms are used for content encryption and can 179 be used for key encryption as well. 181 The term 'byte string' is used for sequences of bytes, while the term 182 'text string' is used for sequences of characters. 184 The tables for algorithms contain the following columns: 186 * A name for use in documents for the algorithms. 188 * The value used on the wire for the algorithm. One place this is 189 used is the algorithm header parameter of a message. 191 * A short description so that the algorithm can be easily identified 192 when scanning the IANA registry. 194 Additional columns may be present in the table depending on the 195 algorithms. 197 1.4. CBOR Grammar 199 At the time that [RFC8152] was initially published, the CBOR Data 200 Definition Language (CDDL) [RFC8610] had not yet been published. 201 This document uses a variant of CDDL which is described in 202 [I-D.ietf-cose-rfc8152bis-struct]. 204 1.5. Examples 206 A GitHub project has been created at [GitHub-Examples] that contains 207 a set of testing examples as well. Each example is found in a JSON 208 file that contains the inputs used to create the example, some of the 209 intermediate values that can be used for debugging, and the output of 210 the example. The results are encoded using both hexadecimal and CBOR 211 diagnostic notation format. 213 Some of the examples are designed to test failure case; these are 214 clearly marked as such in the JSON file. If errors in the examples 215 in this document are found, the examples on GitHub will be updated, 216 and a note to that effect will be placed in the JSON file. 218 2. Signature Algorithms 220 Section 9.1 of [I-D.ietf-cose-rfc8152bis-struct] contains a generic 221 description of signature algorithms. The document defines signature 222 algorithm identifiers for two signature algorithms. 224 2.1. ECDSA 226 ECDSA [DSS] defines a signature algorithm using ECC. Implementations 227 SHOULD use a deterministic version of ECDSA such as the one defined 228 in [RFC6979]. The use of a deterministic signature algorithm allows 229 for systems to avoid relying on random number generators in order to 230 avoid generating the same value of 'k' (the per-message random 231 value). Biased generation of the value 'k' can be attacked, and 232 collisions of this value leads to leaked keys. It additionally 233 allows for doing deterministic tests for the signature algorithm. 234 The use of deterministic ECDSA does not lessen the need to have good 235 random number generation when creating the private key. 237 The ECDSA signature algorithm is parameterized with a hash function 238 (h). In the event that the length of the hash function output is 239 greater than the group of the key, the leftmost bytes of the hash 240 output are used. 242 The algorithms defined in this document can be found in Table 1. 244 +=======+=======+=========+==================+ 245 | Name | Value | Hash | Description | 246 +=======+=======+=========+==================+ 247 | ES256 | -7 | SHA-256 | ECDSA w/ SHA-256 | 248 +-------+-------+---------+------------------+ 249 | ES384 | -35 | SHA-384 | ECDSA w/ SHA-384 | 250 +-------+-------+---------+------------------+ 251 | ES512 | -36 | SHA-512 | ECDSA w/ SHA-512 | 252 +-------+-------+---------+------------------+ 254 Table 1: ECDSA Algorithm Values 256 This document defines ECDSA to work only with the curves P-256, 257 P-384, and P-521. This document requires that the curves be encoded 258 using the 'EC2' (two coordinate elliptic curve) key type. 259 Implementations need to check that the key type and curve are correct 260 when creating and verifying a signature. Future documents may define 261 it to work with other curves and points in the future. 263 In order to promote interoperability, it is suggested that SHA-256 be 264 used only with curve P-256, SHA-384 be used only with curve P-384, 265 and SHA-512 be used with curve P-521. This is aligned with the 266 recommendation in Section 4 of [RFC5480]. 268 The signature algorithm results in a pair of integers (R, S). These 269 integers will be the same length as the length of the key used for 270 the signature process. The signature is encoded by converting the 271 integers into byte strings of the same length as the key size. The 272 length is rounded up to the nearest byte and is left padded with zero 273 bits to get to the correct length. The two integers are then 274 concatenated together to form a byte string that is the resulting 275 signature. 277 Using the function defined in [RFC8017], the signature is: 279 Signature = I2OSP(R, n) | I2OSP(S, n) 281 where n = ceiling(key_length / 8) 283 When using a COSE key for this algorithm, the following checks are 284 made: 286 * The 'kty' field MUST be present, and it MUST be 'EC2'. 288 * If the 'alg' field is present, it MUST match the ECDSA signature 289 algorithm being used. 291 * If the 'key_ops' field is present, it MUST include 'sign' when 292 creating an ECDSA signature. 294 * If the 'key_ops' field is present, it MUST include 'verify' when 295 verifying an ECDSA signature. 297 2.1.1. Security Considerations for ECDSA 299 The security strength of the signature is no greater than the minimum 300 of the security strength associated with the bit length of the key 301 and the security strength of the hash function. 303 Note: Use of a deterministic signature technique is a good idea even 304 when good random number generation exists. Doing so both reduces the 305 possibility of having the same value of 'k' in two signature 306 operations and allows for reproducible signature values, which helps 307 testing. There have been recent attacks involving faulting the 308 device in order to extract the key. This can be addressed by 309 combining both randomness and determinism 310 [I-D.mattsson-cfrg-det-sigs-with-noise]. 312 There are two substitution attacks that can theoretically be mounted 313 against the ECDSA signature algorithm. 315 * Changing the curve used to validate the signature: If one changes 316 the curve used to validate the signature, then potentially one 317 could have two messages with the same signature, each computed 318 under a different curve. The only requirement on the new curve is 319 that its order be the same as the old one and it be acceptable to 320 the client. An example would be to change from using the curve 321 secp256r1 (aka P-256) to using secp256k1. (Both are 256-bit 322 curves.) We currently do not have any way to deal with this 323 version of the attack except to restrict the overall set of curves 324 that can be used. 326 * Change the hash function used to validate the signature: If one 327 either has two different hash functions of the same length or can 328 truncate a hash function, then one could potentially find 329 collisions between the hash functions rather than within a single 330 hash function (for example, truncating SHA-512 to 256 bits might 331 collide with a SHA-256 bit hash value). As the hash algorithm is 332 part of the signature algorithm identifier, this attack is 333 mitigated by including a signature algorithm identifier in the 334 protected header bucket. 336 2.2. Edwards-Curve Digital Signature Algorithms (EdDSAs) 338 [RFC8032] describes the elliptic curve signature scheme Edwards-curve 339 Digital Signature Algorithm (EdDSA). In that document, the signature 340 algorithm is instantiated using parameters for edwards25519 and 341 edwards448 curves. The document additionally describes two variants 342 of the EdDSA algorithm: Pure EdDSA, where no hash function is applied 343 to the content before signing, and HashEdDSA, where a hash function 344 is applied to the content before signing and the result of that hash 345 function is signed. For EdDSA, the content to be signed (either the 346 message or the pre-hash value) is processed twice inside of the 347 signature algorithm. For use with COSE, only the pure EdDSA version 348 is used. This is because it is not expected that extremely large 349 contents are going to be needed and, based on the arrangement of the 350 message structure, the entire message is going to need to be held in 351 memory in order to create or verify a signature. This means that 352 there does not appear to be a need to be able to do block updates of 353 the hash, followed by eliminating the message from memory. 354 Applications can provide the same features by defining the content of 355 the message as a hash value and transporting the COSE object (with 356 the hash value) and the content as separate items. 358 The algorithms defined in this document can be found in Table 2. A 359 single signature algorithm is defined, which can be used for multiple 360 curves. 362 +=======+=======+=============+ 363 | Name | Value | Description | 364 +=======+=======+=============+ 365 | EdDSA | -8 | EdDSA | 366 +-------+-------+-------------+ 368 Table 2: EdDSA Algorithm Values 370 [RFC8032] describes the method of encoding the signature value. 372 When using a COSE key for this algorithm, the following checks are 373 made: 375 * The 'kty' field MUST be present, and it MUST be 'OKP' (Octet Key 376 Pair). 378 * The 'crv' field MUST be present, and it MUST be a curve defined 379 for this signature algorithm. 381 * If the 'alg' field is present, it MUST match 'EdDSA'. 383 * If the 'key_ops' field is present, it MUST include 'sign' when 384 creating an EdDSA signature. 386 * If the 'key_ops' field is present, it MUST include 'verify' when 387 verifying an EdDSA signature. 389 2.2.1. Security Considerations for EdDSA 391 How public values are computed is not the same when looking at EdDSA 392 and Elliptic Curve Diffie-Hellman (ECDH); for this reason, the public 393 key should not be used with the other algorithm. 395 If batch signature verification is performed, a well-seeded 396 cryptographic random number generator is REQUIRED (Section 8.2 of 397 [RFC8032]). Signing and non-batch signature verification are 398 deterministic operations and do not need random numbers of any kind. 400 3. Message Authentication Code (MAC) Algorithms 402 Section 9.2 of [I-D.ietf-cose-rfc8152bis-struct] contains a generic 403 description of MAC algorithms. This section defines the conventions 404 for two MAC algorithms. 406 3.1. Hash-Based Message Authentication Codes (HMACs) 408 HMAC [RFC2104] [RFC4231] was designed to deal with length extension 409 attacks. The algorithm was also designed to allow for new hash 410 algorithms to be directly plugged in without changes to the hash 411 function. The HMAC design process has been shown as solid since, 412 while the security of hash algorithms such as MD5 has decreased over 413 time; the security of HMAC combined with MD5 has not yet been shown 414 to be compromised [RFC6151]. 416 The HMAC algorithm is parameterized by an inner and outer padding, a 417 hash function (h), and an authentication tag value length. For this 418 specification, the inner and outer padding are fixed to the values 419 set in [RFC2104]. The length of the authentication tag corresponds 420 to the difficulty of producing a forgery. For use in constrained 421 environments, we define one HMAC algorithm that is truncated. There 422 are currently no known issues with truncation; however, the security 423 strength of the message tag is correspondingly reduced in strength. 424 When truncating, the leftmost tag length bits are kept and 425 transmitted. 427 The algorithms defined in this document can be found in Table 3. 429 +=============+=======+=========+============+======================+ 430 | Name | Value | Hash | Tag Length | Description | 431 +=============+=======+=========+============+======================+ 432 | HMAC | 4 | SHA-256 | 64 | HMAC w/ SHA-256 | 433 | 256/64 | | | | truncated to 64 bits | 434 +-------------+-------+---------+------------+----------------------+ 435 | HMAC | 5 | SHA-256 | 256 | HMAC w/ SHA-256 | 436 | 256/256 | | | | | 437 +-------------+-------+---------+------------+----------------------+ 438 | HMAC | 6 | SHA-384 | 384 | HMAC w/ SHA-384 | 439 | 384/384 | | | | | 440 +-------------+-------+---------+------------+----------------------+ 441 | HMAC | 7 | SHA-512 | 512 | HMAC w/ SHA-512 | 442 | 512/512 | | | | | 443 +-------------+-------+---------+------------+----------------------+ 445 Table 3: HMAC Algorithm Values 447 Some recipient algorithms transport the key, while others derive a 448 key from secret data. For those algorithms that transport the key 449 (such as AES Key Wrap), the size of the HMAC key SHOULD be the same 450 size as the output of the underlying hash function. For those 451 algorithms that derive the key (such as ECDH), the derived key MUST 452 be the same size as the underlying hash function. 454 When using a COSE key for this algorithm, the following checks are 455 made: 457 * The 'kty' field MUST be present, and it MUST be 'Symmetric'. 459 * If the 'alg' field is present, it MUST match the HMAC algorithm 460 being used. 462 * If the 'key_ops' field is present, it MUST include 'MAC create' 463 when creating an HMAC authentication tag. 465 * If the 'key_ops' field is present, it MUST include 'MAC verify' 466 when verifying an HMAC authentication tag. 468 Implementations creating and validating MAC values MUST validate that 469 the key type, key length, and algorithm are correct and appropriate 470 for the entities involved. 472 3.1.1. Security Considerations for HMAC 474 HMAC has proved to be resistant to attack even when used with 475 weakened hash algorithms. The current best known attack is to brute 476 force the key. This means that key size is going to be directly 477 related to the security of an HMAC operation. 479 3.2. AES Message Authentication Code (AES-CBC-MAC) 481 AES-CBC-MAC is defined in [MAC]. (Note that this is not the same 482 algorithm as AES Cipher-Based Message Authentication Code (AES-CMAC) 483 [RFC4493].) 485 AES-CBC-MAC is parameterized by the key length, the authentication 486 tag length, and the Initialization Vector (IV) used. For all of 487 these algorithms, the IV is fixed to all zeros. We provide an array 488 of algorithms for various key lengths and tag lengths. The 489 algorithms defined in this document are found in Table 4. 491 +=========+=======+============+============+==================+ 492 | Name | Value | Key Length | Tag Length | Description | 493 +=========+=======+============+============+==================+ 494 | AES-MAC | 14 | 128 | 64 | AES-MAC 128-bit | 495 | 128/64 | | | | key, 64-bit tag | 496 +---------+-------+------------+------------+------------------+ 497 | AES-MAC | 15 | 256 | 64 | AES-MAC 256-bit | 498 | 256/64 | | | | key, 64-bit tag | 499 +---------+-------+------------+------------+------------------+ 500 | AES-MAC | 25 | 128 | 128 | AES-MAC 128-bit | 501 | 128/128 | | | | key, 128-bit tag | 502 +---------+-------+------------+------------+------------------+ 503 | AES-MAC | 26 | 256 | 128 | AES-MAC 256-bit | 504 | 256/128 | | | | key, 128-bit tag | 505 +---------+-------+------------+------------+------------------+ 507 Table 4: AES-MAC Algorithm Values 509 Keys may be obtained either from a key structure or from a recipient 510 structure. Implementations creating and validating MAC values MUST 511 validate that the key type, key length, and algorithm are correct and 512 appropriate for the entities involved. 514 When using a COSE key for this algorithm, the following checks are 515 made: 517 * The 'kty' field MUST be present, and it MUST be 'Symmetric'. 519 * If the 'alg' field is present, it MUST match the AES-MAC algorithm 520 being used. 522 * If the 'key_ops' field is present, it MUST include 'MAC create' 523 when creating an AES-MAC authentication tag. 525 * If the 'key_ops' field is present, it MUST include 'MAC verify' 526 when verifying an AES-MAC authentication tag. 528 3.2.1. Security Considerations AES-CBC_MAC 530 A number of attacks exist against Cipher Block Chaining Message 531 Authentication Code (CBC-MAC) that need to be considered. 533 * A single key must only be used for messages of a fixed or known 534 length. If this is not the case, an attacker will be able to 535 generate a message with a valid tag given two message and tag 536 pairs. This can be addressed by using different keys for messages 537 of different lengths. The current structure mitigates this 538 problem, as a specific encoding structure that includes lengths is 539 built and signed. (CMAC also addresses this issue.) 541 * In cipher Block Chaining (CBC) mode, if the same key is used for 542 both encryption and authentication operations, an attacker can 543 produce messages with a valid authentication code. 545 * If the IV can be modified, then messages can be forged. This is 546 addressed by fixing the IV to all zeros. 548 4. Content Encryption Algorithms 550 Section 9.3 of [I-D.ietf-cose-rfc8152bis-struct] contains a generic 551 description of Content Encryption algorithms. This document defines 552 the identifier and usages for three content encryption algorithms. 554 4.1. AES GCM 556 The Galois/Counter Mode (GCM) mode is a generic AEAD block cipher 557 mode defined in [AES-GCM]. The GCM mode is combined with the AES 558 block encryption algorithm to define an AEAD cipher. 560 The GCM mode is parameterized by the size of the authentication tag 561 and the size of the nonce. This document fixes the size of the nonce 562 at 96 bits. The size of the authentication tag is limited to a small 563 set of values. For this document however, the size of the 564 authentication tag is fixed at 128 bits. 566 The set of algorithms defined in this document are in Table 5. 568 +=========+=======+==========================================+ 569 | Name | Value | Description | 570 +=========+=======+==========================================+ 571 | A128GCM | 1 | AES-GCM mode w/ 128-bit key, 128-bit tag | 572 +---------+-------+------------------------------------------+ 573 | A192GCM | 2 | AES-GCM mode w/ 192-bit key, 128-bit tag | 574 +---------+-------+------------------------------------------+ 575 | A256GCM | 3 | AES-GCM mode w/ 256-bit key, 128-bit tag | 576 +---------+-------+------------------------------------------+ 578 Table 5: Algorithm Value for AES-GCM 580 Keys may be obtained either from a key structure or from a recipient 581 structure. Implementations encrypting and decrypting MUST validate 582 that the key type, key length, and algorithm are correct and 583 appropriate for the entities involved. 585 When using a COSE key for this algorithm, the following checks are 586 made: 588 * The 'kty' field MUST be present, and it MUST be 'Symmetric'. 590 * If the 'alg' field is present, it MUST match the AES-GCM algorithm 591 being used. 593 * If the 'key_ops' field is present, it MUST include 'encrypt' or 594 'wrap key' when encrypting. 596 * If the 'key_ops' field is present, it MUST include 'decrypt' or 597 'unwrap key' when decrypting. 599 4.1.1. Security Considerations for AES-GCM 601 When using AES-GCM, the following restrictions MUST be enforced: 603 * The key and nonce pair MUST be unique for every message encrypted. 605 * The total number of messages encrypted for a single key MUST NOT 606 exceed 2^32 [SP800-38d]. An explicit check is required only in 607 environments where it is expected that it might be exceeded. 609 * A more recent analysis in [ROBUST] indicates that the the number 610 of failed decryptions needs to be taken into account as part 611 determining when a key roll-over is to be done. Following the 612 recommendation of for DTLS, the number of failed message 613 decryptions should be limited to 2^36. 615 Consideration was given to supporting smaller tag values; the 616 constrained community would desire tag sizes in the 64-bit range. 617 Doing so drastically changes both the maximum messages size 618 (generally not an issue) and the number of times that a key can be 619 used. Given that Counter with CBC-MAC (CCM) is the usual mode for 620 constrained environments, restricted modes are not supported. 622 4.2. AES CCM 624 CCM is a generic authentication encryption block cipher mode defined 625 in [RFC3610]. The CCM mode is combined with the AES block encryption 626 algorithm to define a commonly used content encryption algorithm used 627 in constrained devices. 629 The CCM mode has two parameter choices. The first choice is M, the 630 size of the authentication field. The choice of the value for M 631 involves a trade-off between message growth (from the tag) and the 632 probability that an attacker can undetectably modify a message. The 633 second choice is L, the size of the length field. This value 634 requires a trade-off between the maximum message size and the size of 635 the Nonce. 637 It is unfortunate that the specification for CCM specified L and M as 638 a count of bytes rather than a count of bits. This leads to possible 639 misunderstandings where AES-CCM-8 is frequently used to refer to a 640 version of CCM mode where the size of the authentication is 64 bits 641 and not 8 bits. These values have traditionally been specified as 642 bit counts rather than byte counts. This document will follow the 643 convention of using bit counts so that it is easier to compare the 644 different algorithms presented in this document. 646 We define a matrix of algorithms in this document over the values of 647 L and M. Constrained devices are usually operating in situations 648 where they use short messages and want to avoid doing recipient- 649 specific cryptographic operations. This favors smaller values of 650 both L and M. Less-constrained devices will want to be able to use 651 larger messages and are more willing to generate new keys for every 652 operation. This favors larger values of L and M. 654 The following values are used for L: 656 16 bits (2): This limits messages to 2^16 bytes (64 KiB) in length. 657 This is sufficiently long for messages in the constrained world. 658 The nonce length is 13 bytes allowing for 2^104 possible values of 659 the nonce without repeating. 661 64 bits (8): This limits messages to 2^64 bytes in length. The 662 nonce length is 7 bytes allowing for 2^56 possible values of the 663 nonce without repeating. 665 The following values are used for M: 667 64 bits (8): This produces a 64-bit authentication tag. This 668 implies that there is a 1 in 2^64 chance that a modified message 669 will authenticate. 671 128 bits (16): This produces a 128-bit authentication tag. This 672 implies that there is a 1 in 2^128 chance that a modified message 673 will authenticate. 675 +====================+=======+====+=====+========+===============+ 676 | Name | Value | L | M | Key | Description | 677 | | | | | Length | | 678 +====================+=======+====+=====+========+===============+ 679 | AES-CCM-16-64-128 | 10 | 16 | 64 | 128 | AES-CCM mode | 680 | | | | | | 128-bit key, | 681 | | | | | | 64-bit tag, | 682 | | | | | | 13-byte nonce | 683 +--------------------+-------+----+-----+--------+---------------+ 684 | AES-CCM-16-64-256 | 11 | 16 | 64 | 256 | AES-CCM mode | 685 | | | | | | 256-bit key, | 686 | | | | | | 64-bit tag, | 687 | | | | | | 13-byte nonce | 688 +--------------------+-------+----+-----+--------+---------------+ 689 | AES-CCM-64-64-128 | 12 | 64 | 64 | 128 | AES-CCM mode | 690 | | | | | | 128-bit key, | 691 | | | | | | 64-bit tag, | 692 | | | | | | 7-byte nonce | 693 +--------------------+-------+----+-----+--------+---------------+ 694 | AES-CCM-64-64-256 | 13 | 64 | 64 | 256 | AES-CCM mode | 695 | | | | | | 256-bit key, | 696 | | | | | | 64-bit tag, | 697 | | | | | | 7-byte nonce | 698 +--------------------+-------+----+-----+--------+---------------+ 699 | AES-CCM-16-128-128 | 30 | 16 | 128 | 128 | AES-CCM mode | 700 | | | | | | 128-bit key, | 701 | | | | | | 128-bit tag, | 702 | | | | | | 13-byte nonce | 703 +--------------------+-------+----+-----+--------+---------------+ 704 | AES-CCM-16-128-256 | 31 | 16 | 128 | 256 | AES-CCM mode | 705 | | | | | | 256-bit key, | 706 | | | | | | 128-bit tag, | 707 | | | | | | 13-byte nonce | 708 +--------------------+-------+----+-----+--------+---------------+ 709 | AES-CCM-64-128-128 | 32 | 64 | 128 | 128 | AES-CCM mode | 710 | | | | | | 128-bit key, | 711 | | | | | | 128-bit tag, | 712 | | | | | | 7-byte nonce | 713 +--------------------+-------+----+-----+--------+---------------+ 714 | AES-CCM-64-128-256 | 33 | 64 | 128 | 256 | AES-CCM mode | 715 | | | | | | 256-bit key, | 716 | | | | | | 128-bit tag, | 717 | | | | | | 7-byte nonce | 718 +--------------------+-------+----+-----+--------+---------------+ 720 Table 6: Algorithm Values for AES-CCM 722 Keys may be obtained either from a key structure or from a recipient 723 structure. Implementations encrypting and decrypting MUST validate 724 that the key type, key length, and algorithm are correct and 725 appropriate for the entities involved. 727 When using a COSE key for this algorithm, the following checks are 728 made: 730 * The 'kty' field MUST be present, and it MUST be 'Symmetric'. 732 * If the 'alg' field is present, it MUST match the AES-CCM algorithm 733 being used. 735 * If the 'key_ops' field is present, it MUST include 'encrypt' or 736 'wrap key' when encrypting. 738 * If the 'key_ops' field is present, it MUST include 'decrypt' or 739 'unwrap key' when decrypting. 741 4.2.1. Security Considerations for AES-CCM 743 When using AES-CCM, the following restrictions MUST be enforced: 745 * The key and nonce pair MUST be unique for every message encrypted. 746 Note that the value of L influences the number of unique nonces. 748 * The total number of times the AES block cipher is used MUST NOT 749 exceed 2^61 operations. This limitation is the sum of times the 750 block cipher is used in computing the MAC value and in performing 751 stream encryption operations. An explicit check is required only 752 in environments where it is expected that it might be exceeded. 754 * [I-D.ietf-quic-tls] contains an analysis on the use of AES-CCM in 755 that environment. Based on that reommendation, one should 756 restrict the number of messages encrypted to 2^23. If one is 757 using the 64-bit tag, then the limits are signficantly smaller if 758 one wants to keep the same integrity limits. A protocol 759 recommending this needs to analysis what level of integrity is 760 acceptable for the smaller tag size. It may be that to keep the 761 desired integrity one needs to re-key as often as every 2^7 762 messages. 764 * In addition to the number of messages successfully decrypted, the 765 number of failed decryptions needs to be kept as well. If the 766 number of failed decryptions exceeds 2^23 then a rekeying 767 operation should occur. 769 [RFC3610] additionally calls out one other consideration of note. It 770 is possible to do a pre-computation attack against the algorithm in 771 cases where portions of the plaintext are highly predictable. This 772 reduces the security of the key size by half. Ways to deal with this 773 attack include adding a random portion to the nonce value and/or 774 increasing the key size used. Using a portion of the nonce for a 775 random value will decrease the number of messages that a single key 776 can be used for. Increasing the key size may require more resources 777 in the constrained device. See Sections 5 and 10 of [RFC3610] for 778 more information. 780 4.3. ChaCha20 and Poly1305 782 ChaCha20 and Poly1305 combined together is an AEAD mode that is 783 defined in [RFC8439]. This is an algorithm defined to be a cipher 784 that is not AES and thus would not suffer from any future weaknesses 785 found in AES. These cryptographic functions are designed to be fast 786 in software-only implementations. 788 The ChaCha20/Poly1305 AEAD construction defined in [RFC8439] has no 789 parameterization. It takes a 256-bit key and a 96-bit nonce, as well 790 as the plaintext and additional data as inputs and produces the 791 ciphertext as an option. We define one algorithm identifier for this 792 algorithm in Table 7. 794 +===================+=======+==========================+ 795 | Name | Value | Description | 796 +===================+=======+==========================+ 797 | ChaCha20/Poly1305 | 24 | ChaCha20/Poly1305 w/ | 798 | | | 256-bit key, 128-bit tag | 799 +-------------------+-------+--------------------------+ 801 Table 7: Algorithm Value for ChaCha20/Poly1305 803 Keys may be obtained either from a key structure or from a recipient 804 structure. Implementations encrypting and decrypting MUST validate 805 that the key type, key length, and algorithm are correct and 806 appropriate for the entities involved. 808 When using a COSE key for this algorithm, the following checks are 809 made: 811 * The 'kty' field MUST be present, and it MUST be 'Symmetric'. 813 * If the 'alg' field is present, it MUST match the ChaCha20/Poly1305 814 algorithm being used. 816 * If the 'key_ops' field is present, it MUST include 'encrypt' or 817 'wrap key' when encrypting. 819 * If the 'key_ops' field is present, it MUST include 'decrypt' or 820 'unwrap key' when decrypting. 822 4.3.1. Security Considerations for ChaCha20/Poly1305 824 The key and nonce values MUST be a unique pair for every invocation 825 of the algorithm. Nonce counters are considered to be an acceptable 826 way of ensuring that they are unique. 828 A more recent analysis in [ROBUST] indicates that the the number of 829 failed decryptions needs to be taken into account as part determining 830 when a key roll-over is to be done. Following the recommendation of 831 for DTLS, the number of failed message decryptions should be limited 832 to 2^36. 834 [I-D.ietf-quic-tls] recommends that no more than 2^24.5 messages be 835 encrypted under a single key. 837 5. Key Derivation Functions (KDFs) 839 Section 9.4 of [I-D.ietf-cose-rfc8152bis-struct] contains a generic 840 description of Key Derivation Functions. This document defines a 841 single context structure and a single KDF. These elements are used 842 for all of the recipient algorithms defined in this document that 843 require a KDF process. These algorithms are defined in Sections 844 6.1.2, 6.3.1, and 6.4.1. 846 5.1. HMAC-Based Extract-and-Expand Key Derivation Function (HKDF) 848 The HKDF key derivation algorithm is defined in [RFC5869][HKDF]. 850 The HKDF algorithm takes these inputs: 852 secret -- a shared value that is secret. Secrets may be either 853 previously shared or derived from operations like a Diffie-Hellman 854 (DH) key agreement. 856 salt -- an optional value that is used to change the generation 857 process. The salt value can be either public or private. If the 858 salt is public and carried in the message, then the 'salt' 859 algorithm header parameter defined in Table 9 is used. While 860 [RFC5869] suggests that the length of the salt be the same as the 861 length of the underlying hash value, any positive salt length will 862 improve the security as different key values will be generated. 863 This parameter is protected by being included in the key 864 computation and does not need to be separately authenticated. The 865 salt value does not need to be unique for every message sent. 867 length -- the number of bytes of output that need to be generated. 869 context information -- Information that describes the context in 870 which the resulting value will be used. Making this information 871 specific to the context in which the material is going to be used 872 ensures that the resulting material will always be tied to that 873 usage. The context structure defined in Section 5.2 is used by 874 the KDFs in this document. 876 PRF -- The underlying pseudorandom function to be used in the HKDF 877 algorithm. The PRF is encoded into the HKDF algorithm selection. 879 HKDF is defined to use HMAC as the underlying PRF. However, it is 880 possible to use other functions in the same construct to provide a 881 different KDF that is more appropriate in the constrained world. 882 Specifically, one can use AES-CBC-MAC as the PRF for the expand step, 883 but not for the extract step. When using a good random shared secret 884 of the correct length, the extract step can be skipped. For the AES 885 algorithm versions, the extract step is always skipped. 887 The extract step cannot be skipped if the secret is not uniformly 888 random, for example, if it is the result of an ECDH key agreement 889 step. This implies that the AES HKDF version cannot be used with 890 ECDH. If the extract step is skipped, the 'salt' value is not used 891 as part of the HKDF functionality. 893 The algorithms defined in this document are found in Table 8. 895 +==============+===================+========================+ 896 | Name | PRF | Description | 897 +==============+===================+========================+ 898 | HKDF SHA-256 | HMAC with SHA-256 | HKDF using HMAC | 899 | | | SHA-256 as the PRF | 900 +--------------+-------------------+------------------------+ 901 | HKDF SHA-512 | HMAC with SHA-512 | HKDF using HMAC | 902 | | | SHA-512 as the PRF | 903 +--------------+-------------------+------------------------+ 904 | HKDF AES- | AES-CBC-MAC-128 | HKDF using AES-MAC as | 905 | MAC-128 | | the PRF w/ 128-bit key | 906 +--------------+-------------------+------------------------+ 907 | HKDF AES- | AES-CBC-MAC-256 | HKDF using AES-MAC as | 908 | MAC-256 | | the PRF w/ 256-bit key | 909 +--------------+-------------------+------------------------+ 911 Table 8: HKDF Algorithms 913 +======+=======+======+============================+=============+ 914 | Name | Label | Type | Algorithm | Description | 915 +======+=======+======+============================+=============+ 916 | salt | -20 | bstr | direct+HKDF-SHA-256, | Random salt | 917 | | | | direct+HKDF-SHA-512, | | 918 | | | | direct+HKDF-AES-128, | | 919 | | | | direct+HKDF-AES-256, ECDH- | | 920 | | | | ES+HKDF-256, ECDH-ES+HKDF- | | 921 | | | | 512, ECDH-SS+HKDF-256, | | 922 | | | | ECDH-SS+HKDF-512, ECDH- | | 923 | | | | ES+A128KW, ECDH-ES+A192KW, | | 924 | | | | ECDH-ES+A256KW, ECDH- | | 925 | | | | SS+A128KW, ECDH-SS+A192KW, | | 926 | | | | ECDH-SS+A256KW | | 927 +------+-------+------+----------------------------+-------------+ 929 Table 9: HKDF Algorithm Parameters 931 5.2. Context Information Structure 933 The context information structure is used to ensure that the derived 934 keying material is "bound" to the context of the transaction. The 935 context information structure used here is based on that defined in 936 [SP800-56A]. By using CBOR for the encoding of the context 937 information structure, we automatically get the same type and length 938 separation of fields that is obtained by the use of ASN.1. This 939 means that there is no need to encode the lengths for the base 940 elements, as it is done by the encoding used in JOSE (Section 4.6.2 941 of [RFC7518]). 943 The context information structure refers to PartyU and PartyV as the 944 two parties that are doing the key derivation. Unless the 945 application protocol defines differently, we assign PartyU to the 946 entity that is creating the message and PartyV to the entity that is 947 receiving the message. By doing this association, different keys 948 will be derived for each direction as the context information is 949 different in each direction. 951 The context structure is built from information that is known to both 952 entities. This information can be obtained from a variety of 953 sources: 955 * Fields can be defined by the application. This is commonly used 956 to assign fixed names to parties, but it can be used for other 957 items such as nonces. 959 * Fields can be defined by usage of the output. Examples of this 960 are the algorithm and key size that are being generated. 962 * Fields can be defined by parameters from the message. We define a 963 set of header parameters in Table 10 that can be used to carry the 964 values associated with the context structure. Examples of this 965 are identities and nonce values. These header parameters are 966 designed to be placed in the unprotected bucket of the recipient 967 structure; they do not need to be in the protected bucket since 968 they already are included in the cryptographic computation by 969 virtue of being included in the context structure. 971 +==========+=======+======+===========================+=============+ 972 | Name | Label | Type | Algorithm | Description | 973 +==========+=======+======+===========================+=============+ 974 | PartyU | -21 | bstr | direct+HKDF-SHA-256, | Party U | 975 | identity | | | direct+HKDF-SHA-512, | identity | 976 | | | | direct+HKDF-AES-128, | information | 977 | | | | direct+HKDF-AES-256, | | 978 | | | | ECDH-ES+HKDF-256, | | 979 | | | | ECDH-ES+HKDF-512, | | 980 | | | | ECDH-SS+HKDF-256, | | 981 | | | | ECDH-SS+HKDF-512, | | 982 | | | | ECDH-ES+A128KW, | | 983 | | | | ECDH-ES+A192KW, | | 984 | | | | ECDH-ES+A256KW, | | 985 | | | | ECDH-SS+A128KW, | | 986 | | | | ECDH-SS+A192KW, | | 987 | | | | ECDH-SS+A256KW | | 988 +----------+-------+------+---------------------------+-------------+ 989 | PartyU | -22 | bstr | direct+HKDF-SHA-256, | Party U | 990 | nonce | | / | direct+HKDF-SHA-512, | provided | 991 | | | int | direct+HKDF-AES-128, | nonce | 992 | | | | direct+HKDF-AES-256, | | 993 | | | | ECDH-ES+HKDF-256, | | 994 | | | | ECDH-ES+HKDF-512, | | 995 | | | | ECDH-SS+HKDF-256, | | 996 | | | | ECDH-SS+HKDF-512, | | 997 | | | | ECDH-ES+A128KW, | | 998 | | | | ECDH-ES+A192KW, | | 999 | | | | ECDH-ES+A256KW, | | 1000 | | | | ECDH-SS+A128KW, | | 1001 | | | | ECDH-SS+A192KW, | | 1002 | | | | ECDH-SS+A256KW | | 1003 +----------+-------+------+---------------------------+-------------+ 1004 | PartyU | -23 | bstr | direct+HKDF-SHA-256, | Party U | 1005 | other | | | direct+HKDF-SHA-512, | other | 1006 | | | | direct+HKDF-AES-128, | provided | 1007 | | | | direct+HKDF-AES-256, | information | 1008 | | | | ECDH-ES+HKDF-256, | | 1009 | | | | ECDH-ES+HKDF-512, | | 1010 | | | | ECDH-SS+HKDF-256, | | 1011 | | | | ECDH-SS+HKDF-512, | | 1012 | | | | ECDH-ES+A128KW, | | 1013 | | | | ECDH-ES+A192KW, | | 1014 | | | | ECDH-ES+A256KW, | | 1015 | | | | ECDH-SS+A128KW, | | 1016 | | | | ECDH-SS+A192KW, | | 1017 | | | | ECDH-SS+A256KW | | 1018 +----------+-------+------+---------------------------+-------------+ 1019 | PartyV | -24 | bstr | direct+HKDF-SHA-256, | Party V | 1020 | identity | | | direct+HKDF-SHA-512, | identity | 1021 | | | | direct+HKDF-AES-128, | information | 1022 | | | | direct+HKDF-AES-256, | | 1023 | | | | ECDH-ES+HKDF-256, | | 1024 | | | | ECDH-ES+HKDF-512, | | 1025 | | | | ECDH-SS+HKDF-256, | | 1026 | | | | ECDH-SS+HKDF-512, | | 1027 | | | | ECDH-ES+A128KW, | | 1028 | | | | ECDH-ES+A192KW, | | 1029 | | | | ECDH-ES+A256KW, | | 1030 | | | | ECDH-SS+A128KW, | | 1031 | | | | ECDH-SS+A192KW, | | 1032 | | | | ECDH-SS+A256KW | | 1033 +----------+-------+------+---------------------------+-------------+ 1034 | PartyV | -25 | bstr | direct+HKDF-SHA-256, | Party V | 1035 | nonce | | / | direct+HKDF-SHA-512, | provided | 1036 | | | int | direct+HKDF-AES-128, | nonce | 1037 | | | | direct+HKDF-AES-256, | | 1038 | | | | ECDH-ES+HKDF-256, | | 1039 | | | | ECDH-ES+HKDF-512, | | 1040 | | | | ECDH-SS+HKDF-256, | | 1041 | | | | ECDH-SS+HKDF-512, | | 1042 | | | | ECDH-ES+A128KW, | | 1043 | | | | ECDH-ES+A192KW, | | 1044 | | | | ECDH-ES+A256KW, | | 1045 | | | | ECDH-SS+A128KW, | | 1046 | | | | ECDH-SS+A192KW, | | 1047 | | | | ECDH-SS+A256KW | | 1048 +----------+-------+------+---------------------------+-------------+ 1049 | PartyV | -26 | bstr | direct+HKDF-SHA-256, | Party V | 1050 | other | | | direct+HKDF-SHA-512, | other | 1051 | | | | direct+HKDF-AES-128, | provided | 1052 | | | | direct+HKDF-AES-256, | information | 1053 | | | | ECDH-ES+HKDF-256, | | 1054 | | | | ECDH-ES+HKDF-512, | | 1055 | | | | ECDH-SS+HKDF-256, | | 1056 | | | | ECDH-SS+HKDF-512, | | 1057 | | | | ECDH-ES+A128KW, | | 1058 | | | | ECDH-ES+A192KW, | | 1059 | | | | ECDH-ES+A256KW, | | 1060 | | | | ECDH-SS+A128KW, | | 1061 | | | | ECDH-SS+A192KW, | | 1062 | | | | ECDH-SS+A256KW | | 1063 +----------+-------+------+---------------------------+-------------+ 1065 Table 10: Context Algorithm Parameters 1067 We define a CBOR object to hold the context information. This object 1068 is referred to as COSE_KDF_Context. The object is based on a CBOR 1069 array type. The fields in the array are: 1071 AlgorithmID: This field indicates the algorithm for which the key 1072 material will be used. This normally is either a key wrap 1073 algorithm identifier or a content encryption algorithm identifier. 1074 The values are from the "COSE Algorithms" registry. This field is 1075 required to be present. The field exists in the context 1076 information so that a different key is generated for each 1077 algorithm even of all of the other context information is the 1078 same. In practice, this means if algorithm A is broken and thus 1079 finding the key is relatively easy, the key derived for algorithm 1080 B will not be the same as the key derived for algorithm A. 1082 PartyUInfo: This field holds information about party U. The 1083 PartyUInfo is encoded as a CBOR array. The elements of PartyUInfo 1084 are encoded in the order presented below. The elements of the 1085 PartyUInfo array are: 1087 identity: This contains the identity information for party U. 1088 The identities can be assigned in one of two manners. First, a 1089 protocol can assign identities based on roles. For example, 1090 the roles of "client" and "server" may be assigned to different 1091 entities in the protocol. Each entity would then use the 1092 correct label for the data they send or receive. The second 1093 way for a protocol to assign identities is to use a name based 1094 on a naming system (i.e., DNS, X.509 names). 1096 We define an algorithm parameter 'PartyU identity' that can be 1097 used to carry identity information in the message. However, 1098 identity information is often known as part of the protocol and 1099 can thus be inferred rather than made explicit. If identity 1100 information is carried in the message, applications SHOULD have 1101 a way of validating the supplied identity information. The 1102 identity information does not need to be specified and is set 1103 to nil in that case. 1105 nonce: This contains a nonce value. The nonce can either be 1106 implicit from the protocol or be carried as a value in the 1107 unprotected header bucket. 1109 We define an algorithm parameter 'PartyU nonce' that can be 1110 used to carry this value in the message; however, the nonce 1111 value could be determined by the application and the value 1112 determined from elsewhere. 1114 This option does not need to be specified and is set to nil in 1115 that case. 1117 other: This contains other information that is defined by the 1118 protocol. This option does not need to be specified and is set 1119 to nil in that case. 1121 PartyVInfo: This field holds information about party V. The content 1122 of the structure is the same as for the PartyUInfo but for party 1123 V. 1125 SuppPubInfo: This field contains public information that is mutually 1126 known to both parties. 1128 keyDataLength: This is set to the number of bits of the desired 1129 output value. This practice means if algorithm A can use two 1130 different key lengths, the key derived for longer key size will 1131 not contain the key for shorter key size as a prefix. 1133 protected: This field contains the protected parameter field. If 1134 there are no elements in the protected field, then use a zero- 1135 length bstr. 1137 other: This field is for free form data defined by the 1138 application. An example is that an application could define 1139 two different byte strings to be placed here to generate 1140 different keys for a data stream versus a control stream. This 1141 field is optional and will only be present if the application 1142 defines a structure for this information. Applications that 1143 define this SHOULD use CBOR to encode the data so that types 1144 and lengths are correctly included. 1146 SuppPrivInfo: This field contains private information that is 1147 mutually known private information. An example of this 1148 information would be a preexisting shared secret. (This could, 1149 for example, be used in combination with an ECDH key agreement to 1150 provide a secondary proof of identity.) The field is optional and 1151 will only be present if the application defines a structure for 1152 this information. Applications that define this SHOULD use CBOR 1153 to encode the data so that types and lengths are correctly 1154 included. 1156 The following CDDL fragment corresponds to the text above. 1158 PartyInfo = ( 1159 identity : bstr / nil, 1160 nonce : bstr / int / nil, 1161 other : bstr / nil 1162 ) 1164 COSE_KDF_Context = [ 1165 AlgorithmID : int / tstr, 1166 PartyUInfo : [ PartyInfo ], 1167 PartyVInfo : [ PartyInfo ], 1168 SuppPubInfo : [ 1169 keyDataLength : uint, 1170 protected : empty_or_serialized_map, 1171 ? other : bstr 1172 ], 1173 ? SuppPrivInfo : bstr 1174 ] 1176 6. Content Key Distribution Methods 1178 Section 9.5 of [I-D.ietf-cose-rfc8152bis-struct] contains a generic 1179 description of content key distribution methods. This document 1180 defines the identifiers and usage for a number of content key 1181 distribution methods. 1183 6.1. Direct Encryption 1185 Direct encryption algorithm is defined in Section 9.5.1 of 1186 [I-D.ietf-cose-rfc8152bis-struct]. Information about how to fill in 1187 the COSE_Recipient structure are detailed there. 1189 6.1.1. Direct Key 1191 This recipient algorithm is the simplest; the identified key is 1192 directly used as the key for the next layer down in the message. 1193 There are no algorithm parameters defined for this algorithm. The 1194 algorithm identifier value is assigned in Table 11. 1196 When this algorithm is used, the protected field MUST be zero length. 1197 The key type MUST be 'Symmetric'. 1199 +========+=======+===================+ 1200 | Name | Value | Description | 1201 +========+=======+===================+ 1202 | direct | -6 | Direct use of CEK | 1203 +--------+-------+-------------------+ 1205 Table 11: Direct Key 1207 6.1.1.1. Security Considerations for Direct Key 1209 This recipient algorithm has several potential problems that need to 1210 be considered: 1212 * These keys need to have some method to be regularly updated over 1213 time. All of the content encryption algorithms specified in this 1214 document have limits on how many times a key can be used without 1215 significant loss of security. 1217 * These keys need to be dedicated to a single algorithm. There have 1218 been a number of attacks developed over time when a single key is 1219 used for multiple different algorithms. One example of this is 1220 the use of a single key for both the CBC encryption mode and the 1221 CBC-MAC authentication mode. 1223 * Breaking one message means all messages are broken. If an 1224 adversary succeeds in determining the key for a single message, 1225 then the key for all messages is also determined. 1227 6.1.2. Direct Key with KDF 1229 These recipient algorithms take a common shared secret between the 1230 two parties and applies the HKDF function (Section 5.1), using the 1231 context structure defined in Section 5.2 to transform the shared 1232 secret into the CEK. The 'protected' field can be of non-zero 1233 length. Either the 'salt' parameter of HKDF or the 'PartyU nonce' 1234 parameter of the context structure MUST be present. The salt/nonce 1235 parameter can be generated either randomly or deterministically. The 1236 requirement is that it be a unique value for the shared secret in 1237 question. 1239 If the salt/nonce value is generated randomly, then it is suggested 1240 that the length of the random value be the same length as the output 1241 of the hash function underlying HKDF. While there is no way to 1242 guarantee that it will be unique, there is a high probability that it 1243 will be unique. If the salt/nonce value is generated 1244 deterministically, it can be guaranteed to be unique, and thus there 1245 is no length requirement. 1247 A new IV must be used for each message if the same key is used. The 1248 IV can be modified in a predictable manner, a random manner, or an 1249 unpredictable manner (i.e., encrypting a counter). 1251 The IV used for a key can also be generated from the same HKDF 1252 functionality as the key is generated. If HKDF is used for 1253 generating the IV, the algorithm identifier is set to "IV- 1254 GENERATION". 1256 The set of algorithms defined in this document can be found in 1257 Table 12. 1259 +=====================+=======+==============+=====================+ 1260 | Name | Value | KDF | Description | 1261 +=====================+=======+==============+=====================+ 1262 | direct+HKDF-SHA-256 | -10 | HKDF SHA-256 | Shared secret w/ | 1263 | | | | HKDF and SHA-256 | 1264 +---------------------+-------+--------------+---------------------+ 1265 | direct+HKDF-SHA-512 | -11 | HKDF SHA-512 | Shared secret w/ | 1266 | | | | HKDF and SHA-512 | 1267 +---------------------+-------+--------------+---------------------+ 1268 | direct+HKDF-AES-128 | -12 | HKDF AES- | Shared secret w/ | 1269 | | | MAC-128 | AES-MAC 128-bit key | 1270 +---------------------+-------+--------------+---------------------+ 1271 | direct+HKDF-AES-256 | -13 | HKDF AES- | Shared secret w/ | 1272 | | | MAC-256 | AES-MAC 256-bit key | 1273 +---------------------+-------+--------------+---------------------+ 1275 Table 12: Direct Key with KDF 1277 When using a COSE key for this algorithm, the following checks are 1278 made: 1280 * The 'kty' field MUST be present, and it MUST be 'Symmetric'. 1282 * If the 'alg' field is present, it MUST match the algorithm being 1283 used. 1285 * If the 'key_ops' field is present, it MUST include 'deriveKey' or 1286 'deriveBits'. 1288 6.1.2.1. Security Considerations for Direct Key with KDF 1290 The shared secret needs to have some method to be regularly updated 1291 over time. The shared secret forms the basis of trust. Although not 1292 used directly, it should still be subject to scheduled rotation. 1294 While these methods do not provide for perfect forward secrecy, as 1295 the same shared secret is used for all of the keys generated, if the 1296 key for any single message is discovered, only the message (or series 1297 of messages) using that derived key are compromised. A new key 1298 derivation step will generate a new key that requires the same amount 1299 of work to get the key. 1301 6.2. Key Wrap 1303 Key wrap is defined in Section 9.5.1 of 1304 [I-D.ietf-cose-rfc8152bis-struct]. Information about how to fill in 1305 the COSE_Recipient structure is detailed there. 1307 6.2.1. AES Key Wrap 1309 The AES Key Wrap algorithm is defined in [RFC3394]. This algorithm 1310 uses an AES key to wrap a value that is a multiple of 64 bits. As 1311 such, it can be used to wrap a key for any of the content encryption 1312 algorithms defined in this document. The algorithm requires a single 1313 fixed parameter, the initial value. This is fixed to the value 1314 specified in Section 2.2.3.1 of [RFC3394]. There are no public key 1315 parameters that vary on a per-invocation basis. The protected header 1316 bucket MUST be empty. 1318 Keys may be obtained either from a key structure or from a recipient 1319 structure. Implementations encrypting and decrypting MUST validate 1320 that the key type, key length, and algorithm are correct and 1321 appropriate for the entities involved. 1323 When using a COSE key for this algorithm, the following checks are 1324 made: 1326 * The 'kty' field MUST be present, and it MUST be 'Symmetric'. 1328 * If the 'alg' field is present, it MUST match the AES Key Wrap 1329 algorithm being used. 1331 * If the 'key_ops' field is present, it MUST include 'encrypt' or 1332 'wrap key' when encrypting. 1334 * If the 'key_ops' field is present, it MUST include 'decrypt' or 1335 'unwrap key' when decrypting. 1337 +========+=======+==========+=============================+ 1338 | Name | Value | Key Size | Description | 1339 +========+=======+==========+=============================+ 1340 | A128KW | -3 | 128 | AES Key Wrap w/ 128-bit key | 1341 +--------+-------+----------+-----------------------------+ 1342 | A192KW | -4 | 192 | AES Key Wrap w/ 192-bit key | 1343 +--------+-------+----------+-----------------------------+ 1344 | A256KW | -5 | 256 | AES Key Wrap w/ 256-bit key | 1345 +--------+-------+----------+-----------------------------+ 1347 Table 13: AES Key Wrap Algorithm Values 1349 6.2.1.1. Security Considerations for AES-KW 1351 The shared secret needs to have some method to be regularly updated 1352 over time. The shared secret is the basis of trust. 1354 6.3. Direct Key Agreement 1356 Key Transport is defined in Section 9.5.4 of 1357 [I-D.ietf-cose-rfc8152bis-struct]. Information about how to fill in 1358 the COSE_Recipient structure is detailed there. 1360 6.3.1. Direct ECDH 1362 The mathematics for ECDH can be found in [RFC6090]. In this 1363 document, the algorithm is extended to be used with the two curves 1364 defined in [RFC7748]. 1366 ECDH is parameterized by the following: 1368 * Curve Type/Curve: The curve selected controls not only the size of 1369 the shared secret, but the mathematics for computing the shared 1370 secret. The curve selected also controls how a point in the curve 1371 is represented and what happens for the identity points on the 1372 curve. In this specification, we allow for a number of different 1373 curves to be used. A set of curves are defined in Table 18. 1375 The math used to obtain the computed secret is based on the curve 1376 selected and not on the ECDH algorithm. For this reason, a new 1377 algorithm does not need to be defined for each of the curves. 1379 * Computed Secret to Shared Secret: Once the computed secret is 1380 known, the resulting value needs to be converted to a byte string 1381 to run the KDF. The x-coordinate is used for all of the curves 1382 defined in this document. For curves X25519 and X448, the 1383 resulting value is used directly as it is a byte string of a known 1384 length. For the P-256, P-384, and P-521 curves, the x-coordinate 1385 is run through the I2OSP function defined in [RFC8017], using the 1386 same computation for n as is defined in Section 2.1. 1388 * Ephemeral-Static or Static-Static: The key agreement process may 1389 be done using either a static or an ephemeral key for the sender's 1390 side. When using ephemeral keys, the sender MUST generate a new 1391 ephemeral key for every key agreement operation. The ephemeral 1392 key is placed in the 'ephemeral key' parameter and MUST be present 1393 for all algorithm identifiers that use ephemeral keys. When using 1394 static keys, the sender MUST either generate a new random value or 1395 create a unique value. For the KDFs used, this means either the 1396 'salt' parameter for HKDF (Table 9) or the 'PartyU nonce' 1397 parameter for the context structure (Table 10) MUST be present 1398 (both can be present if desired). The value in the parameter MUST 1399 be unique for the pair of keys being used. It is acceptable to 1400 use a global counter that is incremented for every static-static 1401 operation and use the resulting value. Care must be taken that 1402 the counter is saved to permanent storage in a way to avoid reuse 1403 of that counter value. When using static keys, the static key 1404 should be identified to the recipient. The static key can be 1405 identified either by providing the key ('static key') or by 1406 providing a key identifier for the static key ('static key id'). 1407 Both of these header parameters are defined in Table 15. 1409 * Key Derivation Algorithm: The result of an ECDH key agreement 1410 process does not provide a uniformly random secret. As such, it 1411 needs to be run through a KDF in order to produce a usable key. 1412 Processing the secret through a KDF also allows for the 1413 introduction of context material: how the key is going to be used 1414 and one-time material for static-static key agreement. All of the 1415 algorithms defined in this document use one of the HKDF algorithms 1416 defined in Section 5.1 with the context structure defined in 1417 Section 5.2. 1419 * Key Wrap Algorithm: No key wrap algorithm is used. This is 1420 represented in Table 14 as 'none'. The key size for the context 1421 structure is the content layer encryption algorithm size. 1423 COSE does not have an Ephemeral-Ephemeral version defined. The 1424 reason for this is that COSE is not an online protocol by itself and 1425 thus does not have a method to establish ephemeral secrets on both 1426 sides. The expectation is that a protocol would establish the 1427 secrets for both sides, and then they would be used as static-static 1428 for the purposes of COSE, or that the protocol would generate a 1429 shared secret and a direct encryption would be used. 1431 The set of direct ECDH algorithms defined in this document are found 1432 in Table 14. 1434 +===========+=======+=========+============+======+=================+ 1435 | Name | Value | KDF | Ephemeral- | Key | Description | 1436 | | | | Static | Wrap | | 1437 +===========+=======+=========+============+======+=================+ 1438 | ECDH-ES | -25 | HKDF - | yes | none | ECDH ES w/ HKDF | 1439 | + | | SHA-256 | | | - generate key | 1440 | HKDF-256 | | | | | directly | 1441 +-----------+-------+---------+------------+------+-----------------+ 1442 | ECDH-ES | -26 | HKDF - | yes | none | ECDH ES w/ HKDF | 1443 | + | | SHA-512 | | | - generate key | 1444 | HKDF-512 | | | | | directly | 1445 +-----------+-------+---------+------------+------+-----------------+ 1446 | ECDH-SS | -27 | HKDF - | no | none | ECDH SS w/ HKDF | 1447 | + | | SHA-256 | | | - generate key | 1448 | HKDF-256 | | | | | directly | 1449 +-----------+-------+---------+------------+------+-----------------+ 1450 | ECDH-SS | -28 | HKDF - | no | none | ECDH SS w/ HKDF | 1451 | + | | SHA-512 | | | - generate key | 1452 | HKDF-512 | | | | | directly | 1453 +-----------+-------+---------+------------+------+-----------------+ 1455 Table 14: ECDH Algorithm Values 1457 +===========+=======+==========+===================+=============+ 1458 | Name | Label | Type | Algorithm | Description | 1459 +===========+=======+==========+===================+=============+ 1460 | ephemeral | -1 | COSE_Key | ECDH-ES+HKDF-256, | Ephemeral | 1461 | key | | | ECDH-ES+HKDF-512, | public key | 1462 | | | | ECDH-ES+A128KW, | for the | 1463 | | | | ECDH-ES+A192KW, | sender | 1464 | | | | ECDH-ES+A256KW | | 1465 +-----------+-------+----------+-------------------+-------------+ 1466 | static | -2 | COSE_Key | ECDH-SS+HKDF-256, | Static | 1467 | key | | | ECDH-SS+HKDF-512, | public key | 1468 | | | | ECDH-SS+A128KW, | for the | 1469 | | | | ECDH-SS+A192KW, | sender | 1470 | | | | ECDH-SS+A256KW | | 1471 +-----------+-------+----------+-------------------+-------------+ 1472 | static | -3 | bstr | ECDH-SS+HKDF-256, | Static | 1473 | key id | | | ECDH-SS+HKDF-512, | public key | 1474 | | | | ECDH-SS+A128KW, | identifier | 1475 | | | | ECDH-SS+A192KW, | for the | 1476 | | | | ECDH-SS+A256KW | sender | 1477 +-----------+-------+----------+-------------------+-------------+ 1479 Table 15: ECDH Algorithm Parameters 1481 This document defines these algorithms to be used with the curves 1482 P-256, P-384, P-521, X25519, and X448. Implementations MUST verify 1483 that the key type and curve are correct. Different curves are 1484 restricted to different key types. Implementations MUST verify that 1485 the curve and algorithm are appropriate for the entities involved. 1487 When using a COSE key for this algorithm, the following checks are 1488 made: 1490 * The 'kty' field MUST be present, and it MUST be 'EC2' or 'OKP'. 1492 * If the 'alg' field is present, it MUST match the key agreement 1493 algorithm being used. 1495 * If the 'key_ops' field is present, it MUST include 'derive key' or 1496 'derive bits' for the private key. 1498 * If the 'key_ops' field is present, it MUST be empty for the public 1499 key. 1501 6.3.1.1. Security Considerations for ECDH 1503 There is a method of checking that points provided from external 1504 entities are valid. For the 'EC2' key format, this can be done by 1505 checking that the x and y values form a point on the curve. For the 1506 'OKP' format, there is no simple way to do point validation. 1508 Consideration was given to requiring that the public keys of both 1509 entities be provided as part of the key derivation process (as 1510 recommended in Section 6.4 of [RFC7748]). This was not done as COSE 1511 is used in a store and forward format rather than in online key 1512 exchange. In order for this to be a problem, either the receiver 1513 public key has to be chosen maliciously or the sender has to be 1514 malicious. In either case, all security evaporates anyway. 1516 A proof of possession of the private key associated with the public 1517 key is recommended when a key is moved from untrusted to trusted 1518 (either by the end user or by the entity that is responsible for 1519 making trust statements on keys). 1521 6.4. Key Agreement with Key Wrap 1523 Key Agreement with Key Wrap is defined in Section 9.5.5 of 1524 [I-D.ietf-cose-rfc8152bis-struct]. Information about how to fill in 1525 the COSE_Recipient structure are detailed there. 1527 6.4.1. ECDH with Key Wrap 1529 These algorithms are defined in Table 16. 1531 ECDH with Key Agreement is parameterized by the same header 1532 parameters as for ECDH; see Section 6.3.1, with the following 1533 modifications: 1535 * Key Wrap Algorithm: Any of the key wrap algorithms defined in 1536 Section 6.2 are supported. The size of the key used for the key 1537 wrap algorithm is fed into the KDF. The set of identifiers are 1538 found in Table 16. 1540 +=========+=======+=========+============+========+================+ 1541 | Name | Value | KDF | Ephemeral- | Key | Description | 1542 | | | | Static | Wrap | | 1543 +=========+=======+=========+============+========+================+ 1544 | ECDH-ES | -29 | HKDF - | yes | A128KW | ECDH ES w/ | 1545 | + | | SHA-256 | | | Concat KDF and | 1546 | A128KW | | | | | AES Key Wrap | 1547 | | | | | | w/ 128-bit key | 1548 +---------+-------+---------+------------+--------+----------------+ 1549 | ECDH-ES | -30 | HKDF - | yes | A192KW | ECDH ES w/ | 1550 | + | | SHA-256 | | | Concat KDF and | 1551 | A192KW | | | | | AES Key Wrap | 1552 | | | | | | w/ 192-bit key | 1553 +---------+-------+---------+------------+--------+----------------+ 1554 | ECDH-ES | -31 | HKDF - | yes | A256KW | ECDH ES w/ | 1555 | + | | SHA-256 | | | Concat KDF and | 1556 | A256KW | | | | | AES Key Wrap | 1557 | | | | | | w/ 256-bit key | 1558 +---------+-------+---------+------------+--------+----------------+ 1559 | ECDH-SS | -32 | HKDF - | no | A128KW | ECDH SS w/ | 1560 | + | | SHA-256 | | | Concat KDF and | 1561 | A128KW | | | | | AES Key Wrap | 1562 | | | | | | w/ 128-bit key | 1563 +---------+-------+---------+------------+--------+----------------+ 1564 | ECDH-SS | -33 | HKDF - | no | A192KW | ECDH SS w/ | 1565 | + | | SHA-256 | | | Concat KDF and | 1566 | A192KW | | | | | AES Key Wrap | 1567 | | | | | | w/ 192-bit key | 1568 +---------+-------+---------+------------+--------+----------------+ 1569 | ECDH-SS | -34 | HKDF - | no | A256KW | ECDH SS w/ | 1570 | + | | SHA-256 | | | Concat KDF and | 1571 | A256KW | | | | | AES Key Wrap | 1572 | | | | | | w/ 256-bit key | 1573 +---------+-------+---------+------------+--------+----------------+ 1575 Table 16: ECDH Algorithm Values with Key Wrap 1577 When using a COSE key for this algorithm, the following checks are 1578 made: 1580 * The 'kty' field MUST be present, and it MUST be 'EC2' or 'OKP'. 1582 * If the 'alg' field is present, it MUST match the key agreement 1583 algorithm being used. 1585 * If the 'key_ops' field is present, it MUST include 'derive key' or 1586 'derive bits' for the private key. 1588 * If the 'key_ops' field is present, it MUST be empty for the public 1589 key. 1591 7. Key Object Parameters 1593 The COSE_Key object defines a way to hold a single key object. It is 1594 still required that the members of individual key types be defined. 1595 This section of the document is where we define an initial set of 1596 members for specific key types. 1598 For each of the key types, we define both public and private members. 1599 The public members are what is transmitted to others for their usage. 1600 Private members allow for the archival of keys by individuals. 1601 However, there are some circumstances in which private keys may be 1602 distributed to entities in a protocol. Examples include: entities 1603 that have poor random number generation, centralized key creation for 1604 multi-cast type operations, and protocols in which a shared secret is 1605 used as a bearer token for authorization purposes. 1607 Key types are identified by the 'kty' member of the COSE_Key object. 1608 In this document, we define four values for the member: 1610 +===========+=======+==========================+ 1611 | Name | Value | Description | 1612 +===========+=======+==========================+ 1613 | OKP | 1 | Octet Key Pair | 1614 +-----------+-------+--------------------------+ 1615 | EC2 | 2 | Elliptic Curve Keys w/ | 1616 | | | x- and y-coordinate pair | 1617 +-----------+-------+--------------------------+ 1618 | Symmetric | 4 | Symmetric Keys | 1619 +-----------+-------+--------------------------+ 1620 | Reserved | 0 | This value is reserved | 1621 +-----------+-------+--------------------------+ 1623 Table 17: Key Type Values 1625 7.1. Elliptic Curve Keys 1627 Two different key structures are defined for elliptic curve keys. 1628 One version uses both an x-coordinate and a y-coordinate, potentially 1629 with point compression ('EC2'). This is the traditional EC point 1630 representation that is used in [RFC5480]. The other version uses 1631 only the x-coordinate as the y-coordinate is either to be recomputed 1632 or not needed for the key agreement operation ('OKP'). 1634 Applications MUST check that the curve and the key type are 1635 consistent and reject a key if they are not. 1637 +=========+=======+==========+====================================+ 1638 | Name | Value | Key Type | Description | 1639 +=========+=======+==========+====================================+ 1640 | P-256 | 1 | EC2 | NIST P-256 also known as secp256r1 | 1641 +---------+-------+----------+------------------------------------+ 1642 | P-384 | 2 | EC2 | NIST P-384 also known as secp384r1 | 1643 +---------+-------+----------+------------------------------------+ 1644 | P-521 | 3 | EC2 | NIST P-521 also known as secp521r1 | 1645 +---------+-------+----------+------------------------------------+ 1646 | X25519 | 4 | OKP | X25519 for use w/ ECDH only | 1647 +---------+-------+----------+------------------------------------+ 1648 | X448 | 5 | OKP | X448 for use w/ ECDH only | 1649 +---------+-------+----------+------------------------------------+ 1650 | Ed25519 | 6 | OKP | Ed25519 for use w/ EdDSA only | 1651 +---------+-------+----------+------------------------------------+ 1652 | Ed448 | 7 | OKP | Ed448 for use w/ EdDSA only | 1653 +---------+-------+----------+------------------------------------+ 1655 Table 18: Elliptic Curves 1657 7.1.1. Double Coordinate Curves 1659 The traditional way of sending ECs has been to send either both the 1660 x-coordinate and y-coordinate or the x-coordinate and a sign bit for 1661 the y-coordinate. The latter encoding has not been recommended in 1662 the IETF due to potential IPR issues. However, for operations in 1663 constrained environments, the ability to shrink a message by not 1664 sending the y-coordinate is potentially useful. 1666 For EC keys with both coordinates, the 'kty' member is set to 2 1667 (EC2). The key parameters defined in this section are summarized in 1668 Table 19. The members that are defined for this key type are: 1670 crv: This contains an identifier of the curve to be used with the 1671 key. The curves defined in this document for this key type can 1672 be found in Table 18. Other curves may be registered in the 1673 future, and private curves can be used as well. 1675 x: This contains the x-coordinate for the EC point. The integer is 1676 converted to a byte string as defined in [SEC1]. Leading zero 1677 octets MUST be preserved. 1679 y: This contains either the sign bit or the value of the 1680 y-coordinate for the EC point. When encoding the value y, the 1681 integer is converted to an byte string (as defined in [SEC1]) 1682 and encoded as a CBOR bstr. Leading zero octets MUST be 1683 preserved. The compressed point encoding is also supported. 1684 Compute the sign bit as laid out in the Elliptic-Curve-Point-to- 1685 Octet-String Conversion function of [SEC1]. If the sign bit is 1686 zero, then encode y as a CBOR false value; otherwise, encode y 1687 as a CBOR true value. The encoding of the infinity point is not 1688 supported. 1690 d: This contains the private key. 1692 For public keys, it is REQUIRED that 'crv', 'x', and 'y' be present 1693 in the structure. For private keys, it is REQUIRED that 'crv' and 1694 'd' be present in the structure. For private keys, it is RECOMMENDED 1695 that 'x' and 'y' also be present, but they can be recomputed from the 1696 required elements and omitting them saves on space. 1698 +======+======+=======+========+=================================+ 1699 | Key | Name | Label | CBOR | Description | 1700 | Type | | | Type | | 1701 +======+======+=======+========+=================================+ 1702 | 2 | crv | -1 | int / | EC identifier - Taken from the | 1703 | | | | tstr | "COSE Elliptic Curves" registry | 1704 +------+------+-------+--------+---------------------------------+ 1705 | 2 | x | -2 | bstr | x-coordinate | 1706 +------+------+-------+--------+---------------------------------+ 1707 | 2 | y | -3 | bstr / | y-coordinate | 1708 | | | | bool | | 1709 +------+------+-------+--------+---------------------------------+ 1710 | 2 | d | -4 | bstr | Private key | 1711 +------+------+-------+--------+---------------------------------+ 1713 Table 19: EC Key Parameters 1715 7.2. Octet Key Pair 1717 A new key type is defined for Octet Key Pairs (OKP). Do not assume 1718 that keys using this type are elliptic curves. This key type could 1719 be used for other curve types (for example, mathematics based on 1720 hyper-elliptic surfaces). 1722 The key parameters defined in this section are summarized in 1723 Table 20. The members that are defined for this key type are: 1725 crv: This contains an identifier of the curve to be used with the 1726 key. The curves defined in this document for this key type can 1727 be found in Table 18. Other curves may be registered in the 1728 future and private curves can be used as well. 1730 x: This contains the public key. The byte string contains the 1731 public key as defined by the algorithm. (For X25519, internally 1732 it is a little-endian integer.) 1734 d: This contains the private key. 1736 For public keys, it is REQUIRED that 'crv' and 'x' be present in the 1737 structure. For private keys, it is REQUIRED that 'crv' and 'd' be 1738 present in the structure. For private keys, it is RECOMMENDED that 1739 'x' also be present, but it can be recomputed from the required 1740 elements and omitting it saves on space. 1742 +======+==========+=======+=======+=================================+ 1743 | Name | Key | Label | Type | Description | 1744 | | Type | | | | 1745 +======+==========+=======+=======+=================================+ 1746 | crv | 1 | -1 | int / | EC identifier - Taken from the | 1747 | | | | tstr | "COSE Elliptic Curves" registry | 1748 +------+----------+-------+-------+---------------------------------+ 1749 | x | 1 | -2 | bstr | Public Key | 1750 +------+----------+-------+-------+---------------------------------+ 1751 | d | 1 | -4 | bstr | Private key | 1752 +------+----------+-------+-------+---------------------------------+ 1754 Table 20: Octet Key Pair Parameters 1756 7.3. Symmetric Keys 1758 Occasionally it is required that a symmetric key be transported 1759 between entities. This key structure allows for that to happen. 1761 For symmetric keys, the 'kty' member is set to 4 ('Symmetric'). The 1762 member that is defined for this key type is: 1764 k: This contains the value of the key. 1766 This key structure does not have a form that contains only public 1767 members. As it is expected that this key structure is going to be 1768 transmitted, care must be taken that it is never transmitted 1769 accidentally or insecurely. For symmetric keys, it is REQUIRED that 1770 'k' be present in the structure. 1772 +======+==========+=======+======+=============+ 1773 | Name | Key Type | Label | Type | Description | 1774 +======+==========+=======+======+=============+ 1775 | k | 4 | -1 | bstr | Key Value | 1776 +------+----------+-------+------+-------------+ 1778 Table 21: Symmetric Key Parameters 1780 8. COSE Capabilities 1782 There are some situations that have been identified where 1783 identification of capabilities of an algorithm or a key type need to 1784 be specified. One example of this is in 1785 [I-D.ietf-core-oscore-groupcomm] where the capabilities of the 1786 counter signature algorithm are mixed into the traffic key derivation 1787 process. This has a counterpart in the S/MIME specifications where 1788 SMIMECapabilities is defined in Section 2.5a.2 of [RFC8551]. This 1789 document defines the same concept for COSE. 1791 The algorithm identifier is not included in the capabilities data as 1792 it should be encoded elsewhere in the message. The key type 1793 identifier is included in the capabilities data as it is not expected 1794 to be encoded elsewhere. 1796 Two different types of capabilities are defined: capabilities for 1797 algorithms and capabilities for key type. Once defined by 1798 registration with IANA, the list of capabilities for an algorithm or 1799 key type is immutable. If it is later found that a new capability is 1800 needed for a key type or an algorithm, it will require that a new 1801 code point be assigned to deal with that. As a general rule, the 1802 capabilities are going to map to algorithm-specific header parameters 1803 or key parameters, but they do not need to do so. An example of this 1804 is the HSS-LMS key capabilities defined below where the hash 1805 algorithm used is included. 1807 The capability structure is an array of values, the values included 1808 in the structure are dependent on a specific algorithm or key type. 1809 For algorithm capabilities, the first element should always be a key 1810 type value if applicable, but the items that are specific to a key 1811 (for example a curve) should not be included in the algorithm 1812 capabilities. This means that if one wishes to enumerate all of the 1813 capabilities for a device which implements ECDH, it requires that all 1814 of the combinations of algorithms and key pairs to be specified. The 1815 last example of Section 8.3 provides a case where this is done by 1816 allowing for a cross product to be specified between an array of 1817 algorithm capabilities and key type capabilities (see ECDH-ES+A25KW 1818 element). For a key, the first element should be the key type value. 1819 While this means that the key type value will be duplicated if both 1820 an algorithm and key capability are used, the key type is needed in 1821 order to understand the rest of the values. 1823 8.1. Assignments for Existing Algorithms 1825 For the current set of algorithms in the registry, those in this 1826 document as well as those in [RFC8230] and [I-D.ietf-cose-hash-sig], 1827 the capabilities list is an array with one element, the key type 1828 (from the "COSE Key Types" Registry). It is expected that future 1829 registered algorithms could have zero, one, or multiple elements. 1831 8.2. Assignments for Existing Key Types 1833 There are a number of pre-existing key types, the following deals 1834 with creating the capability definition for those structures: 1836 * OKP, EC2: The list of capabilities is: 1838 - The key type value. (1 for OKP or 2 for EC2.) 1840 - One curve for that key type from the "COSE Elliptic Curve" 1841 registry. 1843 * RSA: The list of capabilities is: 1845 - The key type value (3). 1847 * Symmetric: The list of capabilities is: 1849 - The key type value (4). 1851 * HSS-LMS: The list of capabilities is: 1853 - The key type value (5), 1855 - Algorithm identifier for the underlying hash function from the 1856 "COSE Algorithms" registry. 1858 8.3. Examples 1860 Capabilities can be use in a key derivation process to make sure that 1861 both sides are using the same parameters. This is the approach that 1862 is being used by the group communication KDF in 1863 [I-D.ietf-core-oscore-groupcomm]. The three examples below show 1864 different ways that one might include things: 1866 * Just an algorithm capability: This is useful if the protocol wants 1867 to require a specific algorithm such as ECDSA, but it is agnostic 1868 about which curve is being used. This does require that the 1869 algorithm identifier be specified in the protocol. See the first 1870 example. 1872 * Just a key type capability: This is useful if the protccol wants 1873 to require a specific a specific key type and curve, such as 1874 P-256, but will accept any algorithm using that curve (e.g. both 1875 ECDSA and ECDH). See the second example. 1877 * Both an algorithm and a key type capability: This is used if the 1878 protocol needs to nail down all of the options surrounding an 1879 algorithm E.g. EdDSA with the curve X25519. As with the first 1880 example, the algorithm identifier needs to be specified in the 1881 protocol. See the third example which just concatenates the two 1882 capabilities together. 1884 Algorithm ECDSA 1886 0x8102 / [2 \ EC2 \ ] / 1888 Key type EC2 with P-256 curve: 1890 0x820201 / [2 \ EC2 \, 1 \ P-256 \] / 1892 ECDH-ES + A256KW with an X25519 curve: 1894 0x8101820104 / [1 \ OKP \],[1 \ OKP \, 4 \ X25519 \] / 1896 The capabilities can also be used by and entity to advertise what it 1897 is capabable of doing. The decoded example below is one of many 1898 encoding that could be used for that purpose. Each array element 1899 includes three fields: the algorithm identifier, one or more 1900 algorithm capabilities, and one or more key type capabilities. 1902 [ 1903 [-8 / EdDSA /, 1904 [1 / OKP key type /], 1905 [ 1906 [1 / OKP /, 6 / Ed25519 / ], 1907 [1 /OKP/, 7 /Ed448 /] 1908 ] 1909 ], 1910 [-7 / ECDSA with SHA-256/, 1911 [2 /EC2 key type/], 1912 [ 1913 [2 /EC2/, 1 /P-256/], 1914 [2 /EC2/, 3 /P-521/] 1915 ] 1916 ], 1917 [ -31 / ECDH-ES+A256KW/, 1918 [ 1919 [ 2 /EC2/], 1920 [1 /OKP/ ] 1921 ], 1922 [ 1923 [2 /EC2/, 1 /P-256/], 1924 [1 /OKP/, 4 / X25519/ ] 1925 ] 1926 ], 1927 [ 1 / A128GCM /, 1928 [ 4 / Symmetric / ], 1929 [ 4 / Symmetric /] 1930 ] 1931 ] 1933 Examining the above: 1935 * The first element indicates that the entity supports EdDSA with 1936 curves Ed25519 and Ed448. 1938 * The second element indicates that the entity supports ECDSA with 1939 curves P-256 and P-521. 1941 * The third element indicates that the entity support ephemeral- 1942 static ECDH using AES256 key wrap. The entity can support the 1943 P-256 curve with an EC2 key type and the X25519 curve with an OKP 1944 key type. 1946 * The last element indicates that the entity supports AES-GCM of 128 1947 bits for content encryption. 1949 The entity does not advertise that it supports any MAC algorithms. 1951 9. CBOR Encoding Restrictions 1953 This document limits the restrictions it imposes on how the CBOR 1954 Encoder needs to work. It has been narrowed down to the following 1955 restrictions: 1957 * The restriction applies to the encoding of the COSE_KDF_Context. 1959 * Encoding MUST be done using definite lengths and the length of the 1960 MUST be the minimum possible length. This means that the integer 1961 1 is encoded as "0x01" and not "0x1801". 1963 * Applications MUST NOT generate messages with the same label used 1964 twice as a key in a single map. Applications MUST NOT parse and 1965 process messages with the same label used twice as a key in a 1966 single map. Applications can enforce the parse and process 1967 requirement by using parsers that will fail the parse step or by 1968 using parsers that will pass all keys to the application, and the 1969 application can perform the check for duplicate keys. 1971 10. IANA Considerations 1973 10.1. Changes to "COSE Key Types" registry. 1975 IANA is requested to create a new column in the "COSE Key Types" 1976 registry. The new column is to be labeled "Capabilities". The new 1977 column is to be populated according the entries in Table 22. 1979 +=======+===========+==========================+ 1980 | Value | Name | Capabilities | 1981 +=======+===========+==========================+ 1982 | 1 | OKP | [kty(1), crv] | 1983 +-------+-----------+--------------------------+ 1984 | 2 | EC2 | [kty(2), crv] | 1985 +-------+-----------+--------------------------+ 1986 | 3 | RSA | [kty(3)] | 1987 +-------+-----------+--------------------------+ 1988 | 4 | Symmetric | [kty(4)] | 1989 +-------+-----------+--------------------------+ 1990 | 5 | HSS-LMS | [kty(5), hash algorithm] | 1991 +-------+-----------+--------------------------+ 1993 Table 22: Key Type Capabilities 1995 IANA is requested to update the pointer for expert review to [[this 1996 document]]. 1998 10.2. Changes to "COSE Algorithms" registry 2000 IANA is requested to create a new column in the "COSE Algorithms" 2001 registry. The new column is to be labeled "Capabilities". The new 2002 column is populated with "[kty]" for all current, non-provisional, 2003 registrations. It is expected that the documents which define those 2004 algorithms will be expanded to include this registration. If this is 2005 not done then the Designated Expert should be consulted before final 2006 registration for this document is done. 2008 IANA is requested to update all references from RFC 8152 to [[This 2009 Document]]. 2011 IANA is requested to update the pointer for expert rview to [[this 2012 document]]. 2014 IANA is requested to update the reference column in the "COSE 2015 Algorithms" registry to include [[This Document]] as a reference for 2016 all rows where it is not already present. 2018 IANA is requested to add a new row to the "COSE Algorithms" registry. 2020 +==========+===============+=============+============+=============+ 2021 | Name | Value | Description | Reference | Recommended | 2022 +==========+===============+=============+============+=============+ 2023 | IV | IV-GENERATION |For doing IV | [[THIS | No | 2024 |Generation| | generation | DOCUMENT]] | | 2025 | | |for symmetric| | | 2026 | | | algorithms. | | | 2027 +----------+---------------+-------------+------------+-------------+ 2029 Table 23 2031 The capabilities column for this registration is to be empty. 2033 10.3. Changes to the "COSE Key Type Parameters" registry 2035 IANA is requested to modify the description to "Public Key" for the 2036 line with "Key Type" of 2 and the "Name" of "x". See Table 20 which 2037 has been modified with this change. 2039 IANA is requested to update the references in the table from RFC8152 2040 to [[This Document]]. 2042 IANA is requested to update the pointer for expert rview to [[this 2043 document]]. 2045 10.4. COSE Header Algorithm Parameters Registry 2047 IANA created a registry titled "COSE Header Algorithm Parameters" as 2048 part of processing [RFC8152]. The registry has been created to use 2049 the "Expert Review Required" registration procedure [RFC8126]. 2051 IANA is requested to update the references from [RFC8152] to this 2052 document. 2054 IANA is requested to update the pointer for expert rview to [[this 2055 document]]. 2057 10.5. Expert Review Instructions 2059 All of the IANA registries established by [RFC8152] are, at least in 2060 part, defined as expert review. This section gives some general 2061 guidelines for what the experts should be looking for, but they are 2062 being designated as experts for a reason, so they should be given 2063 substantial latitude. 2065 Expert reviewers should take into consideration the following points: 2067 * Point squatting should be discouraged. Reviewers are encouraged 2068 to get sufficient information for registration requests to ensure 2069 that the usage is not going to duplicate one that is already 2070 registered, and that the point is likely to be used in 2071 deployments. The zones tagged as private use are intended for 2072 testing purposes and closed environments; code points in other 2073 ranges should not be assigned for testing. 2075 * Specifications are required for the standards track range of point 2076 assignment. Specifications should exist for specification 2077 required ranges, but early assignment before a specification is 2078 available is considered to be permissible. Specifications are 2079 needed for the first-come, first-serve range if they are expected 2080 to be used outside of closed environments in an interoperable way. 2081 When specifications are not provided, the description provided 2082 needs to have sufficient information to identify what the point is 2083 being used for. 2085 * Experts should take into account the expected usage of fields when 2086 approving point assignment. The fact that there is a range for 2087 standards track documents does not mean that a standards track 2088 document cannot have points assigned outside of that range. The 2089 length of the encoded value should be weighed against how many 2090 code points of that length are left, the size of device it will be 2091 used on, and the number of code points left that encode to that 2092 size. 2094 * When algorithms are registered, vanity registrations should be 2095 discouraged. One way to do this is to require registrations to 2096 provide additional documentation on security analysis of the 2097 algorithm. Another thing that should be considered is requesting 2098 an opinion on the algorithm from the Crypto Forum Research Group 2099 (CFRG). Algorithms that do not meet the security requirements of 2100 the community and the messages structures should not be 2101 registered. 2103 11. Security Considerations 2105 There are a number of security considerations that need to be taken 2106 into account by implementers of this specification. The security 2107 considerations that are specific to an individual algorithm are 2108 placed next to the description of the algorithm. While some 2109 considerations have been highlighted here, additional considerations 2110 may be found in the documents listed in the references. 2112 Implementations need to protect the private key material for any 2113 individuals. There are some cases in this document that need to be 2114 highlighted on this issue. 2116 * Using the same key for two different algorithms can leak 2117 information about the key. It is therefore recommended that keys 2118 be restricted to a single algorithm. 2120 * Use of 'direct' as a recipient algorithm combined with a second 2121 recipient algorithm exposes the direct key to the second 2122 recipient. 2124 * Several of the algorithms in this document have limits on the 2125 number of times that a key can be used without leaking information 2126 about the key. 2128 The use of ECDH and direct plus KDF (with no key wrap) will not 2129 directly lead to the private key being leaked; the one way function 2130 of the KDF will prevent that. There is, however, a different issue 2131 that needs to be addressed. Having two recipients requires that the 2132 CEK be shared between two recipients. The second recipient therefore 2133 has a CEK that was derived from material that can be used for the 2134 weak proof of origin. The second recipient could create a message 2135 using the same CEK and send it to the first recipient; the first 2136 recipient would, for either static-static ECDH or direct plus KDF, 2137 make an assumption that the CEK could be used for proof of origin 2138 even though it is from the wrong entity. If the key wrap step is 2139 added, then no proof of origin is implied and this is not an issue. 2141 Although it has been mentioned before, the use of a single key for 2142 multiple algorithms has been demonstrated in some cases to leak 2143 information about a key, provide the opportunity for attackers to 2144 forge integrity tags, or gain information about encrypted content. 2145 Binding a key to a single algorithm prevents these problems. Key 2146 creators and key consumers are strongly encouraged not only to create 2147 new keys for each different algorithm, but to include that selection 2148 of algorithm in any distribution of key material and strictly enforce 2149 the matching of algorithms in the key structure to algorithms in the 2150 message structure. In addition to checking that algorithms are 2151 correct, the key form needs to be checked as well. Do not use an 2152 'EC2' key where an 'OKP' key is expected. 2154 Before using a key for transmission, or before acting on information 2155 received, a trust decision on a key needs to be made. Is the data or 2156 action something that the entity associated with the key has a right 2157 to see or a right to request? A number of factors are associated 2158 with this trust decision. Some of the ones that are highlighted here 2159 are: 2161 * What are the permissions associated with the key owner? 2163 * Is the cryptographic algorithm acceptable in the current context? 2165 * Have the restrictions associated with the key, such as algorithm 2166 or freshness, been checked and are they correct? 2168 * Is the request something that is reasonable, given the current 2169 state of the application? 2171 * Have any security considerations that are part of the message been 2172 enforced (as specified by the application or 'crit' parameter)? 2174 There are a large number of algorithms presented in this document 2175 that use nonce values. For all of the nonces defined in this 2176 document, there is some type of restriction on the nonce being a 2177 unique value either for a key or for some other conditions. In all 2178 of these cases, there is no known requirement on the nonce being both 2179 unique and unpredictable; under these circumstances, it's reasonable 2180 to use a counter for creation of the nonce. In cases where one wants 2181 the pattern of the nonce to be unpredictable as well as unique, one 2182 can use a key created for that purpose and encrypt the counter to 2183 produce the nonce value. 2185 One area that has been getting exposure is traffic analysis of 2186 encrypted messages based on the length of the message. This 2187 specification does not provide for a uniform method of providing 2188 padding as part of the message structure. An observer can 2189 distinguish between two different messages (for example, 'YES' and 2190 'NO') based on the length for all of the content encryption 2191 algorithms that are defined in this document. This means that it is 2192 up to the applications to document how content padding is to be done 2193 in order to prevent or discourage such analysis. (For example, the 2194 text strings could be defined as 'YES' and 'NO '.) 2196 The analsys done in [I-D.ietf-quic-tls] is based on the number of 2197 records/packets that are sent. This should map well to the number of 2198 messages sent when use COSE so that analysis should hold here as 2199 well. It needs to be noted that the limits are based on the number 2200 of messages, but QUIC and DTLS are always pair-wise based endpoints, 2201 [I-D.ietf-core-oscore-groupcomm] use COSE in a group communication. 2202 Under these circumstances it may be that no one single entity will 2203 see all of the messages that are encrypted an therefore no single 2204 entity can trigger the rekey operation. 2206 12. References 2208 12.1. Normative References 2210 [I-D.ietf-cose-rfc8152bis-struct] 2211 Schaad, J., "CBOR Object Signing and Encryption (COSE): 2212 Structures and Process", Work in Progress, Internet-Draft, 2213 draft-ietf-cose-rfc8152bis-struct-10, 2 June 2020, 2214 . 2217 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 2218 Hashing for Message Authentication", RFC 2104, 2219 DOI 10.17487/RFC2104, February 1997, 2220 . 2222 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2223 Requirement Levels", BCP 14, RFC 2119, 2224 DOI 10.17487/RFC2119, March 1997, 2225 . 2227 [RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard 2228 (AES) Key Wrap Algorithm", RFC 3394, DOI 10.17487/RFC3394, 2229 September 2002, . 2231 [RFC3610] Whiting, D., Housley, R., and N. Ferguson, "Counter with 2232 CBC-MAC (CCM)", RFC 3610, DOI 10.17487/RFC3610, September 2233 2003, . 2235 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 2236 Key Derivation Function (HKDF)", RFC 5869, 2237 DOI 10.17487/RFC5869, May 2010, 2238 . 2240 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 2241 Curve Cryptography Algorithms", RFC 6090, 2242 DOI 10.17487/RFC6090, February 2011, 2243 . 2245 [RFC6979] Pornin, T., "Deterministic Usage of the Digital Signature 2246 Algorithm (DSA) and Elliptic Curve Digital Signature 2247 Algorithm (ECDSA)", RFC 6979, DOI 10.17487/RFC6979, August 2248 2013, . 2250 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 2251 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 2252 October 2013, . 2254 [RFC8439] Nir, Y. and A. Langley, "ChaCha20 and Poly1305 for IETF 2255 Protocols", RFC 8439, DOI 10.17487/RFC8439, June 2018, 2256 . 2258 [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves 2259 for Security", RFC 7748, DOI 10.17487/RFC7748, January 2260 2016, . 2262 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2263 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2264 May 2017, . 2266 [AES-GCM] National Institute of Standards and Technology, 2267 "Recommendation for Block Cipher Modes of Operation: 2268 Galois/Counter Mode (GCM) and GMAC", 2269 DOI 10.6028/NIST.SP.800-38D, NIST Special 2270 Publication 800-38D, November 2007, 2271 . 2274 [DSS] National Institute of Standards and Technology, "Digital 2275 Signature Standard (DSS)", DOI 10.6028/NIST.FIPS.186-4, 2276 FIPS PUB 186-4, July 2013, 2277 . 2280 [MAC] Menees, A., van Oorschot, P., and S. Vanstone, "Handbook 2281 of Applied Cryptography", 1996. 2283 [SEC1] Certicom Research, "SEC 1: Elliptic Curve Cryptography", 2284 May 2009, . 2286 [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital 2287 Signature Algorithm (EdDSA)", RFC 8032, 2288 DOI 10.17487/RFC8032, January 2017, 2289 . 2291 [RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, 2292 "PKCS #1: RSA Cryptography Specifications Version 2.2", 2293 RFC 8017, DOI 10.17487/RFC8017, November 2016, 2294 . 2296 12.2. Informative References 2298 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2299 Writing an IANA Considerations Section in RFCs", BCP 26, 2300 RFC 8126, DOI 10.17487/RFC8126, June 2017, 2301 . 2303 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 2304 Definition Language (CDDL): A Notational Convention to 2305 Express Concise Binary Object Representation (CBOR) and 2306 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 2307 June 2019, . 2309 [RFC4231] Nystrom, M., "Identifiers and Test Vectors for HMAC-SHA- 2310 224, HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512", 2311 RFC 4231, DOI 10.17487/RFC4231, December 2005, 2312 . 2314 [RFC4493] Song, JH., Poovendran, R., Lee, J., and T. Iwata, "The 2315 AES-CMAC Algorithm", RFC 4493, DOI 10.17487/RFC4493, June 2316 2006, . 2318 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 2319 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 2320 . 2322 [RFC5480] Turner, S., Brown, D., Yiu, K., Housley, R., and T. Polk, 2323 "Elliptic Curve Cryptography Subject Public Key 2324 Information", RFC 5480, DOI 10.17487/RFC5480, March 2009, 2325 . 2327 [RFC6151] Turner, S. and L. Chen, "Updated Security Considerations 2328 for the MD5 Message-Digest and the HMAC-MD5 Algorithms", 2329 RFC 6151, DOI 10.17487/RFC6151, March 2011, 2330 . 2332 [STD90] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2333 Interchange Format", STD 90, RFC 8259, December 2017. 2335 2337 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 2338 Application Protocol (CoAP)", RFC 7252, 2339 DOI 10.17487/RFC7252, June 2014, 2340 . 2342 [RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518, 2343 DOI 10.17487/RFC7518, May 2015, 2344 . 2346 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 2347 RFC 8152, DOI 10.17487/RFC8152, July 2017, 2348 . 2350 [RFC8551] Schaad, J., Ramsdell, B., and S. Turner, "Secure/ 2351 Multipurpose Internet Mail Extensions (S/MIME) Version 4.0 2352 Message Specification", RFC 8551, DOI 10.17487/RFC8551, 2353 April 2019, . 2355 [RFC8230] Jones, M., "Using RSA Algorithms with CBOR Object Signing 2356 and Encryption (COSE) Messages", RFC 8230, 2357 DOI 10.17487/RFC8230, September 2017, 2358 . 2360 [I-D.ietf-core-oscore-groupcomm] 2361 Tiloca, M., Selander, G., Palombini, F., and J. Park, 2362 "Group OSCORE - Secure Group Communication for CoAP", Work 2363 in Progress, Internet-Draft, draft-ietf-core-oscore- 2364 groupcomm-09, 23 June 2020, . 2367 [I-D.ietf-cose-hash-sig] 2368 Housley, R., "Use of the HSS/LMS Hash-based Signature 2369 Algorithm with CBOR Object Signing and Encryption (COSE)", 2370 Work in Progress, Internet-Draft, draft-ietf-cose-hash- 2371 sig-09, 11 December 2019, 2372 . 2374 [SP800-38d] 2375 Dworkin, M., "Recommendation for Block Cipher Modes of 2376 Operation: Galois/Counter Mode (GCM) and GMAC", NIST 2377 Special Publication 800-38D , November 2007, 2378 . 2381 [SP800-56A] 2382 Barker, E., Chen, L., Roginsky, A., and M. Smid, 2383 "Recommendation for Pair-Wise Key Establishment Schemes 2384 Using Discrete Logarithm Cryptography", 2385 DOI 10.6028/NIST.SP.800-56Ar2, NIST Special Publication 2386 800-56A, Revision 2, May 2013, 2387 . 2390 [GitHub-Examples] 2391 "GitHub Examples of COSE", 2392 . 2394 [I-D.mattsson-cfrg-det-sigs-with-noise] 2395 Mattsson, J., Thormarker, E., and S. Ruohomaa, 2396 "Deterministic ECDSA and EdDSA Signatures with Additional 2397 Randomness", Work in Progress, Internet-Draft, draft- 2398 mattsson-cfrg-det-sigs-with-noise-02, 11 March 2020, 2399 . 2402 [HKDF] Krawczyk, H., "Cryptographic Extraction and Key 2403 Derivation: The HKDF Scheme", 2010, 2404 . 2406 [ROBUST] Fischlin, M., Günther, F., and C. Janson, "Robust 2407 Channels: Handling Unreliable Networks in the Record 2408 Layers of QUIC and DTLS", February 2020, 2409 . 2412 [I-D.ietf-quic-tls] 2413 Thomson, M. and S. Turner, "Using TLS to Secure QUIC", 2414 Work in Progress, Internet-Draft, draft-ietf-quic-tls-29, 2415 9 June 2020, 2416 . 2418 Acknowledgments 2420 This document is a product of the COSE working group of the IETF. 2422 The following individuals are to blame for getting me started on this 2423 project in the first place: Richard Barnes, Matt Miller, and Martin 2424 Thomson. 2426 The initial version of the specification was based to some degree on 2427 the outputs of the JOSE and S/MIME working groups. 2429 The following individuals provided input into the final form of the 2430 document: Carsten Bormann, John Bradley, Brain Campbell, Michael B. 2431 Jones, Ilari Liusvaara, Francesca Palombini, Ludwig Seitz, and 2432 Göran Selander. 2434 Author's Address 2436 Jim Schaad 2437 August Cellars 2439 Email: ietf@augustcellars.com