idnits 2.17.1 draft-ietf-jose-json-web-algorithms-22.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 26 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 2, 2014) is 3680 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 2853 -- Looks like a reference, but probably isn't: '0' on line 2853 -- Looks like a reference, but probably isn't: '7' on line 2825 -- Looks like a reference, but probably isn't: '65' on line 2833 -- Looks like a reference, but probably isn't: '49' on line 2827 -- Looks like a reference, but probably isn't: '50' on line 2827 -- Looks like a reference, but probably isn't: '56' on line 2827 -- Looks like a reference, but probably isn't: '71' on line 2827 -- Looks like a reference, but probably isn't: '67' on line 2827 -- Looks like a reference, but probably isn't: '77' on line 2827 -- Looks like a reference, but probably isn't: '5' on line 2831 -- Looks like a reference, but probably isn't: '108' on line 2833 -- Looks like a reference, but probably isn't: '105' on line 2833 -- Looks like a reference, but probably isn't: '99' on line 2833 -- Looks like a reference, but probably isn't: '101' on line 2833 -- Looks like a reference, but probably isn't: '3' on line 2837 -- Looks like a reference, but probably isn't: '66' on line 2839 -- Looks like a reference, but probably isn't: '111' on line 2839 -- Looks like a reference, but probably isn't: '98' on line 2839 -- Looks like a reference, but probably isn't: '128' on line 2843 -- Possible downref: Non-RFC (?) normative reference: ref. 'AES' -- Possible downref: Non-RFC (?) normative reference: ref. 'DSS' ** Downref: Normative reference to an Informational RFC: RFC 2104 ** Obsolete normative reference: RFC 2898 (Obsoleted by RFC 8018) ** Downref: Normative reference to an Informational RFC: RFC 3394 ** Downref: Normative reference to an Informational RFC: RFC 6090 ** Obsolete normative reference: RFC 7158 (Obsoleted by RFC 7159) -- Possible downref: Non-RFC (?) normative reference: ref. 'SEC1' -- Possible downref: Non-RFC (?) normative reference: ref. 'SHS' -- Possible downref: Non-RFC (?) normative reference: ref. 'USASCII' == Outdated reference: A later version (-18) exists of draft-ietf-precis-saslprepbis-06 == Outdated reference: A later version (-05) exists of draft-mcgrew-aead-aes-cbc-hmac-sha2-04 -- Obsolete informational reference (is this intentional?): RFC 3447 (Obsoleted by RFC 8017) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) Summary: 5 errors (**), 0 flaws (~~), 4 warnings (==), 29 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 JOSE Working Group M. Jones 3 Internet-Draft Microsoft 4 Intended status: Standards Track March 2, 2014 5 Expires: September 3, 2014 7 JSON Web Algorithms (JWA) 8 draft-ietf-jose-json-web-algorithms-22 10 Abstract 12 The JSON Web Algorithms (JWA) specification registers cryptographic 13 algorithms and identifiers to be used with the JSON Web Signature 14 (JWS), JSON Web Encryption (JWE), and JSON Web Key (JWK) 15 specifications. It defines several IANA registries for these 16 identifiers. 18 Status of this Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on September 3, 2014. 35 Copyright Notice 37 Copyright (c) 2014 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 53 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 5 54 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 55 3. Cryptographic Algorithms for Digital Signatures and MACs . . . 6 56 3.1. "alg" (Algorithm) Header Parameter Values for JWS . . . . 6 57 3.2. HMAC with SHA-2 Functions . . . . . . . . . . . . . . . . 7 58 3.3. Digital Signature with RSASSA-PKCS1-V1_5 . . . . . . . . . 8 59 3.4. Digital Signature with ECDSA . . . . . . . . . . . . . . . 9 60 3.5. Digital Signature with RSASSA-PSS . . . . . . . . . . . . 10 61 3.6. Using the Algorithm "none" . . . . . . . . . . . . . . . . 11 62 4. Cryptographic Algorithms for Key Management . . . . . . . . . 12 63 4.1. "alg" (Algorithm) Header Parameter Values for JWE . . . . 12 64 4.2. Key Encryption with RSAES-PKCS1-V1_5 . . . . . . . . . . . 14 65 4.3. Key Encryption with RSAES OAEP . . . . . . . . . . . . . . 14 66 4.4. Key Wrapping with AES Key Wrap . . . . . . . . . . . . . . 14 67 4.5. Direct Encryption with a Shared Symmetric Key . . . . . . 15 68 4.6. Key Agreement with Elliptic Curve Diffie-Hellman 69 Ephemeral Static (ECDH-ES) . . . . . . . . . . . . . . . . 15 70 4.6.1. Header Parameters Used for ECDH Key Agreement . . . . 16 71 4.6.1.1. "epk" (Ephemeral Public Key) Header Parameter . . 16 72 4.6.1.2. "apu" (Agreement PartyUInfo) Header Parameter . . 16 73 4.6.1.3. "apv" (Agreement PartyVInfo) Header Parameter . . 16 74 4.6.2. Key Derivation for ECDH Key Agreement . . . . . . . . 17 75 4.7. Key Encryption with AES GCM . . . . . . . . . . . . . . . 18 76 4.7.1. Header Parameters Used for AES GCM Key Encryption . . 19 77 4.7.1.1. "iv" (Initialization Vector) Header Parameter . . 19 78 4.7.1.2. "tag" (Authentication Tag) Header Parameter . . . 19 79 4.8. Key Encryption with PBES2 . . . . . . . . . . . . . . . . 19 80 4.8.1. Header Parameters Used for PBES2 Key Encryption . . . 20 81 4.8.1.1. "p2s" (PBES2 salt input) Parameter . . . . . . . . 20 82 4.8.1.2. "p2c" (PBES2 count) Parameter . . . . . . . . . . 20 83 5. Cryptographic Algorithms for Content Encryption . . . . . . . 21 84 5.1. "enc" (Encryption Algorithm) Header Parameter Values 85 for JWE . . . . . . . . . . . . . . . . . . . . . . . . . 21 86 5.2. AES_CBC_HMAC_SHA2 Algorithms . . . . . . . . . . . . . . . 22 87 5.2.1. Conventions Used in Defining AES_CBC_HMAC_SHA2 . . . . 22 88 5.2.2. Generic AES_CBC_HMAC_SHA2 Algorithm . . . . . . . . . 22 89 5.2.2.1. AES_CBC_HMAC_SHA2 Encryption . . . . . . . . . . . 23 90 5.2.2.2. AES_CBC_HMAC_SHA2 Decryption . . . . . . . . . . . 24 91 5.2.3. AES_128_CBC_HMAC_SHA_256 . . . . . . . . . . . . . . . 25 92 5.2.4. AES_192_CBC_HMAC_SHA_384 . . . . . . . . . . . . . . . 25 93 5.2.5. AES_256_CBC_HMAC_SHA_512 . . . . . . . . . . . . . . . 26 94 5.2.6. Content Encryption with AES_CBC_HMAC_SHA2 . . . . . . 26 95 5.3. Content Encryption with AES GCM . . . . . . . . . . . . . 26 96 6. Cryptographic Algorithms for Keys . . . . . . . . . . . . . . 27 97 6.1. "kty" (Key Type) Parameter Values . . . . . . . . . . . . 27 98 6.2. Parameters for Elliptic Curve Keys . . . . . . . . . . . . 28 99 6.2.1. Parameters for Elliptic Curve Public Keys . . . . . . 28 100 6.2.1.1. "crv" (Curve) Parameter . . . . . . . . . . . . . 28 101 6.2.1.2. "x" (X Coordinate) Parameter . . . . . . . . . . . 28 102 6.2.1.3. "y" (Y Coordinate) Parameter . . . . . . . . . . . 29 103 6.2.2. Parameters for Elliptic Curve Private Keys . . . . . . 29 104 6.2.2.1. "d" (ECC Private Key) Parameter . . . . . . . . . 29 105 6.3. Parameters for RSA Keys . . . . . . . . . . . . . . . . . 29 106 6.3.1. Parameters for RSA Public Keys . . . . . . . . . . . . 29 107 6.3.1.1. "n" (Modulus) Parameter . . . . . . . . . . . . . 29 108 6.3.1.2. "e" (Exponent) Parameter . . . . . . . . . . . . . 29 109 6.3.2. Parameters for RSA Private Keys . . . . . . . . . . . 30 110 6.3.2.1. "d" (Private Exponent) Parameter . . . . . . . . . 30 111 6.3.2.2. "p" (First Prime Factor) Parameter . . . . . . . . 30 112 6.3.2.3. "q" (Second Prime Factor) Parameter . . . . . . . 30 113 6.3.2.4. "dp" (First Factor CRT Exponent) Parameter . . . . 30 114 6.3.2.5. "dq" (Second Factor CRT Exponent) Parameter . . . 31 115 6.3.2.6. "qi" (First CRT Coefficient) Parameter . . . . . . 31 116 6.3.2.7. "oth" (Other Primes Info) Parameter . . . . . . . 31 117 6.4. Parameters for Symmetric Keys . . . . . . . . . . . . . . 32 118 6.4.1. "k" (Key Value) Parameter . . . . . . . . . . . . . . 32 119 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 32 120 7.1. JSON Web Signature and Encryption Algorithms Registry . . 33 121 7.1.1. Registration Template . . . . . . . . . . . . . . . . 33 122 7.1.2. Initial Registry Contents . . . . . . . . . . . . . . 34 123 7.2. JWE Header Parameter Names Registration . . . . . . . . . 40 124 7.2.1. Registry Contents . . . . . . . . . . . . . . . . . . 40 125 7.3. JSON Web Encryption Compression Algorithms Registry . . . 41 126 7.3.1. Registration Template . . . . . . . . . . . . . . . . 41 127 7.3.2. Initial Registry Contents . . . . . . . . . . . . . . 42 128 7.4. JSON Web Key Types Registry . . . . . . . . . . . . . . . 42 129 7.4.1. Registration Template . . . . . . . . . . . . . . . . 42 130 7.4.2. Initial Registry Contents . . . . . . . . . . . . . . 43 131 7.5. JSON Web Key Parameters Registration . . . . . . . . . . . 44 132 7.5.1. Registry Contents . . . . . . . . . . . . . . . . . . 44 133 7.6. JSON Web Key Elliptic Curve Registry . . . . . . . . . . . 46 134 7.6.1. Registration Template . . . . . . . . . . . . . . . . 46 135 7.6.2. Initial Registry Contents . . . . . . . . . . . . . . 47 136 8. Security Considerations . . . . . . . . . . . . . . . . . . . 47 137 8.1. Algorithms and Key Sizes will be Deprecated . . . . . . . 48 138 8.2. Key Lifetimes . . . . . . . . . . . . . . . . . . . . . . 48 139 8.3. RSAES-PKCS1-v1_5 Security Considerations . . . . . . . . . 48 140 8.4. AES GCM Security Considerations . . . . . . . . . . . . . 48 141 8.5. Plaintext JWS Security Considerations . . . . . . . . . . 49 142 8.6. Differences between Digital Signatures and MACs . . . . . 49 143 8.7. Denial of Service Attacks . . . . . . . . . . . . . . . . 50 144 8.8. Reusing Key Material when Encrypting Keys . . . . . . . . 50 145 8.9. Password Considerations . . . . . . . . . . . . . . . . . 50 147 9. Internationalization Considerations . . . . . . . . . . . . . 51 148 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 51 149 10.1. Normative References . . . . . . . . . . . . . . . . . . . 51 150 10.2. Informative References . . . . . . . . . . . . . . . . . . 53 151 Appendix A. Algorithm Identifier Cross-Reference . . . . . . . . 54 152 A.1. Digital Signature/MAC Algorithm Identifier 153 Cross-Reference . . . . . . . . . . . . . . . . . . . . . 55 154 A.2. Key Management Algorithm Identifier Cross-Reference . . . 55 155 A.3. Content Encryption Algorithm Identifier Cross-Reference . 56 156 Appendix B. Test Cases for AES_CBC_HMAC_SHA2 Algorithms . . . . . 57 157 B.1. Test Cases for AES_128_CBC_HMAC_SHA_256 . . . . . . . . . 58 158 B.2. Test Cases for AES_192_CBC_HMAC_SHA_384 . . . . . . . . . 59 159 B.3. Test Cases for AES_256_CBC_HMAC_SHA_512 . . . . . . . . . 60 160 Appendix C. Example ECDH-ES Key Agreement Computation . . . . . . 61 161 Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 63 162 Appendix E. Document History . . . . . . . . . . . . . . . . . . 64 163 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 72 165 1. Introduction 167 The JSON Web Algorithms (JWA) specification registers cryptographic 168 algorithms and identifiers to be used with the JSON Web Signature 169 (JWS) [JWS], JSON Web Encryption (JWE) [JWE], and JSON Web Key (JWK) 170 [JWK] specifications. It defines several IANA registries for these 171 identifiers. All these specifications utilize JavaScript Object 172 Notation (JSON) [RFC7158] based data structures. This specification 173 also describes the semantics and operations that are specific to 174 these algorithms and key types. 176 Registering the algorithms and identifiers here, rather than in the 177 JWS, JWE, and JWK specifications, is intended to allow them to remain 178 unchanged in the face of changes in the set of Required, Recommended, 179 Optional, and Deprecated algorithms over time. This also allows 180 changes to the JWS, JWE, and JWK specifications without changing this 181 document. 183 Names defined by this specification are short because a core goal is 184 for the resulting representations to be compact. 186 1.1. Notational Conventions 188 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 189 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 190 "OPTIONAL" in this document are to be interpreted as described in Key 191 words for use in RFCs to Indicate Requirement Levels [RFC2119]. If 192 these words are used without being spelled in uppercase then they are 193 to be interpreted with their normal natural language meanings. 195 BASE64URL(OCTETS) denotes the base64url encoding of OCTETS, per 196 Section 2. 198 UTF8(STRING) denotes the octets of the UTF-8 [RFC3629] representation 199 of STRING. 201 ASCII(STRING) denotes the octets of the ASCII [USASCII] 202 representation of STRING. 204 The concatenation of two values A and B is denoted as A || B. 206 2. Terminology 208 These terms defined by the JSON Web Signature (JWS) [JWS] 209 specification are incorporated into this specification: "JSON Web 210 Signature (JWS)", "JWS Header", "JWS Payload", "JWS Signature", "JWS 211 Protected Header", "Base64url Encoding", and "JWS Signing Input". 213 These terms defined by the JSON Web Encryption (JWE) [JWE] 214 specification are incorporated into this specification: "JSON Web 215 Encryption (JWE)", "Authenticated Encryption", "Plaintext", 216 "Ciphertext", "Additional Authenticated Data (AAD)", "Authentication 217 Tag", "Content Encryption Key (CEK)", "JWE Header", "JWE Encrypted 218 Key", "JWE Initialization Vector", "JWE Ciphertext", "JWE 219 Authentication Tag", "JWE Protected Header", "Key Management Mode", 220 "Key Encryption", "Key Wrapping", "Direct Key Agreement", "Key 221 Agreement with Key Wrapping", and "Direct Encryption". 223 These terms defined by the JSON Web Key (JWK) [JWK] specification are 224 incorporated into this specification: "JSON Web Key (JWK)" and "JSON 225 Web Key Set (JWK Set)". 227 These terms are defined for use by this specification: 229 Header Parameter 230 A name/value pair that is member of a JWS Header or JWE Header. 232 3. Cryptographic Algorithms for Digital Signatures and MACs 234 JWS uses cryptographic algorithms to digitally sign or create a 235 Message Authentication Codes (MAC) of the contents of the JWS Header 236 and the JWS Payload. 238 3.1. "alg" (Algorithm) Header Parameter Values for JWS 240 The table below is the set of "alg" (algorithm) header parameter 241 values defined by this specification for use with JWS, each of which 242 is explained in more detail in the following sections: 244 +---------------+------------------------------+--------------------+ 245 | alg Parameter | Digital Signature or MAC | Implementation | 246 | Value | Algorithm | Requirements | 247 +---------------+------------------------------+--------------------+ 248 | HS256 | HMAC using SHA-256 | Required | 249 | HS384 | HMAC using SHA-384 | Optional | 250 | HS512 | HMAC using SHA-512 | Optional | 251 | RS256 | RSASSA-PKCS-v1_5 using | Recommended | 252 | | SHA-256 | | 253 | RS384 | RSASSA-PKCS-v1_5 using | Optional | 254 | | SHA-384 | | 255 | RS512 | RSASSA-PKCS-v1_5 using | Optional | 256 | | SHA-512 | | 257 | ES256 | ECDSA using P-256 and | Recommended+ | 258 | | SHA-256 | | 259 | ES384 | ECDSA using P-384 and | Optional | 260 | | SHA-384 | | 261 | ES512 | ECDSA using P-521 and | Optional | 262 | | SHA-512 | | 263 | PS256 | RSASSA-PSS using SHA-256 and | Optional | 264 | | MGF1 with SHA-256 | | 265 | PS384 | RSASSA-PSS using SHA-384 and | Optional | 266 | | MGF1 with SHA-384 | | 267 | PS512 | RSASSA-PSS using SHA-512 and | Optional | 268 | | MGF1 with SHA-512 | | 269 | none | No digital signature or MAC | Optional | 270 | | performed | | 271 +---------------+------------------------------+--------------------+ 273 The use of "+" in the Implementation Requirements indicates that the 274 requirement strength is likely to be increased in a future version of 275 the specification. 277 See Appendix A.1 for a table cross-referencing the JWS digital 278 signature and MAC "alg" (algorithm) values defined in this 279 specification with the equivalent identifiers used by other standards 280 and software packages. 282 3.2. HMAC with SHA-2 Functions 284 Hash-based Message Authentication Codes (HMACs) enable one to use a 285 secret plus a cryptographic hash function to generate a Message 286 Authentication Code (MAC). This can be used to demonstrate that 287 whoever generated the MAC was in possession of the MAC key. The 288 algorithm for implementing and validating HMACs is provided in RFC 289 2104 [RFC2104]. 291 A key of the same size as the hash output (for instance, 256 bits for 292 "HS256") or larger MUST be used with this algorithm. 294 The HMAC SHA-256 MAC is generated per RFC 2104, using SHA-256 as the 295 hash algorithm "H", using the JWS Signing Input as the "text" value, 296 and using the shared key. The HMAC output value is the JWS 297 Signature. 299 The following "alg" (algorithm) Header Parameter values are used to 300 indicate that the JWS Signature is an HMAC value computed using the 301 corresponding algorithm: 303 +---------------------+--------------------+ 304 | alg Parameter Value | MAC Algorithm | 305 +---------------------+--------------------+ 306 | HS256 | HMAC using SHA-256 | 307 | HS384 | HMAC using SHA-384 | 308 | HS512 | HMAC using SHA-512 | 309 +---------------------+--------------------+ 311 The HMAC SHA-256 MAC for a JWS is validated by computing an HMAC 312 value per RFC 2104, using SHA-256 as the hash algorithm "H", using 313 the received JWS Signing Input as the "text" value, and using the 314 shared key. This computed HMAC value is then compared to the result 315 of base64url decoding the received encoded JWS Signature value. 316 Alternatively, the computed HMAC value can be base64url encoded and 317 compared to the received encoded JWS Signature value, as this 318 comparison produces the same result as comparing the unencoded 319 values. In either case, if the values match, the HMAC has been 320 validated. 322 Securing content and validation with the HMAC SHA-384 and HMAC SHA- 323 512 algorithms is performed identically to the procedure for HMAC 324 SHA-256 -- just using the corresponding hash algorithms with 325 correspondingly larger minimum key sizes and result values: 384 bits 326 each for HMAC SHA-384 and 512 bits each for HMAC SHA-512. 328 An example using this algorithm is shown in Appendix A.1 of [JWS]. 330 3.3. Digital Signature with RSASSA-PKCS1-V1_5 332 This section defines the use of the RSASSA-PKCS1-V1_5 digital 333 signature algorithm as defined in Section 8.2 of RFC 3447 [RFC3447] 334 (commonly known as PKCS #1), using SHA-2 [SHS] hash functions. 336 A key of size 2048 bits or larger MUST be used with these algorithms. 338 The RSASSA-PKCS1-V1_5 SHA-256 digital signature is generated as 339 follows: Generate a digital signature of the JWS Signing Input using 340 RSASSA-PKCS1-V1_5-SIGN and the SHA-256 hash function with the desired 341 private key. This is the JWS Signature value. 343 The following "alg" (algorithm) Header Parameter values are used to 344 indicate that the JWS Signature is a digital signature value computed 345 using the corresponding algorithm: 347 +---------------------+--------------------------------+ 348 | alg Parameter Value | Digital Signature Algorithm | 349 +---------------------+--------------------------------+ 350 | RS256 | RSASSA-PKCS-v1_5 using SHA-256 | 351 | RS384 | RSASSA-PKCS-v1_5 using SHA-384 | 352 | RS512 | RSASSA-PKCS-v1_5 using SHA-512 | 353 +---------------------+--------------------------------+ 355 The RSASSA-PKCS1-V1_5 SHA-256 digital signature for a JWS is 356 validated as follows: Submit the JWS Signing Input, the JWS 357 Signature, and the public key corresponding to the private key used 358 by the signer to the RSASSA-PKCS1-V1_5-VERIFY algorithm using SHA-256 359 as the hash function. 361 Signing and validation with the RSASSA-PKCS1-V1_5 SHA-384 and RSASSA- 362 PKCS1-V1_5 SHA-512 algorithms is performed identically to the 363 procedure for RSASSA-PKCS1-V1_5 SHA-256 -- just using the 364 corresponding hash algorithms instead of SHA-256. 366 An example using this algorithm is shown in Appendix A.2 of [JWS]. 368 3.4. Digital Signature with ECDSA 370 The Elliptic Curve Digital Signature Algorithm (ECDSA) [DSS] provides 371 for the use of Elliptic Curve cryptography, which is able to provide 372 equivalent security to RSA cryptography but using shorter key sizes 373 and with greater processing speed. This means that ECDSA digital 374 signatures will be substantially smaller in terms of length than 375 equivalently strong RSA digital signatures. 377 This specification defines the use of ECDSA with the P-256 curve and 378 the SHA-256 cryptographic hash function, ECDSA with the P-384 curve 379 and the SHA-384 hash function, and ECDSA with the P-521 curve and the 380 SHA-512 hash function. The P-256, P-384, and P-521 curves are 381 defined in [DSS]. 383 The ECDSA P-256 SHA-256 digital signature is generated as follows: 385 1. Generate a digital signature of the JWS Signing Input using ECDSA 386 P-256 SHA-256 with the desired private key. The output will be 387 the pair (R, S), where R and S are 256 bit unsigned integers. 389 2. Turn R and S into octet sequences in big endian order, with each 390 array being be 32 octets long. The octet sequence 391 representations MUST NOT be shortened to omit any leading zero 392 octets contained in the values. 394 3. Concatenate the two octet sequences in the order R and then S. 395 (Note that many ECDSA implementations will directly produce this 396 concatenation as their output.) 398 4. The resulting 64 octet sequence is the JWS Signature value. 400 The following "alg" (algorithm) Header Parameter values are used to 401 indicate that the JWS Signature is a digital signature value computed 402 using the corresponding algorithm: 404 +---------------------+-------------------------------+ 405 | alg Parameter Value | Digital Signature Algorithm | 406 +---------------------+-------------------------------+ 407 | ES256 | ECDSA using P-256 and SHA-256 | 408 | ES384 | ECDSA using P-384 and SHA-384 | 409 | ES512 | ECDSA using P-521 and SHA-512 | 410 +---------------------+-------------------------------+ 412 The ECDSA P-256 SHA-256 digital signature for a JWS is validated as 413 follows: 415 1. The JWS Signature value MUST be a 64 octet sequence. If it is 416 not a 64 octet sequence, the validation has failed. 418 2. Split the 64 octet sequence into two 32 octet sequences. The 419 first array will be R and the second S (with both being in big 420 endian octet order). 422 3. Submit the JWS Signing Input R, S and the public key (x, y) to 423 the ECDSA P-256 SHA-256 validator. 425 Signing and validation with the ECDSA P-384 SHA-384 and ECDSA P-521 426 SHA-512 algorithms is performed identically to the procedure for 427 ECDSA P-256 SHA-256 -- just using the corresponding hash algorithms 428 with correspondingly larger result values. For ECDSA P-384 SHA-384, 429 R and S will be 384 bits each, resulting in a 96 octet sequence. For 430 ECDSA P-521 SHA-512, R and S will be 521 bits each, resulting in a 431 132 octet sequence. 433 Examples using these algorithms are shown in Appendices A.3 and A.4 434 of [JWS]. 436 3.5. Digital Signature with RSASSA-PSS 438 This section defines the use of the RSASSA-PSS digital signature 439 algorithm as defined in Section 8.1 of RFC 3447 [RFC3447] with the 440 MGF1 mask generation function and SHA-2 hash functions, always using 441 the same hash function for both the RSASSA-PSS hash function and the 442 MGF1 hash function. The size of the salt value is the same size as 443 the hash function output. All other algorithm parameters use the 444 defaults specified in Section A.2.3 of RFC 3447. 446 A key of size 2048 bits or larger MUST be used with this algorithm. 448 The RSASSA-PSS SHA-256 digital signature is generated as follows: 449 Generate a digital signature of the JWS Signing Input using RSASSA- 450 PSS-SIGN, the SHA-256 hash function, and the MGF1 mask generation 451 function with SHA-256 with the desired private key. This is the JWS 452 signature value. 454 The following "alg" (algorithm) Header Parameter values are used to 455 indicate that the JWS Signature is a digital signature value computed 456 using the corresponding algorithm: 458 +---------------------+---------------------------------------------+ 459 | alg Parameter Value | Digital Signature Algorithm | 460 +---------------------+---------------------------------------------+ 461 | PS256 | RSASSA-PSS using SHA-256 and MGF1 with | 462 | | SHA-256 | 463 | PS384 | RSASSA-PSS using SHA-384 and MGF1 with | 464 | | SHA-384 | 465 | PS512 | RSASSA-PSS using SHA-512 and MGF1 with | 466 | | SHA-512 | 467 +---------------------+---------------------------------------------+ 469 The RSASSA-PSS SHA-256 digital signature for a JWS is validated as 470 follows: Submit the JWS Signing Input, the JWS Signature, and the 471 public key corresponding to the private key used by the signer to the 472 RSASSA-PSS-VERIFY algorithm using SHA-256 as the hash function and 473 using MGF1 as the mask generation function with SHA-256. 475 Signing and validation with the RSASSA-PSS SHA-384 and RSASSA-PSS 476 SHA-512 algorithms is performed identically to the procedure for 477 RSASSA-PSS SHA-256 -- just using the alternative hash algorithm in 478 both roles. 480 3.6. Using the Algorithm "none" 482 JWSs MAY also be created that do not provide integrity protection. 483 Such a JWS is called a "Plaintext JWS". A Plaintext JWS MUST use the 484 "alg" value "none", and is formatted identically to other JWSs, but 485 MUST use the empty octet sequence as its JWS Signature value. 486 Receivers MUST verify that the JWS Signature value is the empty octet 487 sequence. See Section 8.5 for security considerations associated 488 with using this algorithm. 490 4. Cryptographic Algorithms for Key Management 492 JWE uses cryptographic algorithms to encrypt or determine the Content 493 Encryption Key (CEK). 495 4.1. "alg" (Algorithm) Header Parameter Values for JWE 497 The table below is the set of "alg" (algorithm) Header Parameter 498 values that are defined by this specification for use with JWE. 499 These algorithms are used to encrypt the CEK, producing the JWE 500 Encrypted Key, or to use key agreement to agree upon the CEK. 502 +-------------------+-----------------+------------+----------------+ 503 | alg Parameter | Key Management | Additional | Implementation | 504 | Value | Algorithm | Header | Requirements | 505 | | | Parameters | | 506 +-------------------+-----------------+------------+----------------+ 507 | RSA1_5 | RSAES-PKCS1-V1_ | (none) | Required | 508 | | 5 | | | 509 | RSA-OAEP | RSAES using | (none) | Optional | 510 | | OAEP with | | | 511 | | default | | | 512 | | parameters | | | 513 | A128KW | AES Key Wrap | (none) | Recommended | 514 | | with default | | | 515 | | initial value | | | 516 | | using 128 bit | | | 517 | | key | | | 518 | A192KW | AES Key Wrap | (none) | Optional | 519 | | with default | | | 520 | | initial value | | | 521 | | using 192 bit | | | 522 | | key | | | 523 | A256KW | AES Key Wrap | (none) | Recommended | 524 | | with default | | | 525 | | initial value | | | 526 | | using 256 bit | | | 527 | | key | | | 528 | dir | Direct use of a | (none) | Recommended | 529 | | shared | | | 530 | | symmetric key | | | 531 | | as the CEK | | | 532 | ECDH-ES | Elliptic Curve | "epk", | Recommended+ | 533 | | Diffie-Hellman | "apu", | | 534 | | Ephemeral | "apv" | | 535 | | Static key | | | 536 | | agreement using | | | 537 | | Concat KDF | | | 538 | ECDH-ES+A128KW | ECDH-ES using | "epk", | Recommended | 539 | | Concat KDF and | "apu", | | 540 | | CEK wrapped | "apv" | | 541 | | with "A128KW" | | | 542 | ECDH-ES+A192KW | ECDH-ES using | "epk", | Optional | 543 | | Concat KDF and | "apu", | | 544 | | CEK wrapped | "apv" | | 545 | | with "A192KW" | | | 546 | ECDH-ES+A256KW | ECDH-ES using | "epk", | Recommended | 547 | | Concat KDF and | "apu", | | 548 | | CEK wrapped | "apv" | | 549 | | with "A256KW" | | | 550 | A128GCMKW | Key wrapping | "iv", | Optional | 551 | | with AES GCM | "tag" | | 552 | | using 128 bit | | | 553 | | key | | | 554 | A192GCMKW | Key wrapping | "iv", | Optional | 555 | | with AES GCM | "tag" | | 556 | | using 192 bit | | | 557 | | key | | | 558 | A256GCMKW | Key wrapping | "iv", | Optional | 559 | | with AES GCM | "tag" | | 560 | | using 256 bit | | | 561 | | key | | | 562 | PBES2-HS256+A128K | PBES2 with HMAC | "p2s", | Optional | 563 | W | SHA-256 and | "p2c" | | 564 | | "A128KW" | | | 565 | | wrapping | | | 566 | PBES2-HS384+A192K | PBES2 with HMAC | "p2s", | Optional | 567 | W | SHA-384 and | "p2c" | | 568 | | "A192KW" | | | 569 | | wrapping | | | 570 | PBES2-HS512+A256K | PBES2 with HMAC | "p2s", | Optional | 571 | W | SHA-512 and | "p2c" | | 572 | | "A256KW" | | | 573 | | wrapping | | | 574 +-------------------+-----------------+------------+----------------+ 576 The Additional Header Parameters column indicates what additional 577 Header Parameters are used by the algorithm, beyond "alg", which all 578 use. All but "dir" and "ECDH-ES" also produce a JWE Encrypted Key 579 value. 581 The use of "+" in the Implementation Requirements indicates that the 582 requirement strength is likely to be increased in a future version of 583 the specification. 585 See Appendix A.2 for a table cross-referencing the JWE "alg" 586 (algorithm) values defined in this specification with the equivalent 587 identifiers used by other standards and software packages. 589 4.2. Key Encryption with RSAES-PKCS1-V1_5 591 This section defines the specifics of encrypting a JWE CEK with 592 RSAES-PKCS1-V1_5 [RFC3447]. The "alg" Header Parameter value 593 "RSA1_5" is used for this algorithm. 595 A key of size 2048 bits or larger MUST be used with this algorithm. 597 An example using this algorithm is shown in Appendix A.2 of [JWE]. 599 4.3. Key Encryption with RSAES OAEP 601 This section defines the specifics of encrypting a JWE CEK with RSAES 602 using Optimal Asymmetric Encryption Padding (OAEP) [RFC3447], with 603 the default parameters specified by RFC 3447 in Section A.2.1. 604 (Those default parameters are using a hash function of SHA-1 and a 605 mask generation function of MGF1 with SHA-1.) The "alg" Header 606 Parameter value "RSA-OAEP" is used for this algorithm. 608 A key of size 2048 bits or larger MUST be used with this algorithm. 610 An example using this algorithm is shown in Appendix A.1 of [JWE]. 612 4.4. Key Wrapping with AES Key Wrap 614 This section defines the specifics of encrypting a JWE CEK with the 615 Advanced Encryption Standard (AES) Key Wrap Algorithm [RFC3394] using 616 the default initial value specified in Section 2.2.3.1. 618 The following "alg" (algorithm) Header Parameter values are used to 619 indicate that the JWE Encrypted Key is the result of encrypting the 620 CEK using the corresponding algorithm and key size: 622 +------------------+------------------------------------------------+ 623 | alg Parameter | Key Management Algorithm | 624 | Value | | 625 +------------------+------------------------------------------------+ 626 | A128KW | AES Key Wrap with default initial value using | 627 | | 128 bit key | 628 | A192KW | AES Key Wrap with default initial value using | 629 | | 192 bit key | 630 | A256KW | AES Key Wrap with default initial value using | 631 | | 256 bit key | 632 +------------------+------------------------------------------------+ 633 An example using this algorithm is shown in Appendix A.3 of [JWE]. 635 4.5. Direct Encryption with a Shared Symmetric Key 637 This section defines the specifics of directly performing symmetric 638 key encryption without performing a key wrapping step. In this case, 639 the shared symmetric key is used directly as the Content Encryption 640 Key (CEK) value for the "enc" algorithm. An empty octet sequence is 641 used as the JWE Encrypted Key value. The "alg" Header Parameter 642 value "dir" is used in this case. 644 Refer to the security considerations on key lifetimes in Section 8.2 645 and AES GCM in Section 8.4 when considering utilizing direct 646 encryption. 648 4.6. Key Agreement with Elliptic Curve Diffie-Hellman Ephemeral Static 649 (ECDH-ES) 651 This section defines the specifics of key agreement with Elliptic 652 Curve Diffie-Hellman Ephemeral Static [RFC6090], in combination with 653 the Concat KDF, as defined in Section 5.8.1 of [NIST.800-56A]. The 654 key agreement result can be used in one of two ways: 656 1. directly as the Content Encryption Key (CEK) for the "enc" 657 algorithm, in the Direct Key Agreement mode, or 659 2. as a symmetric key used to wrap the CEK with the "A128KW", 660 "A192KW", or "A256KW" algorithms, in the Key Agreement with Key 661 Wrapping mode. 663 A new ephemeral public key value MUST be generated for each key 664 agreement operation. 666 In Direct Key Agreement mode, the output of the Concat KDF MUST be a 667 key of the same length as that used by the "enc" algorithm. In this 668 case, the empty octet sequence is used as the JWE Encrypted Key 669 value. The "alg" Header Parameter value "ECDH-ES" is used in the 670 Direct Key Agreement mode. 672 In Key Agreement with Key Wrapping mode, the output of the Concat KDF 673 MUST be a key of the length needed for the specified key wrapping 674 algorithm. In this case, the JWE Encrypted Key is the CEK wrapped 675 with the agreed upon key. 677 The following "alg" (algorithm) Header Parameter values are used to 678 indicate that the JWE Encrypted Key is the result of encrypting the 679 CEK using the result of the key agreement algorithm as the key 680 encryption key for the corresponding key wrapping algorithm: 682 +-------------------+-----------------------------------------------+ 683 | alg Parameter | Key Management Algorithm | 684 | Value | | 685 +-------------------+-----------------------------------------------+ 686 | ECDH-ES+A128KW | ECDH-ES using Concat KDF and CEK wrapped with | 687 | | "A128KW" | 688 | ECDH-ES+A192KW | ECDH-ES using Concat KDF and CEK wrapped with | 689 | | "A192KW" | 690 | ECDH-ES+A256KW | ECDH-ES using Concat KDF and CEK wrapped with | 691 | | "A256KW" | 692 +-------------------+-----------------------------------------------+ 694 4.6.1. Header Parameters Used for ECDH Key Agreement 696 The following Header Parameter names are used for key agreement as 697 defined below. 699 4.6.1.1. "epk" (Ephemeral Public Key) Header Parameter 701 The "epk" (ephemeral public key) value created by the originator for 702 the use in key agreement algorithms. This key is represented as a 703 JSON Web Key [JWK] public key value. It MUST contain only public key 704 parameters and SHOULD contain only the minimum JWK parameters 705 necessary to represent the key; other JWK parameters included can be 706 checked for consistency and honored or can be ignored. This Header 707 Parameter MUST be present and MUST be understood and processed by 708 implementations when these algorithms are used. 710 4.6.1.2. "apu" (Agreement PartyUInfo) Header Parameter 712 The "apu" (agreement PartyUInfo) value for key agreement algorithms 713 using it (such as "ECDH-ES"), represented as a base64url encoded 714 string. When used, the PartyUInfo value contains information about 715 the sender. Use of this Header Parameter is OPTIONAL. This Header 716 Parameter MUST be understood and processed by implementations when 717 these algorithms are used. 719 4.6.1.3. "apv" (Agreement PartyVInfo) Header Parameter 721 The "apv" (agreement PartyVInfo) value for key agreement algorithms 722 using it (such as "ECDH-ES"), represented as a base64url encoded 723 string. When used, the PartyVInfo value contains information about 724 the receiver. Use of this Header Parameter is OPTIONAL. This Header 725 Parameter MUST be understood and processed by implementations when 726 these algorithms are used. 728 4.6.2. Key Derivation for ECDH Key Agreement 730 The key derivation process derives the agreed upon key from the 731 shared secret Z established through the ECDH algorithm, per Section 732 6.2.2.2 of [NIST.800-56A]. 734 Key derivation is performed using the Concat KDF, as defined in 735 Section 5.8.1 of [NIST.800-56A], where the Digest Method is SHA-256. 736 The Concat KDF parameters are set as follows: 738 Z 739 This is set to the representation of the shared secret Z as an 740 octet sequence. 742 keydatalen 743 This is set to the number of bits in the desired output key. For 744 "ECDH-ES", this is length of the key used by the "enc" algorithm. 745 For "ECDH-ES+A128KW", "ECDH-ES+A192KW", and "ECDH-ES+A256KW", this 746 is 128, 192, and 256, respectively. 748 AlgorithmID 749 The AlgorithmID value is of the form Datalen || Data, where Data 750 is a variable-length string of zero or more octets, and Datalen is 751 a fixed-length, big endian 32 bit counter that indicates the 752 length (in octets) of Data. In the Direct Key Agreement case, 753 Data is set to the octets of the UTF-8 representation of the "enc" 754 Header Parameter value. In the Key Agreement with Key Wrapping 755 case, Data is set to the octets of the UTF-8 representation of the 756 "alg" Header Parameter value. 758 PartyUInfo 759 The PartyUInfo value is of the form Datalen || Data, where Data is 760 a variable-length string of zero or more octets, and Datalen is a 761 fixed-length, big endian 32 bit counter that indicates the length 762 (in octets) of Data. If an "apu" (agreement PartyUInfo) Header 763 Parameter is present, Data is set to the result of base64url 764 decoding the "apu" value and Datalen is set to the number of 765 octets in Data. Otherwise, Datalen is set to 0 and Data is set to 766 the empty octet sequence. 768 PartyVInfo 769 The PartyVInfo value is of the form Datalen || Data, where Data is 770 a variable-length string of zero or more octets, and Datalen is a 771 fixed-length, big endian 32 bit counter that indicates the length 772 (in octets) of Data. If an "apv" (agreement PartyVInfo) Header 773 Parameter is present, Data is set to the result of base64url 774 decoding the "apv" value and Datalen is set to the number of 775 octets in Data. Otherwise, Datalen is set to 0 and Data is set to 776 the empty octet sequence. 778 SuppPubInfo 779 This is set to the keydatalen represented as a 32 bit big endian 780 integer. 782 SuppPrivInfo 783 This is set to the empty octet sequence. 785 Applications need to specify how the "apu" and "apv" parameters are 786 used for that application. The "apu" and "apv" values MUST be 787 distinct, when used. Applications wishing to conform to 788 [NIST.800-56A] need to provide values that meet the requirements of 789 that document, e.g., by using values that identify the sender and 790 recipient. Alternatively, applications MAY conduct key derivation in 791 a manner similar to The Diffie-Hellman Key Agreement Method 792 [RFC2631]: In that case, the "apu" field MAY either be omitted or 793 represent a random 512-bit value (analogous to PartyAInfo in 794 Ephemeral-Static mode in [RFC2631]) and the "apv" field SHOULD NOT be 795 present. 797 See Appendix C for an example key agreement computation using this 798 method. 800 4.7. Key Encryption with AES GCM 802 This section defines the specifics of encrypting a JWE Content 803 Encryption Key (CEK) with Advanced Encryption Standard (AES) in 804 Galois/Counter Mode (GCM) [AES] [NIST.800-38D]. 806 Use of an Initialization Vector of size 96 bits is REQUIRED with this 807 algorithm. The Initialization Vector is represented in base64url 808 encoded form as the "iv" (initialization vector) Header Parameter 809 value. 811 The Additional Authenticated Data value used is the empty octet 812 string. 814 The requested size of the Authentication Tag output MUST be 128 bits, 815 regardless of the key size. 817 The JWE Encrypted Key value is the Ciphertext output. 819 The Authentication Tag output is represented in base64url encoded 820 form as the "tag" (authentication tag) Header Parameter value. 822 The following "alg" (algorithm) Header Parameter values are used to 823 indicate that the JWE Encrypted Key is the result of encrypting the 824 CEK using the corresponding algorithm and key size: 826 +---------------------+---------------------------------------------+ 827 | alg Parameter Value | Key Management Algorithm | 828 +---------------------+---------------------------------------------+ 829 | A128GCMKW | Key wrapping with AES GCM using 128 bit key | 830 | A192GCMKW | Key wrapping with AES GCM using 192 bit key | 831 | A256GCMKW | Key wrapping with AES GCM using 256 bit key | 832 +---------------------+---------------------------------------------+ 834 4.7.1. Header Parameters Used for AES GCM Key Encryption 836 The following Header Parameters are used for AES GCM key encryption. 838 4.7.1.1. "iv" (Initialization Vector) Header Parameter 840 The "iv" (initialization vector) Header Parameter value is the 841 base64url encoded representation of the Initialization Vector value 842 used for the key encryption operation. This Header Parameter MUST be 843 present and MUST be understood and processed by implementations when 844 these algorithms are used. 846 4.7.1.2. "tag" (Authentication Tag) Header Parameter 848 The "tag" (authentication tag) Header Parameter value is the 849 base64url encoded representation of the Authentication Tag value 850 resulting from the key encryption operation. This Header Parameter 851 MUST be present and MUST be understood and processed by 852 implementations when these algorithms are used. 854 4.8. Key Encryption with PBES2 856 This section defines the specifies of performing password-based 857 encryption of a JWE CEK, by first deriving a key encryption key from 858 a user-supplied password using PBES2 schemes as specified in Section 859 6.2 of [RFC2898], then by encrypting the JWE CEK using the derived 860 key. 862 These algorithms use HMAC SHA-2 algorithms as the Pseudo-Random 863 Function (PRF) for the PBKDF2 key derivation and AES Key Wrap 864 [RFC3394] for the encryption scheme. The PBES2 password input is an 865 octet sequence; if the password to be used is represented as a text 866 string rather than an octet sequence, the UTF-8 encoding of the text 867 string MUST be used as the octet sequence. The salt parameter MUST 868 be computed from the "p2s" (PBES2 salt input) Header Parameter value 869 and the "alg" (algorithm) Header Parameter value as specified in the 870 "p2s" definition below. The iteration count parameter MUST be 871 provided as the "p2c" Header Parameter value. The algorithms 872 respectively use HMAC SHA-256, HMAC SHA-384, and HMAC SHA-512 as the 873 PRF and use 128, 192, and 256 bit AES Key Wrap keys. Their derived- 874 key lengths respectively are 16, 24, and 32 octets. 876 The following "alg" (algorithm) Header Parameter values are used to 877 indicate that the JWE Encrypted Key is the result of encrypting the 878 CEK using the result of the corresponding password-based encryption 879 algorithm as the key encryption key for the corresponding key 880 wrapping algorithm: 882 +---------------------+---------------------------------------------+ 883 | alg Parameter Value | Key Management Algorithm | 884 +---------------------+---------------------------------------------+ 885 | PBES2-HS256+A128KW | PBES2 with HMAC SHA-256 and "A128KW" | 886 | | wrapping | 887 | PBES2-HS384+A192KW | PBES2 with HMAC SHA-384 and "A192KW" | 888 | | wrapping | 889 | PBES2-HS512+A256KW | PBES2 with HMAC SHA-512 and "A256KW" | 890 | | wrapping | 891 +---------------------+---------------------------------------------+ 893 See Appendix C of JSON Web Key (JWK) [JWK] for an example key 894 encryption computation using "PBES2-HS256+A128KW". 896 4.8.1. Header Parameters Used for PBES2 Key Encryption 898 The following Header Parameters are used for Key Encryption with 899 PBES2. 901 4.8.1.1. "p2s" (PBES2 salt input) Parameter 903 The "p2s" (PBES2 salt input) Header Parameter encodes a Salt Input 904 value, which is used as part of the PBKDF2 salt value. The "p2s" 905 value is BASE64URL(Salt Input). This Header Parameter MUST be 906 present and MUST be understood and processed by implementations when 907 these algorithms are used. 909 The salt expands the possible keys that can be derived from a given 910 password. A Salt Input value containing 8 or more octets MUST be 911 used. A new Salt Input value MUST be generated randomly for every 912 encryption operation; see [RFC4086] for considerations on generating 913 random values. The salt value used is (UTF8(Alg) || 0x00 || Salt 914 Input), where Alg is the "alg" Header Parameter value. 916 4.8.1.2. "p2c" (PBES2 count) Parameter 918 The "p2c" (PBES2 count) Header Parameter contains the PBKDF2 919 iteration count, represented as a positive integer. This Header 920 Parameter MUST be present and MUST be understood and processed by 921 implementations when these algorithms are used. 923 The iteration count adds computational expense, ideally compounded by 924 the possible range of keys introduced by the salt. A minimum 925 iteration count of 1000 is RECOMMENDED. 927 5. Cryptographic Algorithms for Content Encryption 929 JWE uses cryptographic algorithms to encrypt the Plaintext. 931 5.1. "enc" (Encryption Algorithm) Header Parameter Values for JWE 933 The table below is the set of "enc" (encryption algorithm) Header 934 Parameter values that are defined by this specification for use with 935 JWE. These algorithms are used to encrypt the Plaintext, which 936 produces the Ciphertext. 938 +-------------+------------------------+------------+---------------+ 939 | enc | Content Encryption | Additional | Implementatio | 940 | Parameter | Algorithm | Header | nRequirements | 941 | Value | | Parameters | | 942 +-------------+------------------------+------------+---------------+ 943 | A128CBC-HS2 | AES_128_CBC_HMAC_SHA_2 | (none) | Required | 944 | 56 | 56 authenticated | | | 945 | | encryption algorithm, | | | 946 | | as defined in | | | 947 | | Section 5.2.3 | | | 948 | A192CBC-HS3 | AES_192_CBC_HMAC_SHA_3 | (none) | Optional | 949 | 84 | 84 authenticated | | | 950 | | encryption algorithm, | | | 951 | | as defined in | | | 952 | | Section 5.2.4 | | | 953 | A256CBC-HS5 | AES_256_CBC_HMAC_SHA_5 | (none) | Required | 954 | 12 | 12 authenticated | | | 955 | | encryption algorithm, | | | 956 | | as defined in | | | 957 | | Section 5.2.5 | | | 958 | A128GCM | AES GCM using 128 bit | (none) | Recommended | 959 | | key | | | 960 | A192GCM | AES GCM using 192 bit | (none) | Optional | 961 | | key | | | 962 | A256GCM | AES GCM using 256 bit | (none) | Recommended | 963 | | key | | | 964 +-------------+------------------------+------------+---------------+ 966 The Additional Header Parameters column indicates what additional 967 Header Parameters are used by the algorithm, beyond "enc", which all 968 use. All also use a JWE Initialization Vector value and produce JWE 969 Ciphertext and JWE Authentication Tag values. 971 See Appendix A.3 for a table cross-referencing the JWE "enc" 972 (encryption algorithm) values defined in this specification with the 973 equivalent identifiers used by other standards and software packages. 975 5.2. AES_CBC_HMAC_SHA2 Algorithms 977 This section defines a family of authenticated encryption algorithms 978 built using a composition of Advanced Encryption Standard (AES) in 979 Cipher Block Chaining (CBC) mode with PKCS #5 padding [AES] 980 [NIST.800-38A] operations and HMAC [RFC2104] [SHS] operations. This 981 algorithm family is called AES_CBC_HMAC_SHA2. It also defines three 982 instances of this family, the first using 128 bit CBC keys and HMAC 983 SHA-256, the second using 192 bit CBC keys and HMAC SHA-384, and the 984 third using 256 bit CBC keys and HMAC SHA-512. Test cases for these 985 algorithms can be found in Appendix B. 987 These algorithms are based upon Authenticated Encryption with AES-CBC 988 and HMAC-SHA [I-D.mcgrew-aead-aes-cbc-hmac-sha2], performing the same 989 cryptographic computations, but with the Initialization Vector and 990 Authentication Tag values remaining separate, rather than being 991 concatenated with the Ciphertext value in the output representation. 992 This option is discussed in Appendix B of that specification. This 993 algorithm family is a generalization of the algorithm family in 994 [I-D.mcgrew-aead-aes-cbc-hmac-sha2], and can be used to implement 995 those algorithms. 997 5.2.1. Conventions Used in Defining AES_CBC_HMAC_SHA2 999 We use the following notational conventions. 1001 CBC-PKCS5-ENC(X, P) denotes the AES CBC encryption of P using PKCS 1002 #5 padding using the cipher with the key X. 1004 MAC(Y, M) denotes the application of the Message Authentication 1005 Code (MAC) to the message M, using the key Y. 1007 5.2.2. Generic AES_CBC_HMAC_SHA2 Algorithm 1009 This section defines AES_CBC_HMAC_SHA2 in a manner that is 1010 independent of the AES CBC key size or hash function to be used. 1011 Section 5.2.2.1 and Section 5.2.2.2 define the generic encryption and 1012 decryption algorithms. Section 5.2.3 and Section 5.2.5 define 1013 instances of AES_CBC_HMAC_SHA2 that specify those details. 1015 5.2.2.1. AES_CBC_HMAC_SHA2 Encryption 1017 The authenticated encryption algorithm takes as input four octet 1018 strings: a secret key K, a plaintext P, associated data A, and an 1019 initialization vector IV. The authenticated ciphertext value E and 1020 the authentication tag value T are provided as outputs. The data in 1021 the plaintext are encrypted and authenticated, and the associated 1022 data are authenticated, but not encrypted. 1024 The encryption process is as follows, or uses an equivalent set of 1025 steps: 1027 1. The secondary keys MAC_KEY and ENC_KEY are generated from the 1028 input key K as follows. Each of these two keys is an octet 1029 string. 1031 MAC_KEY consists of the initial MAC_KEY_LEN octets of K, in 1032 order. 1034 ENC_KEY consists of the final ENC_KEY_LEN octets of K, in 1035 order. 1037 Here we denote the number of octets in the MAC_KEY as 1038 MAC_KEY_LEN, and the number of octets in ENC_KEY as ENC_KEY_LEN; 1039 the values of these parameters are specified by the AEAD 1040 algorithms (in Section 5.2.3 and Section 5.2.5). The number of 1041 octets in the input key K is the sum of MAC_KEY_LEN and 1042 ENC_KEY_LEN. When generating the secondary keys from K, MAC_KEY 1043 and ENC_KEY MUST NOT overlap. Note that the MAC key comes before 1044 the encryption key in the input key K; this is in the opposite 1045 order of the algorithm names in the identifier 1046 "AES_CBC_HMAC_SHA2". 1048 2. The Initialization Vector (IV) used is a 128 bit value generated 1049 randomly or pseudorandomly for use in the cipher. 1051 3. The plaintext is CBC encrypted using PKCS #5 padding using 1052 ENC_KEY as the key, and the IV. We denote the ciphertext output 1053 from this step as E. 1055 4. The octet string AL is equal to the number of bits in A expressed 1056 as a 64-bit unsigned integer in network byte order. 1058 5. A message authentication tag T is computed by applying HMAC 1059 [RFC2104] to the following data, in order: 1061 the associated data A, 1062 the initialization vector IV, 1064 the ciphertext E computed in the previous step, and 1066 the octet string AL defined above. 1068 The string MAC_KEY is used as the MAC key. We denote the output 1069 of the MAC computed in this step as M. The first T_LEN bits of M 1070 are used as T. 1072 6. The Ciphertext E and the Authentication Tag T are returned as the 1073 outputs of the authenticated encryption. 1075 The encryption process can be illustrated as follows. Here K, P, A, 1076 IV, and E denote the key, plaintext, associated data, initialization 1077 vector, and ciphertext, respectively. 1079 MAC_KEY = initial MAC_KEY_LEN bytes of K, 1081 ENC_KEY = final ENC_KEY_LEN bytes of K, 1083 E = CBC-PKCS5-ENC(ENC_KEY, P), 1085 M = MAC(MAC_KEY, A || IV || E || AL), 1087 T = initial T_LEN bytes of M. 1089 5.2.2.2. AES_CBC_HMAC_SHA2 Decryption 1091 The authenticated decryption operation has four inputs: K, A, E, and 1092 T as defined above. It has only a single output, either a plaintext 1093 value P or a special symbol FAIL that indicates that the inputs are 1094 not authentic. The authenticated decryption algorithm is as follows, 1095 or uses an equivalent set of steps: 1097 1. The secondary keys MAC_KEY and ENC_KEY are generated from the 1098 input key K as in Step 1 of Section 5.2.2.1. 1100 2. The integrity and authenticity of A and E are checked by 1101 computing an HMAC with the inputs as in Step 5 of 1102 Section 5.2.2.1. The value T, from the previous step, is 1103 compared to the first MAC_KEY length bits of the HMAC output. If 1104 those values are identical, then A and E are considered valid, 1105 and processing is continued. Otherwise, all of the data used in 1106 the MAC validation are discarded, and the AEAD decryption 1107 operation returns an indication that it failed, and the operation 1108 halts. (But see Section 10 of [JWE] for security considerations 1109 on thwarting timing attacks.) 1111 3. The value E is decrypted and the PKCS #5 padding is removed. The 1112 value IV is used as the initialization vector. The value ENC_KEY 1113 is used as the decryption key. 1115 4. The plaintext value is returned. 1117 5.2.3. AES_128_CBC_HMAC_SHA_256 1119 This algorithm is a concrete instantiation of the generic 1120 AES_CBC_HMAC_SHA2 algorithm above. It uses the HMAC message 1121 authentication code [RFC2104] with the SHA-256 hash function [SHS] to 1122 provide message authentication, with the HMAC output truncated to 128 1123 bits, corresponding to the HMAC-SHA-256-128 algorithm defined in 1124 [RFC4868]. For encryption, it uses AES in the Cipher Block Chaining 1125 (CBC) mode of operation as defined in Section 6.2 of [NIST.800-38A], 1126 with PKCS #5 padding and a 128 bit initialization vector (IV) value. 1128 The AES_CBC_HMAC_SHA2 parameters specific to AES_128_CBC_HMAC_SHA_256 1129 are: 1131 The input key K is 32 octets long. 1133 ENC_KEY_LEN is 16 octets. 1135 MAC_KEY_LEN is 16 octets. 1137 The SHA-256 hash algorithm is used for the HMAC. 1139 The HMAC-SHA-256 output is truncated to T_LEN=16 octets, by 1140 stripping off the final 16 octets. 1142 5.2.4. AES_192_CBC_HMAC_SHA_384 1144 AES_192_CBC_HMAC_SHA_384 is based on AES_128_CBC_HMAC_SHA_256, but 1145 with the following differences: 1147 The input key K is 48 octets long instead of 32. 1149 ENC_KEY_LEN is 24 octets instead of 16. 1151 MAC_KEY_LEN is 24 octets instead of 16. 1153 SHA-384 is used for the HMAC instead of SHA-256. 1155 The HMAC SHA-384 value is truncated to T_LEN=24 octets instead of 1156 16. 1158 5.2.5. AES_256_CBC_HMAC_SHA_512 1160 AES_256_CBC_HMAC_SHA_512 is based on AES_128_CBC_HMAC_SHA_256, but 1161 with the following differences: 1163 The input key K is 64 octets long instead of 32. 1165 ENC_KEY_LEN is 32 octets instead of 16. 1167 MAC_KEY_LEN is 32 octets instead of 16. 1169 SHA-512 is used for the HMAC instead of SHA-256. 1171 The HMAC SHA-512 value is truncated to T_LEN=32 octets instead of 1172 16. 1174 5.2.6. Content Encryption with AES_CBC_HMAC_SHA2 1176 The following "enc" (encryption algorithm) Header Parameter values 1177 are used to indicate that the JWE Ciphertext and JWE Authentication 1178 Tag values have been computed using the corresponding algorithm: 1180 +---------------+---------------------------------------------------+ 1181 | enc Parameter | Content Encryption Algorithm | 1182 | Value | | 1183 +---------------+---------------------------------------------------+ 1184 | A128CBC-HS256 | AES_128_CBC_HMAC_SHA_256 authenticated encryption | 1185 | | algorithm, as defined in Section 5.2.3 | 1186 | A192CBC-HS384 | AES_192_CBC_HMAC_SHA_384 authenticated encryption | 1187 | | algorithm, as defined in Section 5.2.4 | 1188 | A256CBC-HS512 | AES_256_CBC_HMAC_SHA_512 authenticated encryption | 1189 | | algorithm, as defined in Section 5.2.5 | 1190 +---------------+---------------------------------------------------+ 1192 5.3. Content Encryption with AES GCM 1194 This section defines the specifics of encrypting the JWE Plaintext 1195 with Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM) 1196 [AES] [NIST.800-38D]. The "enc" Header Parameter values "A128GCM", 1197 "A192GCM", or "A256GCM" are respectively used in this case. 1199 The CEK is used as the encryption key. 1201 Use of an initialization vector of size 96 bits is REQUIRED with this 1202 algorithm. 1204 The requested size of the Authentication Tag output MUST be 128 bits, 1205 regardless of the key size. 1207 The JWE Authentication Tag is set to be the Authentication Tag value 1208 produced by the encryption. During decryption, the received JWE 1209 Authentication Tag is used as the Authentication Tag value. 1211 The following "enc" (encryption algorithm) Header Parameter values 1212 are used to indicate that the JWE Ciphertext and JWE Authentication 1213 Tag values have been computed using the corresponding algorithm and 1214 key size: 1216 +---------------------+------------------------------+ 1217 | enc Parameter Value | Content Encryption Algorithm | 1218 +---------------------+------------------------------+ 1219 | A128GCM | AES GCM using 128 bit key | 1220 | A192GCM | AES GCM using 192 bit key | 1221 | A256GCM | AES GCM using 256 bit key | 1222 +---------------------+------------------------------+ 1224 An example using this algorithm is shown in Appendix A.1 of [JWE]. 1226 6. Cryptographic Algorithms for Keys 1228 A JSON Web Key (JWK) [JWK] is a JSON data structure that represents a 1229 cryptographic key. These keys can be either asymmetric or symmetric. 1230 They can hold both public and private information about the key. 1231 This section defines the parameters for keys using the algorithms 1232 specified by this document. 1234 6.1. "kty" (Key Type) Parameter Values 1236 The table below is the set of "kty" (key type) parameter values that 1237 are defined by this specification for use in JWKs. 1239 +--------------+--------------------------------+-------------------+ 1240 | kty | Key Type | Implementation | 1241 | Parameter | | Requirements | 1242 | Value | | | 1243 +--------------+--------------------------------+-------------------+ 1244 | EC | Elliptic Curve [DSS] | Recommended+ | 1245 | RSA | RSA [RFC3447] | Required | 1246 | oct | Octet sequence (used to | Required | 1247 | | represent symmetric keys) | | 1248 +--------------+--------------------------------+-------------------+ 1250 The use of "+" in the Implementation Requirements indicates that the 1251 requirement strength is likely to be increased in a future version of 1252 the specification. 1254 6.2. Parameters for Elliptic Curve Keys 1256 JWKs can represent Elliptic Curve [DSS] keys. In this case, the 1257 "kty" member value MUST be "EC". 1259 6.2.1. Parameters for Elliptic Curve Public Keys 1261 An elliptic curve public key is represented by a pair of coordinates 1262 drawn from a finite field, which together define a point on an 1263 elliptic curve. The following members MUST be present for elliptic 1264 curve public keys: 1266 o "crv" 1268 o "x" 1270 o "y" 1272 SEC1 [SEC1] point compression is not supported for any values. 1274 6.2.1.1. "crv" (Curve) Parameter 1276 The "crv" (curve) member identifies the cryptographic curve used with 1277 the key. Curve values from [DSS] used by this specification are: 1279 o "P-256" 1281 o "P-384" 1283 o "P-521" 1285 These values are registered in the IANA JSON Web Key Elliptic Curve 1286 registry defined in Section 7.6. Additional "crv" values MAY be 1287 used, provided they are understood by implementations using that 1288 Elliptic Curve key. The "crv" value is a case-sensitive string. 1290 6.2.1.2. "x" (X Coordinate) Parameter 1292 The "x" (x coordinate) member contains the x coordinate for the 1293 elliptic curve point. It is represented as the base64url encoding of 1294 the octet string representation of the coordinate, as defined in 1295 Section 2.3.5 of SEC1 [SEC1]. The length of this octet string MUST 1296 be the full size of a coordinate for the curve specified in the "crv" 1297 parameter. For example, if the value of "crv" is "P-521", the octet 1298 string must be 66 octets long. 1300 6.2.1.3. "y" (Y Coordinate) Parameter 1302 The "y" (y coordinate) member contains the y coordinate for the 1303 elliptic curve point. It is represented as the base64url encoding of 1304 the octet string representation of the coordinate, as defined in 1305 Section 2.3.5 of SEC1 [SEC1]. The length of this octet string MUST 1306 be the full size of a coordinate for the curve specified in the "crv" 1307 parameter. For example, if the value of "crv" is "P-521", the octet 1308 string must be 66 octets long. 1310 6.2.2. Parameters for Elliptic Curve Private Keys 1312 In addition to the members used to represent Elliptic Curve public 1313 keys, the following member MUST be present to represent Elliptic 1314 Curve private keys. 1316 6.2.2.1. "d" (ECC Private Key) Parameter 1318 The "d" (ECC private key) member contains the Elliptic Curve private 1319 key value. It is represented as the base64url encoding of the octet 1320 string representation of the private key value, as defined in 1321 Sections C.4 and 2.3.7 of SEC1 [SEC1]. The length of this octet 1322 string MUST be ceiling(log-base-2(n)/8) octets (where n is the order 1323 of the curve). 1325 6.3. Parameters for RSA Keys 1327 JWKs can represent RSA [RFC3447] keys. In this case, the "kty" 1328 member value MUST be "RSA". 1330 6.3.1. Parameters for RSA Public Keys 1332 The following members MUST be present for RSA public keys. 1334 6.3.1.1. "n" (Modulus) Parameter 1336 The "n" (modulus) member contains the modulus value for the RSA 1337 public key. It is represented as the base64url encoding of the 1338 value's unsigned big endian representation as an octet sequence. The 1339 octet sequence MUST utilize the minimum number of octets to represent 1340 the value. 1342 6.3.1.2. "e" (Exponent) Parameter 1344 The "e" (exponent) member contains the exponent value for the RSA 1345 public key. It is represented as the base64url encoding of the 1346 value's unsigned big endian representation as an octet sequence. The 1347 octet sequence MUST utilize the minimum number of octets to represent 1348 the value. For instance, when representing the value 65537, the 1349 octet sequence to be base64url encoded MUST consist of the three 1350 octets [1, 0, 1]. 1352 6.3.2. Parameters for RSA Private Keys 1354 In addition to the members used to represent RSA public keys, the 1355 following members are used to represent RSA private keys. The 1356 parameter "d" is REQUIRED for RSA private keys. The others enable 1357 optimizations and SHOULD be included by producers of JWKs 1358 representing RSA private keys. If the producer includes any of the 1359 other private key parameters, then all of the others MUST be present, 1360 with the exception of "oth", which MUST only be present when more 1361 than two prime factors were used. The consumer of a JWK MAY choose 1362 to accept an RSA private key that does not contain a complete set of 1363 the private key parameters other than "d", including JWKs in which 1364 "d" is the only RSA private key parameter included. 1366 6.3.2.1. "d" (Private Exponent) Parameter 1368 The "d" (private exponent) member contains the private exponent value 1369 for the RSA private key. It is represented as the base64url encoding 1370 of the value's unsigned big endian representation as an octet 1371 sequence. The octet sequence MUST utilize the minimum number of 1372 octets to represent the value. 1374 6.3.2.2. "p" (First Prime Factor) Parameter 1376 The "p" (first prime factor) member contains the first prime factor, 1377 a positive integer. It is represented as the base64url encoding of 1378 the value's unsigned big endian representation as an octet sequence. 1379 The octet sequence MUST utilize the minimum number of octets to 1380 represent the value. 1382 6.3.2.3. "q" (Second Prime Factor) Parameter 1384 The "q" (second prime factor) member contains the second prime 1385 factor, a positive integer. It is represented as the base64url 1386 encoding of the value's unsigned big endian representation as an 1387 octet sequence. The octet sequence MUST utilize the minimum number 1388 of octets to represent the value. 1390 6.3.2.4. "dp" (First Factor CRT Exponent) Parameter 1392 The "dp" (first factor CRT exponent) member contains the Chinese 1393 Remainder Theorem (CRT) exponent of the first factor, a positive 1394 integer. It is represented as the base64url encoding of the value's 1395 unsigned big endian representation as an octet sequence. The octet 1396 sequence MUST utilize the minimum number of octets to represent the 1397 value. 1399 6.3.2.5. "dq" (Second Factor CRT Exponent) Parameter 1401 The "dq" (second factor CRT exponent) member contains the Chinese 1402 Remainder Theorem (CRT) exponent of the second factor, a positive 1403 integer. It is represented as the base64url encoding of the value's 1404 unsigned big endian representation as an octet sequence. The octet 1405 sequence MUST utilize the minimum number of octets to represent the 1406 value. 1408 6.3.2.6. "qi" (First CRT Coefficient) Parameter 1410 The "dp" (first CRT coefficient) member contains the Chinese 1411 Remainder Theorem (CRT) coefficient of the second factor, a positive 1412 integer. It is represented as the base64url encoding of the value's 1413 unsigned big endian representation as an octet sequence. The octet 1414 sequence MUST utilize the minimum number of octets to represent the 1415 value. 1417 6.3.2.7. "oth" (Other Primes Info) Parameter 1419 The "oth" (other primes info) member contains an array of information 1420 about any third and subsequent primes, should they exist. When only 1421 two primes have been used (the normal case), this parameter MUST be 1422 omitted. When three or more primes have been used, the number of 1423 array elements MUST be the number of primes used minus two. Each 1424 array element MUST be an object with the following members: 1426 6.3.2.7.1. "r" (Prime Factor) 1428 The "r" (prime factor) parameter within an "oth" array member 1429 represents the value of a subsequent prime factor, a positive 1430 integer. It is represented as the base64url encoding of the value's 1431 unsigned big endian representation as an octet sequence. The octet 1432 sequence MUST utilize the minimum number of octets to represent the 1433 value. 1435 6.3.2.7.2. "d" (Factor CRT Exponent) 1437 The "d" (Factor CRT Exponent) parameter within an "oth" array member 1438 represents the CRT exponent of the corresponding prime factor, a 1439 positive integer. It is represented as the base64url encoding of the 1440 value's unsigned big endian representation as an octet sequence. The 1441 octet sequence MUST utilize the minimum number of octets to represent 1442 the value. 1444 6.3.2.7.3. "t" (Factor CRT Coefficient) 1446 The "t" (factor CRT coefficient) parameter within an "oth" array 1447 member represents the CRT coefficient of the corresponding prime 1448 factor, a positive integer. It is represented as the base64url 1449 encoding of the value's unsigned big endian representation as an 1450 octet sequence. The octet sequence MUST utilize the minimum number 1451 of octets to represent the value. 1453 6.4. Parameters for Symmetric Keys 1455 When the JWK "kty" member value is "oct" (octet sequence), the member 1456 "k" is used to represent a symmetric key (or another key whose value 1457 is a single octet sequence). An "alg" member SHOULD also be present 1458 to identify the algorithm intended to be used with the key, unless 1459 the application uses another means or convention to determine the 1460 algorithm used. 1462 6.4.1. "k" (Key Value) Parameter 1464 The "k" (key value) member contains the value of the symmetric (or 1465 other single-valued) key. It is represented as the base64url 1466 encoding of the octet sequence containing the key value. 1468 7. IANA Considerations 1470 The following registration procedure is used for all the registries 1471 established by this specification. 1473 Values are registered with a Specification Required [RFC5226] after a 1474 two-week review period on the [TBD]@ietf.org mailing list, on the 1475 advice of one or more Designated Experts. However, to allow for the 1476 allocation of values prior to publication, the Designated Expert(s) 1477 may approve registration once they are satisfied that such a 1478 specification will be published. 1480 Registration requests must be sent to the [TBD]@ietf.org mailing list 1481 for review and comment, with an appropriate subject (e.g., "Request 1482 for access token type: example"). [[ Note to the RFC Editor: The name 1483 of the mailing list should be determined in consultation with the 1484 IESG and IANA. Suggested name: jose-reg-review. ]] 1486 Within the review period, the Designated Expert(s) will either 1487 approve or deny the registration request, communicating this decision 1488 to the review list and IANA. Denials should include an explanation 1489 and, if applicable, suggestions as to how to make the request 1490 successful. Registration requests that are undetermined for a period 1491 longer than 21 days can be brought to the IESG's attention (using the 1492 iesg@iesg.org mailing list) for resolution. 1494 Criteria that should be applied by the Designated Expert(s) includes 1495 determining whether the proposed registration duplicates existing 1496 functionality, determining whether it is likely to be of general 1497 applicability or whether it is useful only for a single application, 1498 and whether the registration makes sense. 1500 IANA must only accept registry updates from the Designated Expert(s) 1501 and should direct all requests for registration to the review mailing 1502 list. 1504 It is suggested that multiple Designated Experts be appointed who are 1505 able to represent the perspectives of different applications using 1506 this specification, in order to enable broadly-informed review of 1507 registration decisions. In cases where a registration decision could 1508 be perceived as creating a conflict of interest for a particular 1509 Expert, that Expert should defer to the judgment of the other 1510 Expert(s). 1512 7.1. JSON Web Signature and Encryption Algorithms Registry 1514 This specification establishes the IANA JSON Web Signature and 1515 Encryption Algorithms registry for values of the JWS and JWE "alg" 1516 (algorithm) and "enc" (encryption algorithm) Header Parameters. The 1517 registry records the algorithm name, the algorithm usage locations, 1518 implementation requirements, and a reference to the specification 1519 that defines it. The same algorithm name can be registered multiple 1520 times, provided that the sets of usage locations are disjoint. 1522 It is suggested that when algorithms can use keys of different 1523 lengths, that the length of the key be included in the algorithm 1524 name. This allows readers of the JSON text to easily make security 1525 consideration decisions. 1527 The implementation requirements of an algorithm MAY be changed over 1528 time by the Designated Experts(s) as the cryptographic landscape 1529 evolves, for instance, to change the status of an algorithm to 1530 Deprecated, or to change the status of an algorithm from Optional to 1531 Recommended+ or Required. Changes of implementation requirements are 1532 only permitted on a Specification Required basis, with the new 1533 specification defining the revised implementation requirements level. 1535 7.1.1. Registration Template 1536 Algorithm Name: 1537 The name requested (e.g., "example"). This name is case- 1538 sensitive. Names may not match other registered names in a case- 1539 insensitive manner unless the Designated Expert(s) state that 1540 there is a compelling reason to allow an exception in this 1541 particular case. 1543 Algorithm Description: 1544 Brief description of the Algorithm (e.g., "Example description"). 1546 Algorithm Usage Location(s): 1547 The algorithm usage location. This must be one or more of the 1548 values "alg" or "enc" if the algorithm is to be used with JWS or 1549 JWE. The value "JWK" is used if the algorithm identifier will be 1550 used as a JWK "alg" member value, but will not be used with JWS or 1551 JWE; this could be the case, for instance, for non-authenticated 1552 encryption algorithms. Other values may be used with the approval 1553 of a Designated Expert. 1555 JOSE Implementation Requirements: 1556 The algorithm implementation requirements for JWS and JWE, which 1557 must be one the words Required, Recommended, Optional, Deprecated, 1558 or Prohibited. Optionally, the word can be followed by a "+" or 1559 "-". The use of "+" indicates that the requirement strength is 1560 likely to be increased in a future version of the specification. 1561 The use of "-" indicates that the requirement strength is likely 1562 to be decreased in a future version of the specification. Any 1563 identifiers registered for non-authenticated encryption algorithms 1564 or other algorithms that are otherwise unsuitable for direct use 1565 as JWS or JWE algorithms must be registered as "Prohibited". 1567 Change Controller: 1568 For Standards Track RFCs, state "IESG". For others, give the name 1569 of the responsible party. Other details (e.g., postal address, 1570 email address, home page URI) may also be included. 1572 Specification Document(s): 1573 Reference to the document(s) that specify the parameter, 1574 preferably including URI(s) that can be used to retrieve copies of 1575 the document(s). An indication of the relevant sections may also 1576 be included but is not required. 1578 7.1.2. Initial Registry Contents 1580 o Algorithm Name: "HS256" 1581 o Algorithm Description: HMAC using SHA-256 1582 o Algorithm Usage Location(s): "alg" 1583 o JOSE Implementation Requirements: Required 1584 o Change Controller: IESG 1585 o Specification Document(s): Section 3.1 of [[ this document ]] 1587 o Algorithm Name: "HS384" 1588 o Algorithm Description: HMAC using SHA-384 1589 o Algorithm Usage Location(s): "alg" 1590 o JOSE Implementation Requirements: Optional 1591 o Change Controller: IESG 1592 o Specification Document(s): Section 3.1 of [[ this document ]] 1594 o Algorithm Name: "HS512" 1595 o Algorithm Description: HMAC using SHA-512 1596 o Algorithm Usage Location(s): "alg" 1597 o JOSE Implementation Requirements: Optional 1598 o Change Controller: IESG 1599 o Specification Document(s): Section 3.1 of [[ this document ]] 1601 o Algorithm Name: "RS256" 1602 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-256 1603 o Algorithm Usage Location(s): "alg" 1604 o JOSE Implementation Requirements: Recommended 1605 o Change Controller: IESG 1606 o Specification Document(s): Section 3.1 of [[ this document ]] 1608 o Algorithm Name: "RS384" 1609 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-384 1610 o Algorithm Usage Location(s): "alg" 1611 o JOSE Implementation Requirements: Optional 1612 o Change Controller: IESG 1613 o Specification Document(s): Section 3.1 of [[ this document ]] 1615 o Algorithm Name: "RS512" 1616 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-512 1617 o Algorithm Usage Location(s): "alg" 1618 o JOSE Implementation Requirements: Optional 1619 o Change Controller: IESG 1620 o Specification Document(s): Section 3.1 of [[ this document ]] 1622 o Algorithm Name: "ES256" 1623 o Algorithm Description: ECDSA using P-256 and SHA-256 1624 o Algorithm Usage Location(s): "alg" 1625 o JOSE Implementation Requirements: Recommended+ 1626 o Change Controller: IESG 1627 o Specification Document(s): Section 3.1 of [[ this document ]] 1628 o Algorithm Name: "ES384" 1629 o Algorithm Description: ECDSA using P-384 and SHA-384 1630 o Algorithm Usage Location(s): "alg" 1631 o JOSE Implementation Requirements: Optional 1632 o Change Controller: IESG 1633 o Specification Document(s): Section 3.1 of [[ this document ]] 1635 o Algorithm Name: "ES512" 1636 o Algorithm Description: ECDSA using P-521 and SHA-512 1637 o Algorithm Usage Location(s): "alg" 1638 o JOSE Implementation Requirements: Optional 1639 o Change Controller: IESG 1640 o Specification Document(s): Section 3.1 of [[ this document ]] 1642 o Algorithm Name: "PS256" 1643 o Algorithm Description: RSASSA-PSS using SHA-256 and MGF1 with SHA- 1644 256 1645 o Algorithm Usage Location(s): "alg" 1646 o JOSE Implementation Requirements: Optional 1647 o Change Controller: IESG 1648 o Specification Document(s): Section 3.1 of [[ this document ]] 1650 o Algorithm Name: "PS384" 1651 o Algorithm Description: RSASSA-PSS using SHA-384 and MGF1 with SHA- 1652 384 1653 o Algorithm Usage Location(s): "alg" 1654 o JOSE Implementation Requirements: Optional 1655 o Change Controller: IESG 1656 o Specification Document(s): Section 3.1 of [[ this document ]] 1658 o Algorithm Name: "PS512" 1659 o Algorithm Description: RSASSA-PSS using SHA-512 and MGF1 with SHA- 1660 512 1661 o Algorithm Usage Location(s): "alg" 1662 o JOSE Implementation Requirements: Optional 1663 o Change Controller: IESG 1664 o Specification Document(s): Section 3.1 of [[ this document ]] 1666 o Algorithm Name: "none" 1667 o Algorithm Description: No digital signature or MAC performed 1668 o Algorithm Usage Location(s): "alg" 1669 o JOSE Implementation Requirements: Optional 1670 o Change Controller: IESG 1671 o Specification Document(s): Section 3.1 of [[ this document ]] 1673 o Algorithm Name: "RSA1_5" 1674 o Algorithm Description: RSAES-PKCS1-V1_5 1675 o Algorithm Usage Location(s): "alg" 1676 o JOSE Implementation Requirements: Required 1677 o Change Controller: IESG 1678 o Specification Document(s): Section 4.1 of [[ this document ]] 1680 o Algorithm Name: "RSA-OAEP" 1681 o Algorithm Description: RSAES using OAEP with default parameters 1682 o Algorithm Usage Location(s): "alg" 1683 o JOSE Implementation Requirements: Optional 1684 o Change Controller: IESG 1685 o Specification Document(s): Section 4.1 of [[ this document ]] 1687 o Algorithm Name: "A128KW" 1688 o Algorithm Description: AES Key Wrap using 128 bit key 1689 o Algorithm Usage Location(s): "alg" 1690 o JOSE Implementation Requirements: Recommended 1691 o Change Controller: IESG 1692 o Specification Document(s): Section 4.1 of [[ this document ]] 1694 o Algorithm Name: "A192KW" 1695 o Algorithm Description: AES Key Wrap using 192 bit key 1696 o Algorithm Usage Location(s): "alg" 1697 o JOSE Implementation Requirements: Optional 1698 o Change Controller: IESG 1699 o Specification Document(s): Section 4.1 of [[ this document ]] 1701 o Algorithm Name: "A256KW" 1702 o Algorithm Description: AES Key Wrap using 256 bit key 1703 o Algorithm Usage Location(s): "alg" 1704 o JOSE Implementation Requirements: Recommended 1705 o Change Controller: IESG 1706 o Specification Document(s): Section 4.1 of [[ this document ]] 1708 o Algorithm Name: "dir" 1709 o Algorithm Description: Direct use of a shared symmetric key 1710 o Algorithm Usage Location(s): "alg" 1711 o JOSE Implementation Requirements: Recommended 1712 o Change Controller: IESG 1713 o Specification Document(s): Section 4.1 of [[ this document ]] 1715 o Algorithm Name: "ECDH-ES" 1716 o Algorithm Description: ECDH-ES using Concat KDF 1717 o Algorithm Usage Location(s): "alg" 1718 o JOSE Implementation Requirements: Recommended+ 1719 o Change Controller: IESG 1720 o Specification Document(s): Section 4.1 of [[ this document ]] 1722 o Algorithm Name: "ECDH-ES+A128KW" 1723 o Algorithm Description: ECDH-ES using Concat KDF and "A128KW" 1724 wrapping 1725 o Algorithm Usage Location(s): "alg" 1726 o JOSE Implementation Requirements: Recommended 1727 o Change Controller: IESG 1728 o Specification Document(s): Section 4.1 of [[ this document ]] 1730 o Algorithm Name: "ECDH-ES+A192KW" 1731 o Algorithm Description: ECDH-ES using Concat KDF and "A192KW" 1732 wrapping 1733 o Algorithm Usage Location(s): "alg" 1734 o JOSE Implementation Requirements: Optional 1735 o Change Controller: IESG 1736 o Specification Document(s): Section 4.1 of [[ this document ]] 1738 o Algorithm Name: "ECDH-ES+A256KW" 1739 o Algorithm Description: ECDH-ES using Concat KDF and "A256KW" 1740 wrapping 1741 o Algorithm Usage Location(s): "alg" 1742 o JOSE Implementation Requirements: Recommended 1743 o Change Controller: IESG 1744 o Specification Document(s): Section 4.1 of [[ this document ]] 1746 o Algorithm Name: "A128GCMKW" 1747 o Algorithm Description: Key wrapping with AES GCM using 128 bit key 1748 o Algorithm Usage Location(s): "alg" 1749 o JOSE Implementation Requirements: Optional 1750 o Change Controller: IESG 1751 o Specification Document(s): Section 4.7 of [[ this document ]] 1753 o Algorithm Name: "A192GCMKW" 1754 o Algorithm Description: Key wrapping with AES GCM using 192 bit key 1755 o Algorithm Usage Location(s): "alg" 1756 o JOSE Implementation Requirements: Optional 1757 o Change Controller: IESG 1758 o Specification Document(s): Section 4.7 of [[ this document ]] 1760 o Algorithm Name: "A256GCMKW" 1761 o Algorithm Description: Key wrapping with AES GCM using 256 bit key 1762 o Algorithm Usage Location(s): "alg" 1763 o JOSE Implementation Requirements: Optional 1764 o Change Controller: IESG 1765 o Specification Document(s): Section 4.7 of [[ this document ]] 1766 o Algorithm Name: "PBES2-HS256+A128KW" 1767 o Algorithm Description: PBES2 with HMAC SHA-256 and "A128KW" 1768 wrapping 1769 o Algorithm Usage Location(s): "alg" 1770 o JOSE Implementation Requirements: Optional 1771 o Change Controller: IESG 1772 o Specification Document(s): Section 4.8 of [[ this document ]] 1774 o Algorithm Name: "PBES2-HS384+A192KW" 1775 o Algorithm Description: PBES2 with HMAC SHA-384 and "A192KW" 1776 wrapping 1777 o Algorithm Usage Location(s): "alg" 1778 o JOSE Implementation Requirements: Optional 1779 o Change Controller: IESG 1780 o Specification Document(s): Section 4.8 of [[ this document ]] 1782 o Algorithm Name: "PBES2-HS512+A256KW" 1783 o Algorithm Description: PBES2 with HMAC SHA-512 and "A256KW" 1784 wrapping 1785 o Algorithm Usage Location(s): "alg" 1786 o JOSE Implementation Requirements: Optional 1787 o Change Controller: IESG 1788 o Specification Document(s): Section 4.8 of [[ this document ]] 1790 o Algorithm Name: "A128CBC-HS256" 1791 o Algorithm Description: AES_128_CBC_HMAC_SHA_256 authenticated 1792 encryption algorithm 1793 o Algorithm Usage Location(s): "enc" 1794 o JOSE Implementation Requirements: Required 1795 o Change Controller: IESG 1796 o Specification Document(s): Section 5.1 of [[ this document ]] 1798 o Algorithm Name: "A192CBC-HS384" 1799 o Algorithm Description: AES_192_CBC_HMAC_SHA_384 authenticated 1800 encryption algorithm 1801 o Algorithm Usage Location(s): "enc" 1802 o JOSE Implementation Requirements: Optional 1803 o Change Controller: IESG 1804 o Specification Document(s): Section 5.1 of [[ this document ]] 1806 o Algorithm Name: "A256CBC-HS512" 1807 o Algorithm Description: AES_256_CBC_HMAC_SHA_512 authenticated 1808 encryption algorithm 1809 o Algorithm Usage Location(s): "enc" 1810 o JOSE Implementation Requirements: Required 1811 o Change Controller: IESG 1812 o Specification Document(s): Section 5.1 of [[ this document ]] 1814 o Algorithm Name: "A128GCM" 1815 o Algorithm Description: AES GCM using 128 bit key 1816 o Algorithm Usage Location(s): "enc" 1817 o JOSE Implementation Requirements: Recommended 1818 o Change Controller: IESG 1819 o Specification Document(s): Section 5.1 of [[ this document ]] 1821 o Algorithm Name: "A192GCM" 1822 o Algorithm Description: AES GCM using 192 bit key 1823 o Algorithm Usage Location(s): "enc" 1824 o JOSE Implementation Requirements: Optional 1825 o Change Controller: IESG 1826 o Specification Document(s): Section 5.1 of [[ this document ]] 1828 o Algorithm Name: "A256GCM" 1829 o Algorithm Description: AES GCM using 256 bit key 1830 o Algorithm Usage Location(s): "enc" 1831 o JOSE Implementation Requirements: Recommended 1832 o Change Controller: IESG 1833 o Specification Document(s): Section 5.1 of [[ this document ]] 1835 7.2. JWE Header Parameter Names Registration 1837 This specification registers the Header Parameter names defined in 1838 Section 4.6.1, Section 4.7.1, and Section 4.8.1 in the IANA JSON Web 1839 Signature and Encryption Header Parameters registry defined in [JWS]. 1841 7.2.1. Registry Contents 1843 o Header Parameter Name: "epk" 1844 o Header Parameter Description: Ephemeral Public Key 1845 o Header Parameter Usage Location(s): JWE 1846 o Change Controller: IESG 1847 o Specification Document(s): Section 4.6.1.1 of [[ this document ]] 1849 o Header Parameter Name: "apu" 1850 o Header Parameter Description: Agreement PartyUInfo 1851 o Header Parameter Usage Location(s): JWE 1852 o Change Controller: IESG 1853 o Specification Document(s): Section 4.6.1.2 of [[ this document ]] 1855 o Header Parameter Name: "apv" 1856 o Header Parameter Description: Agreement PartyVInfo 1857 o Header Parameter Usage Location(s): JWE 1858 o Change Controller: IESG 1859 o Specification Document(s): Section 4.6.1.3 of [[ this document ]] 1861 o Header Parameter Name: "iv" 1862 o Header Parameter Description: Initialization Vector 1863 o Header Parameter Usage Location(s): JWE 1864 o Change Controller: IESG 1865 o Specification Document(s): Section 4.7.1.1 of [[ this document ]] 1867 o Header Parameter Name: "tag" 1868 o Header Parameter Description: Authentication Tag 1869 o Header Parameter Usage Location(s): JWE 1870 o Change Controller: IESG 1871 o Specification Document(s): Section 4.7.1.2 of [[ this document ]] 1873 o Header Parameter Name: "p2s" 1874 o Header Parameter Description: PBES2 salt 1875 o Header Parameter Usage Location(s): JWE 1876 o Change Controller: IESG 1877 o Specification Document(s): Section 4.8.1.1 of [[ this document ]] 1879 o Header Parameter Name: "p2c" 1880 o Header Parameter Description: PBES2 count 1881 o Header Parameter Usage Location(s): JWE 1882 o Change Controller: IESG 1883 o Specification Document(s): Section 4.8.1.2 of [[ this document ]] 1885 7.3. JSON Web Encryption Compression Algorithms Registry 1887 This specification establishes the IANA JSON Web Encryption 1888 Compression Algorithms registry for JWE "zip" member values. The 1889 registry records the compression algorithm value and a reference to 1890 the specification that defines it. 1892 7.3.1. Registration Template 1894 Compression Algorithm Value: 1895 The name requested (e.g., "example"). Because a core goal of this 1896 specification is for the resulting representations to be compact, 1897 it is RECOMMENDED that the name be short -- not to exceed 8 1898 characters without a compelling reason to do so. This name is 1899 case-sensitive. Names may not match other registered names in a 1900 case-insensitive manner unless the Designated Expert(s) state that 1901 there is a compelling reason to allow an exception in this 1902 particular case. 1904 Compression Algorithm Description: 1905 Brief description of the compression algorithm (e.g., "Example 1906 description"). 1908 Change Controller: 1909 For Standards Track RFCs, state "IESG". For others, give the name 1910 of the responsible party. Other details (e.g., postal address, 1911 email address, home page URI) may also be included. 1913 Specification Document(s): 1914 Reference to the document(s) that specify the parameter, 1915 preferably including URI(s) that can be used to retrieve copies of 1916 the document(s). An indication of the relevant sections may also 1917 be included but is not required. 1919 7.3.2. Initial Registry Contents 1921 o Compression Algorithm Value: "DEF" 1922 o Compression Algorithm Description: DEFLATE 1923 o Change Controller: IESG 1924 o Specification Document(s): JSON Web Encryption (JWE) [JWE] 1926 7.4. JSON Web Key Types Registry 1928 This specification establishes the IANA JSON Web Key Types registry 1929 for values of the JWK "kty" (key type) parameter. The registry 1930 records the "kty" value, implementation requirements, and a reference 1931 to the specification that defines it. 1933 The implementation requirements of a key type MAY be changed over 1934 time by the Designated Experts(s) as the cryptographic landscape 1935 evolves, for instance, to change the status of a key type to 1936 Deprecated, or to change the status of a key type from Optional to 1937 Recommended+ or Required. Changes of implementation requirements are 1938 only permitted on a Specification Required basis, with the new 1939 specification defining the revised implementation requirements level. 1941 7.4.1. Registration Template 1943 "kty" Parameter Value: 1944 The name requested (e.g., "example"). Because a core goal of this 1945 specification is for the resulting representations to be compact, 1946 it is RECOMMENDED that the name be short -- not to exceed 8 1947 characters without a compelling reason to do so. This name is 1948 case-sensitive. Names may not match other registered names in a 1949 case-insensitive manner unless the Designated Expert(s) state that 1950 there is a compelling reason to allow an exception in this 1951 particular case. 1953 Key Type Description: 1954 Brief description of the Key Type (e.g., "Example description"). 1956 Change Controller: 1957 For Standards Track RFCs, state "IESG". For others, give the name 1958 of the responsible party. Other details (e.g., postal address, 1959 email address, home page URI) may also be included. 1961 JOSE Implementation Requirements: 1962 The key type implementation requirements for JWS and JWE, which 1963 must be one the words Required, Recommended, Optional, Deprecated, 1964 or Prohibited. Optionally, the word can be followed by a "+" or 1965 "-". The use of "+" indicates that the requirement strength is 1966 likely to be increased in a future version of the specification. 1967 The use of "-" indicates that the requirement strength is likely 1968 to be decreased in a future version of the specification. 1970 Specification Document(s): 1971 Reference to the document(s) that specify the parameter, 1972 preferably including URI(s) that can be used to retrieve copies of 1973 the document(s). An indication of the relevant sections may also 1974 be included but is not required. 1976 7.4.2. Initial Registry Contents 1978 This specification registers the values defined in Section 6.1. 1980 o "kty" Parameter Value: "EC" 1981 o Key Type Description: Elliptic Curve 1982 o JOSE Implementation Requirements: Recommended+ 1983 o Change Controller: IESG 1984 o Specification Document(s): Section 6.2 of [[ this document ]] 1986 o "kty" Parameter Value: "RSA" 1987 o Key Type Description: RSA 1988 o JOSE Implementation Requirements: Required 1989 o Change Controller: IESG 1990 o Specification Document(s): Section 6.3 of [[ this document ]] 1992 o "kty" Parameter Value: "oct" 1993 o Key Type Description: Octet sequence 1994 o JOSE Implementation Requirements: Required 1995 o Change Controller: IESG 1996 o Specification Document(s): Section 6.4 of [[ this document ]] 1998 7.5. JSON Web Key Parameters Registration 2000 This specification registers the parameter names defined in Sections 2001 6.2, 6.3, and 6.4 in the IANA JSON Web Key Parameters registry 2002 defined in [JWK]. 2004 7.5.1. Registry Contents 2006 o Parameter Name: "crv" 2007 o Parameter Description: Curve 2008 o Used with "kty" Value(s): "EC" 2009 o Parameter Information Class: Public 2010 o Change Controller: IESG 2011 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2013 o Parameter Name: "x" 2014 o Parameter Description: X Coordinate 2015 o Used with "kty" Value(s): "EC" 2016 o Parameter Information Class: Public 2017 o Change Controller: IESG 2018 o Specification Document(s): Section 6.2.1.2 of [[ this document ]] 2020 o Parameter Name: "y" 2021 o Parameter Description: Y Coordinate 2022 o Used with "kty" Value(s): "EC" 2023 o Parameter Information Class: Public 2024 o Change Controller: IESG 2025 o Specification Document(s): Section 6.2.1.3 of [[ this document ]] 2027 o Parameter Name: "d" 2028 o Parameter Description: ECC Private Key 2029 o Used with "kty" Value(s): "EC" 2030 o Parameter Information Class: Private 2031 o Change Controller: IESG 2032 o Specification Document(s): Section 6.2.2.1 of [[ this document ]] 2034 o Parameter Name: "n" 2035 o Parameter Description: Modulus 2036 o Used with "kty" Value(s): "RSA" 2037 o Parameter Information Class: Public 2038 o Change Controller: IESG 2039 o Specification Document(s): Section 6.3.1.1 of [[ this document ]] 2041 o Parameter Name: "e" 2042 o Parameter Description: Exponent 2043 o Used with "kty" Value(s): "RSA" 2044 o Parameter Information Class: Public 2045 o Change Controller: IESG 2046 o Specification Document(s): Section 6.3.1.2 of [[ this document ]] 2048 o Parameter Name: "d" 2049 o Parameter Description: Private Exponent 2050 o Used with "kty" Value(s): "RSA" 2051 o Parameter Information Class: Private 2052 o Change Controller: IESG 2053 o Specification Document(s): Section 6.3.2.1 of [[ this document ]] 2055 o Parameter Name: "p" 2056 o Parameter Description: First Prime Factor 2057 o Used with "kty" Value(s): "RSA" 2058 o Parameter Information Class: Private 2059 o Change Controller: IESG 2060 o Specification Document(s): Section 6.3.2.2 of [[ this document ]] 2062 o Parameter Name: "q" 2063 o Parameter Description: Second Prime Factor 2064 o Used with "kty" Value(s): "RSA" 2065 o Parameter Information Class: Private 2066 o Change Controller: IESG 2067 o Specification Document(s): Section 6.3.2.3 of [[ this document ]] 2069 o Parameter Name: "dp" 2070 o Parameter Description: First Factor CRT Exponent 2071 o Used with "kty" Value(s): "RSA" 2072 o Parameter Information Class: Private 2073 o Change Controller: IESG 2074 o Specification Document(s): Section 6.3.2.4 of [[ this document ]] 2076 o Parameter Name: "dq" 2077 o Parameter Description: Second Factor CRT Exponent 2078 o Used with "kty" Value(s): "RSA" 2079 o Parameter Information Class: Private 2080 o Change Controller: IESG 2081 o Specification Document(s): Section 6.3.2.5 of [[ this document ]] 2083 o Parameter Name: "qi" 2084 o Parameter Description: First CRT Coefficient 2085 o Used with "kty" Value(s): "RSA" 2086 o Parameter Information Class: Private 2087 o Change Controller: IESG 2088 o Specification Document(s): Section 6.3.2.6 of [[ this document ]] 2089 o Parameter Name: "oth" 2090 o Parameter Description: Other Primes Info 2091 o Used with "kty" Value(s): "RSA" 2092 o Parameter Information Class: Private 2093 o Change Controller: IESG 2094 o Specification Document(s): Section 6.3.2.7 of [[ this document ]] 2096 o Parameter Name: "k" 2097 o Parameter Description: Key Value 2098 o Used with "kty" Value(s): "oct" 2099 o Parameter Information Class: Private 2100 o Change Controller: IESG 2101 o Specification Document(s): Section 6.4.1 of [[ this document ]] 2103 7.6. JSON Web Key Elliptic Curve Registry 2105 This specification establishes the IANA JSON Web Key Elliptic Curve 2106 registry for JWK "crv" member values. The registry records the curve 2107 name, implementation requirements, and a reference to the 2108 specification that defines it. This specification registers the 2109 parameter names defined in Section 6.2.1.1. 2111 The implementation requirements of a curve MAY be changed over time 2112 by the Designated Experts(s) as the cryptographic landscape evolves, 2113 for instance, to change the status of a curve to Deprecated, or to 2114 change the status of a curve from Optional to Recommended+ or 2115 Required. Changes of implementation requirements are only permitted 2116 on a Specification Required basis, with the new specification 2117 defining the revised implementation requirements level. 2119 7.6.1. Registration Template 2121 Curve Name: 2122 The name requested (e.g., "example"). Because a core goal of this 2123 specification is for the resulting representations to be compact, 2124 it is RECOMMENDED that the name be short -- not to exceed 8 2125 characters without a compelling reason to do so. This name is 2126 case-sensitive. Names may not match other registered names in a 2127 case-insensitive manner unless the Designated Expert(s) state that 2128 there is a compelling reason to allow an exception in this 2129 particular case. 2131 Curve Description: 2132 Brief description of the curve (e.g., "Example description"). 2134 JOSE Implementation Requirements: 2135 The curve implementation requirements for JWS and JWE, which must 2136 be one the words Required, Recommended, Optional, Deprecated, or 2137 Prohibited. Optionally, the word can be followed by a "+" or "-". 2138 The use of "+" indicates that the requirement strength is likely 2139 to be increased in a future version of the specification. The use 2140 of "-" indicates that the requirement strength is likely to be 2141 decreased in a future version of the specification. 2143 Change Controller: 2144 For Standards Track RFCs, state "IESG". For others, give the name 2145 of the responsible party. Other details (e.g., postal address, 2146 email address, home page URI) may also be included. 2148 Specification Document(s): 2149 Reference to the document(s) that specify the parameter, 2150 preferably including URI(s) that can be used to retrieve copies of 2151 the document(s). An indication of the relevant sections may also 2152 be included but is not required. 2154 7.6.2. Initial Registry Contents 2156 o Curve Name: "P-256" 2157 o Curve Description: P-256 curve 2158 o JOSE Implementation Requirements: Recommended+ 2159 o Change Controller: IESG 2160 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2162 o Curve Name: "P-384" 2163 o Curve Description: P-384 curve 2164 o JOSE Implementation Requirements: Optional 2165 o Change Controller: IESG 2166 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2168 o Curve Name: "P-521" 2169 o Curve Description: P-521 curve 2170 o JOSE Implementation Requirements: Optional 2171 o Change Controller: IESG 2172 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2174 8. Security Considerations 2176 All of the security issues faced by any cryptographic application 2177 must be faced by a JWS/JWE/JWK agent. Among these issues are 2178 protecting the user's private and symmetric keys, preventing various 2179 attacks, and helping the user avoid mistakes such as inadvertently 2180 encrypting a message for the wrong recipient. The entire list of 2181 security considerations is beyond the scope of this document, but 2182 some significant considerations are listed here. 2184 The security considerations in [AES], [DSS], [JWE], [JWK], [JWS], 2185 [NIST.800-38A], [NIST.800-38D], [NIST.800-56A], [RFC2104], [RFC3394], 2186 [RFC3447], [RFC5116], [RFC6090], and [SHS] apply to this 2187 specification. 2189 Algorithms of matching strengths should be used together whenever 2190 possible. For instance, when AES Key Wrap is used with a given key 2191 size, using the same key size is recommended when AES GCM is also 2192 used. 2194 8.1. Algorithms and Key Sizes will be Deprecated 2196 Eventually the algorithms and/or key sizes currently described in 2197 this specification will no longer be considered sufficiently secure 2198 and will be deprecated. Therefore, implementers and deployments must 2199 be prepared for this eventuality. 2201 8.2. Key Lifetimes 2203 Many algorithms have associated security considerations related to 2204 key lifetimes and/or the number of times that a key may be used. 2205 Those security considerations continue to apply when using those 2206 algorithms with JOSE data structures. 2208 8.3. RSAES-PKCS1-v1_5 Security Considerations 2210 While Section 8 of RFC 3447 [RFC3447] explicitly calls for people not 2211 to adopt RSASSA-PKCS-v1_5 for new applications and instead requests 2212 that people transition to RSASSA-PSS, this specification does include 2213 RSASSA-PKCS-v1_5, for interoperability reasons, because it commonly 2214 implemented. 2216 Keys used with RSAES-PKCS1-v1_5 must follow the constraints in 2217 Section 7.2 of RFC 3447 [RFC3447]. In particular, keys with a low 2218 public key exponent value must not be used. 2220 8.4. AES GCM Security Considerations 2222 Keys used with AES GCM must follow the constraints in Section 8.3 of 2223 [NIST.800-38D], which states: "The total number of invocations of the 2224 authenticated encryption function shall not exceed 2^32, including 2225 all IV lengths and all instances of the authenticated encryption 2226 function with the given key". In accordance with this rule, AES GCM 2227 MUST NOT be used with the same key value more than 2^32 times. 2229 An Initialization Vector value MUST never be used multiple times with 2230 the same AES GCM key. One way to prevent this is to store a counter 2231 with the key and increment it with every use. The counter can also 2232 be used to prevent exceeding the 2^32 limit above. 2234 This security consideration does not apply to the composite AES-CBC 2235 HMAC SHA-2 or AES Key Wrap algorithms. 2237 8.5. Plaintext JWS Security Considerations 2239 Plaintext JWSs (JWSs that use the "alg" value "none") provide no 2240 integrity protection. Thus, they must only be used in contexts where 2241 the payload is secured by means other than a digital signature or MAC 2242 value, or need not be secured. 2244 Implementations that support plaintext JWS objects MUST NOT accept 2245 such objects as valid unless the application specifies that it is 2246 acceptable for a specific object to not be integrity-protected. 2247 Implementations MUST NOT accept plaintext JWS objects by default. 2248 For example, the "verify" method of a hypothetical JWS software 2249 library might have a Boolean "acceptUnsigned" parameter that 2250 indicates "none" is an acceptable "alg" value. As another example, 2251 the "verify" method might take a list of algorithms that are 2252 acceptable to the application as a parameter and would reject 2253 plaintext JWS values if "none" is not in that list. 2255 In order to mitigate downgrade attacks, applications MUST NOT signal 2256 acceptance of plaintext JWS objects at a global level, and SHOULD 2257 signal acceptance on a per-object basis. For example, suppose an 2258 application accepts JWS objects over two channels, (1) HTTP and (2) 2259 HTTPS with client authentication. It requires a JWS signature on 2260 objects received over HTTP, but accepts plaintext JWS objects over 2261 HTTPS. If the application were to globally indicate that "none" is 2262 acceptable, then an attacker could provide it with an unsigned object 2263 over HTTP and still have that object successfully validate. Instead, 2264 the application needs to indicate acceptance of "none" for each 2265 object received over HTTPS (e.g., by setting "acceptUnsigned" to 2266 "true" for the first hypothetical JWS software library above), but 2267 not for each object received over HTTP. 2269 8.6. Differences between Digital Signatures and MACs 2271 While in many cases, MACs and digital signatures can be used for 2272 integrity checking, there are some significant differences between 2273 the security properties that each of them provides. These need to be 2274 taken into consideration when designing protocols and selecting the 2275 algorithms to be used in protocols. 2277 Both signatures and MACs provide for integrity checking -- verifying 2278 that the message has not been modified since the integrity value was 2279 computed. However, MACs provide for origination identification only 2280 under specific circumstances. It can normally be assumed that a 2281 private key used for a signature is only in the hands of a single 2282 entity (although perhaps a distributed entity, in the case of 2283 replicated servers); however, a MAC key needs to be in the hands of 2284 all the entities that use it for integrity computation and checking. 2285 This means that origination can only be determined if a MAC key is 2286 known only to two entities and the receiver knows that it did not 2287 create the message. MAC validation cannot be used to prove 2288 origination to a third party. 2290 8.7. Denial of Service Attacks 2292 Receiving agents that validate signatures and sending agents that 2293 encrypt messages need to be cautious of cryptographic processing 2294 usage when validating signatures and encrypting messages using keys 2295 larger than those mandated in this specification. An attacker could 2296 send certificates with keys that would result in excessive 2297 cryptographic processing, for example, keys larger than those 2298 mandated in this specification, which could swamp the processing 2299 element. Agents that use such keys without first validating the 2300 certificate to a trust anchor are advised to have some sort of 2301 cryptographic resource management system to prevent such attacks. 2303 8.8. Reusing Key Material when Encrypting Keys 2305 It is NOT RECOMMENDED to reuse the same key material (Key Encryption 2306 Key, Content Encryption Key, Initialization Vector, etc.) to encrypt 2307 multiple JWK or JWK Set objects, or to encrypt the same JWK or JWK 2308 Set object multiple times. One suggestion for preventing re-use is 2309 to always generate a new set key material for each encryption 2310 operation, based on the considerations noted in this document as well 2311 as from [RFC4086]. 2313 8.9. Password Considerations 2315 Passwords are vulnerable to a number of attacks. To help mitigate 2316 some of these limitations, this document applies principles from 2317 [RFC2898] to derive cryptographic keys from user-supplied passwords. 2319 However, the strength of the password still has a significant impact. 2320 A high-entropy password has greater resistance to dictionary attacks. 2321 [NIST-800-63-1] contains guidelines for estimating password entropy, 2322 which can help applications and users generate stronger passwords. 2324 An ideal password is one that is as large as (or larger than) the 2325 derived key length. However, passwords larger than a certain 2326 algorithm-specific size are first hashed, which reduces an attacker's 2327 effective search space to the length of the hash algorithm. It is 2328 RECOMMENDED that a password used for "PBES2-HS256+A128KW" be no 2329 shorter than 16 octets and no longer than 128 octets and a password 2330 used for "PBES2-HS512+A256KW" be no shorter than 32 octets and no 2331 longer than 128 octets long. 2333 Still, care needs to be taken in where and how password-based 2334 encryption is used. These algorithms can still be susceptible to 2335 dictionary-based attacks if the iteration count is too small; this is 2336 of particular concern if these algorithms are used to protect data 2337 that an attacker can have indefinite number of attempts to circumvent 2338 the protection, such as protected data stored on a file system. 2340 9. Internationalization Considerations 2342 Passwords obtained from users are likely to require preparation and 2343 normalization to account for differences of octet sequences generated 2344 by different input devices, locales, etc. It is RECOMMENDED that 2345 applications to perform the steps outlined in 2346 [I-D.ietf-precis-saslprepbis] to prepare a password supplied directly 2347 by a user before performing key derivation and encryption. 2349 10. References 2351 10.1. Normative References 2353 [AES] National Institute of Standards and Technology (NIST), 2354 "Advanced Encryption Standard (AES)", FIPS PUB 197, 2355 November 2001. 2357 [DSS] National Institute of Standards and Technology, "Digital 2358 Signature Standard (DSS)", FIPS PUB 186-4, July 2013. 2360 [JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web 2361 Encryption (JWE)", draft-ietf-jose-json-web-encryption 2362 (work in progress), March 2014. 2364 [JWK] Jones, M., "JSON Web Key (JWK)", 2365 draft-ietf-jose-json-web-key (work in progress), 2366 March 2014. 2368 [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 2369 Signature (JWS)", draft-ietf-jose-json-web-signature (work 2370 in progress), March 2014. 2372 [NIST.800-38A] 2373 National Institute of Standards and Technology (NIST), 2374 "Recommendation for Block Cipher Modes of Operation", 2375 NIST PUB 800-38A, December 2001. 2377 [NIST.800-38D] 2378 National Institute of Standards and Technology (NIST), 2379 "Recommendation for Block Cipher Modes of Operation: 2380 Galois/Counter Mode (GCM) and GMAC", NIST PUB 800-38D, 2381 December 2001. 2383 [NIST.800-56A] 2384 National Institute of Standards and Technology (NIST), 2385 "Recommendation for Pair-Wise Key Establishment Schemes 2386 Using Discrete Logarithm Cryptography", NIST Special 2387 Publication 800-56A, Revision 2, May 2013. 2389 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 2390 Hashing for Message Authentication", RFC 2104, 2391 February 1997. 2393 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2394 Requirement Levels", BCP 14, RFC 2119, March 1997. 2396 [RFC2898] Kaliski, B., "PKCS #5: Password-Based Cryptography 2397 Specification Version 2.0", RFC 2898, September 2000. 2399 [RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard 2400 (AES) Key Wrap Algorithm", RFC 3394, September 2002. 2402 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2403 10646", STD 63, RFC 3629, November 2003. 2405 [RFC4868] Kelly, S. and S. Frankel, "Using HMAC-SHA-256, HMAC-SHA- 2406 384, and HMAC-SHA-512 with IPsec", RFC 4868, May 2007. 2408 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 2409 Curve Cryptography Algorithms", RFC 6090, February 2011. 2411 [RFC7158] Bray, T., "The JavaScript Object Notation (JSON) Data 2412 Interchange Format", RFC 7158, March 2014. 2414 [SEC1] Standards for Efficient Cryptography Group, "SEC 1: 2415 Elliptic Curve Cryptography", May 2009. 2417 [SHS] National Institute of Standards and Technology, "Secure 2418 Hash Standard (SHS)", FIPS PUB 180-3, October 2008. 2420 [USASCII] American National Standards Institute, "Coded Character 2421 Set -- 7-bit American Standard Code for Information 2422 Interchange", ANSI X3.4, 1986. 2424 10.2. Informative References 2426 [CanvasApp] 2427 Facebook, "Canvas Applications", 2010. 2429 [I-D.ietf-precis-saslprepbis] 2430 Saint-Andre, P. and A. Melnikov, "Preparation and 2431 Comparison of Internationalized Strings Representing 2432 Usernames and Passwords", draft-ietf-precis-saslprepbis-06 2433 (work in progress), December 2013. 2435 [I-D.mcgrew-aead-aes-cbc-hmac-sha2] 2436 McGrew, D., Foley, J., and K. Paterson, "Authenticated 2437 Encryption with AES-CBC and HMAC-SHA", 2438 draft-mcgrew-aead-aes-cbc-hmac-sha2-04 (work in progress), 2439 February 2014. 2441 [I-D.miller-jose-jwe-protected-jwk] 2442 Miller, M., "Using JavaScript Object Notation (JSON) Web 2443 Encryption (JWE) for Protecting JSON Web Key (JWK) 2444 Objects", draft-miller-jose-jwe-protected-jwk-02 (work in 2445 progress), June 2013. 2447 [I-D.rescorla-jsms] 2448 Rescorla, E. and J. Hildebrand, "JavaScript Message 2449 Security Format", draft-rescorla-jsms-00 (work in 2450 progress), March 2011. 2452 [JCA] Oracle, "Java Cryptography Architecture", 2013. 2454 [JSE] Bradley, J. and N. Sakimura (editor), "JSON Simple 2455 Encryption", September 2010. 2457 [JSS] Bradley, J. and N. Sakimura (editor), "JSON Simple Sign", 2458 September 2010. 2460 [MagicSignatures] 2461 Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic 2462 Signatures", January 2011. 2464 [NIST-800-63-1] 2465 National Institute of Standards and Technology (NIST), 2466 "Electronic Authentication Guideline", NIST 800-63-1, 2467 December 2011. 2469 [RFC2631] Rescorla, E., "Diffie-Hellman Key Agreement Method", 2470 RFC 2631, June 1999. 2472 [RFC3275] Eastlake, D., Reagle, J., and D. Solo, "(Extensible Markup 2473 Language) XML-Signature Syntax and Processing", RFC 3275, 2474 March 2002. 2476 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 2477 Standards (PKCS) #1: RSA Cryptography Specifications 2478 Version 2.1", RFC 3447, February 2003. 2480 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 2481 Requirements for Security", BCP 106, RFC 4086, June 2005. 2483 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 2484 Encryption", RFC 5116, January 2008. 2486 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2487 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2488 May 2008. 2490 [W3C.CR-xmldsig-core2-20120124] 2491 Cantor, S., Roessler, T., Eastlake, D., Yiu, K., Reagle, 2492 J., Solo, D., Datta, P., and F. Hirsch, "XML Signature 2493 Syntax and Processing Version 2.0", World Wide Web 2494 Consortium CR CR-xmldsig-core2-20120124, January 2012, 2495 . 2497 [W3C.CR-xmlenc-core1-20120313] 2498 Eastlake, D., Reagle, J., Roessler, T., and F. Hirsch, 2499 "XML Encryption Syntax and Processing Version 1.1", World 2500 Wide Web Consortium CR CR-xmlenc-core1-20120313, 2501 March 2012, 2502 . 2504 [W3C.REC-xmlenc-core-20021210] 2505 Eastlake, D. and J. Reagle, "XML Encryption Syntax and 2506 Processing", World Wide Web Consortium Recommendation REC- 2507 xmlenc-core-20021210, December 2002, 2508 . 2510 Appendix A. Algorithm Identifier Cross-Reference 2512 This appendix contains tables cross-referencing the cryptographic 2513 algorithm identifier values defined in this specification with the 2514 equivalent identifiers used by other standards and software packages. 2515 See XML DSIG [RFC3275], XML DSIG 2.0 [W3C.CR-xmldsig-core2-20120124], 2516 XML Encryption [W3C.REC-xmlenc-core-20021210], XML Encryption 1.1 2517 [W3C.CR-xmlenc-core1-20120313], and Java Cryptography Architecture 2518 [JCA] for more information about the names defined by those 2519 documents. 2521 A.1. Digital Signature/MAC Algorithm Identifier Cross-Reference 2523 This section contains a table cross-referencing the JWS digital 2524 signature and MAC "alg" (algorithm) values defined in this 2525 specification with the equivalent identifiers used by other standards 2526 and software packages. 2528 +-----+-------------------------------+--------------+--------------+ 2529 | JWS | XML DSIG | JCA | OID | 2530 +-----+-------------------------------+--------------+--------------+ 2531 | HS2 | http://www.w3.org/2001/04/xml | HmacSHA256 | 1.2.840.1135 | 2532 | 56 | dsig-more#hmac-sha256 | | 49.2.9 | 2533 | HS3 | http://www.w3.org/2001/04/xml | HmacSHA384 | 1.2.840.1135 | 2534 | 84 | dsig-more#hmac-sha384 | | 49.2.10 | 2535 | HS5 | http://www.w3.org/2001/04/xml | HmacSHA512 | 1.2.840.1135 | 2536 | 12 | dsig-more#hmac-sha512 | | 49.2.11 | 2537 | RS2 | http://www.w3.org/2001/04/xml | SHA256withRS | 1.2.840.1135 | 2538 | 56 | dsig-more#rsa-sha256 | A | 49.1.1.11 | 2539 | RS3 | http://www.w3.org/2001/04/xml | SHA384withRS | 1.2.840.1135 | 2540 | 84 | dsig-more#rsa-sha384 | A | 49.1.1.12 | 2541 | RS5 | http://www.w3.org/2001/04/xml | SHA512withRS | 1.2.840.1135 | 2542 | 12 | dsig-more#rsa-sha512 | A | 49.1.1.13 | 2543 | ES2 | http://www.w3.org/2001/04/xml | SHA256withEC | 1.2.840.1004 | 2544 | 56 | dsig-more#ecdsa-sha256 | DSA | 5.4.3.2 | 2545 | ES3 | http://www.w3.org/2001/04/xml | SHA384withEC | 1.2.840.1004 | 2546 | 84 | dsig-more#ecdsa-sha384 | DSA | 5.4.3.3 | 2547 | ES5 | http://www.w3.org/2001/04/xml | SHA512withEC | 1.2.840.1004 | 2548 | 12 | dsig-more#ecdsa-sha512 | DSA | 5.4.3.4 | 2549 | PS2 | http://www.w3.org/2007/05/xml | SHA256withRS | 1.2.840.1135 | 2550 | 56 | dsig-more#sha256-rsa-MGF1 | AandMGF1 | 49.1.1.10 | 2551 | PS3 | http://www.w3.org/2007/05/xml | SHA384withRS | 1.2.840.1135 | 2552 | 84 | dsig-more#sha384-rsa-MGF1 | AandMGF1 | 49.1.1.10 | 2553 | PS5 | http://www.w3.org/2007/05/xml | SHA512withRS | 1.2.840.1135 | 2554 | 12 | dsig-more#sha512-rsa-MGF1 | AandMGF1 | 49.1.1.10 | 2555 +-----+-------------------------------+--------------+--------------+ 2557 A.2. Key Management Algorithm Identifier Cross-Reference 2559 This section contains a table cross-referencing the JWE "alg" 2560 (algorithm) values defined in this specification with the equivalent 2561 identifiers used by other standards and software packages. 2563 +------+------------------------+--------------------+--------------+ 2564 | JWE | XML ENC | JCA | OID | 2565 +------+------------------------+--------------------+--------------+ 2566 | RSA1 | http://www.w3.org/2001 | RSA/ECB/PKCS1Paddi | 1.2.840.1135 | 2567 | _5 | /04/xmlenc#rsa-1_5 | ng | 49.1.1.1 | 2568 | RSA- | http://www.w3.org/2001 | RSA/ECB/OAEPWithSH | 1.2.840.1135 | 2569 | OAEP | /04/xmlenc#rsa-oaep-mg | A-1AndMGF1Padding | 49.1.1.7 | 2570 | | f1p | | | 2571 | ECDH | http://www.w3.org/2009 | | 1.3.132.1.12 | 2572 | -ES | /xmlenc11#ECDH-ES | | | 2573 | A128 | http://www.w3.org/2001 | | 2.16.840.1.1 | 2574 | KW | /04/xmlenc#kw-aes128 | | 01.3.4.1.5 | 2575 | A192 | http://www.w3.org/2001 | | 2.16.840.1.1 | 2576 | KW | /04/xmlenc#kw-aes192 | | 01.3.4.1.25 | 2577 | A256 | http://www.w3.org/2001 | | 2.16.840.1.1 | 2578 | KW | /04/xmlenc#kw-aes256 | | 01.3.4.1.45 | 2579 +------+------------------------+--------------------+--------------+ 2581 A.3. Content Encryption Algorithm Identifier Cross-Reference 2583 This section contains a table cross-referencing the JWE "enc" 2584 (encryption algorithm) values defined in this specification with the 2585 equivalent identifiers used by other standards and software packages. 2587 For the composite algorithms "A128CBC-HS256", "A192CBC-HS384", and 2588 "A256CBC-HS512", the corresponding AES CBC algorithm identifiers are 2589 listed. 2591 +---------+-------------------------+--------------+----------------+ 2592 | JWE | XML ENC | JCA | OID | 2593 +---------+-------------------------+--------------+----------------+ 2594 | A128CBC | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.101 | 2595 | -HS256 | 04/xmlenc#aes128-cbc | 5Padding | .3.4.1.2 | 2596 | A192CBC | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.101 | 2597 | -HS384 | 04/xmlenc#aes192-cbc | 5Padding | .3.4.1.22 | 2598 | A256CBC | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.101 | 2599 | -HS512 | 04/xmlenc#aes256-cbc | 5Padding | .3.4.1.42 | 2600 | A128GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.101 | 2601 | | xmlenc11#aes128-gcm | dding | .3.4.1.6 | 2602 | A192GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.101 | 2603 | | xmlenc11#aes192-gcm | dding | .3.4.1.26 | 2604 | A256GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.101 | 2605 | | xmlenc11#aes256-gcm | dding | .3.4.1.46 | 2606 +---------+-------------------------+--------------+----------------+ 2608 Appendix B. Test Cases for AES_CBC_HMAC_SHA2 Algorithms 2610 The following test cases can be used to validate implementations of 2611 the AES_CBC_HMAC_SHA2 algorithms defined in Section 5.2. They are 2612 also intended to correspond to test cases that may appear in a future 2613 version of [I-D.mcgrew-aead-aes-cbc-hmac-sha2], demonstrating that 2614 the cryptographic computations performed are the same. 2616 The variable names are those defined in Section 5.2. All values are 2617 hexadecimal. 2619 B.1. Test Cases for AES_128_CBC_HMAC_SHA_256 2621 AES_128_CBC_HMAC_SHA_256 2623 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2624 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2626 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2628 ENC_KEY = 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2630 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2631 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2632 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2633 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2634 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2635 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2636 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2637 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2639 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2641 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2642 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2643 4b 65 72 63 6b 68 6f 66 66 73 2645 AL = 00 00 00 00 00 00 01 50 2647 E = c8 0e df a3 2d df 39 d5 ef 00 c0 b4 68 83 42 79 2648 a2 e4 6a 1b 80 49 f7 92 f7 6b fe 54 b9 03 a9 c9 2649 a9 4a c9 b4 7a d2 65 5c 5f 10 f9 ae f7 14 27 e2 2650 fc 6f 9b 3f 39 9a 22 14 89 f1 63 62 c7 03 23 36 2651 09 d4 5a c6 98 64 e3 32 1c f8 29 35 ac 40 96 c8 2652 6e 13 33 14 c5 40 19 e8 ca 79 80 df a4 b9 cf 1b 2653 38 4c 48 6f 3a 54 c5 10 78 15 8e e5 d7 9d e5 9f 2654 bd 34 d8 48 b3 d6 95 50 a6 76 46 34 44 27 ad e5 2655 4b 88 51 ff b5 98 f7 f8 00 74 b9 47 3c 82 e2 db 2657 M = 65 2c 3f a3 6b 0a 7c 5b 32 19 fa b3 a3 0b c1 c4 2658 e6 e5 45 82 47 65 15 f0 ad 9f 75 a2 b7 1c 73 ef 2660 T = 65 2c 3f a3 6b 0a 7c 5b 32 19 fa b3 a3 0b c1 c4 2662 B.2. Test Cases for AES_192_CBC_HMAC_SHA_384 2664 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2665 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2666 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2668 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2669 10 11 12 13 14 15 16 17 2671 ENC_KEY = 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 2672 28 29 2a 2b 2c 2d 2e 2f 2674 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2675 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2676 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2677 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2678 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2679 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2680 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2681 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2683 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2685 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2686 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2687 4b 65 72 63 6b 68 6f 66 66 73 2689 AL = 00 00 00 00 00 00 01 50 2691 E = ea 65 da 6b 59 e6 1e db 41 9b e6 2d 19 71 2a e5 2692 d3 03 ee b5 00 52 d0 df d6 69 7f 77 22 4c 8e db 2693 00 0d 27 9b dc 14 c1 07 26 54 bd 30 94 42 30 c6 2694 57 be d4 ca 0c 9f 4a 84 66 f2 2b 22 6d 17 46 21 2695 4b f8 cf c2 40 0a dd 9f 51 26 e4 79 66 3f c9 0b 2696 3b ed 78 7a 2f 0f fc bf 39 04 be 2a 64 1d 5c 21 2697 05 bf e5 91 ba e2 3b 1d 74 49 e5 32 ee f6 0a 9a 2698 c8 bb 6c 6b 01 d3 5d 49 78 7b cd 57 ef 48 49 27 2699 f2 80 ad c9 1a c0 c4 e7 9c 7b 11 ef c6 00 54 e3 2701 M = 84 90 ac 0e 58 94 9b fe 51 87 5d 73 3f 93 ac 20 2702 75 16 80 39 cc c7 33 d7 45 94 f8 86 b3 fa af d4 2703 86 f2 5c 71 31 e3 28 1e 36 c7 a2 d1 30 af de 57 2705 T = 84 90 ac 0e 58 94 9b fe 51 87 5d 73 3f 93 ac 20 2706 75 16 80 39 cc c7 33 d7 2708 B.3. Test Cases for AES_256_CBC_HMAC_SHA_512 2710 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2711 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2712 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2713 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 2715 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2716 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2718 ENC_KEY = 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2719 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 2721 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2722 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2723 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2724 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2725 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2726 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2727 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2728 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2730 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2732 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2733 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2734 4b 65 72 63 6b 68 6f 66 66 73 2736 AL = 00 00 00 00 00 00 01 50 2738 E = 4a ff aa ad b7 8c 31 c5 da 4b 1b 59 0d 10 ff bd 2739 3d d8 d5 d3 02 42 35 26 91 2d a0 37 ec bc c7 bd 2740 82 2c 30 1d d6 7c 37 3b cc b5 84 ad 3e 92 79 c2 2741 e6 d1 2a 13 74 b7 7f 07 75 53 df 82 94 10 44 6b 2742 36 eb d9 70 66 29 6a e6 42 7e a7 5c 2e 08 46 a1 2743 1a 09 cc f5 37 0d c8 0b fe cb ad 28 c7 3f 09 b3 2744 a3 b7 5e 66 2a 25 94 41 0a e4 96 b2 e2 e6 60 9e 2745 31 e6 e0 2c c8 37 f0 53 d2 1f 37 ff 4f 51 95 0b 2746 be 26 38 d0 9d d7 a4 93 09 30 80 6d 07 03 b1 f6 2748 M = 4d d3 b4 c0 88 a7 f4 5c 21 68 39 64 5b 20 12 bf 2749 2e 62 69 a8 c5 6a 81 6d bc 1b 26 77 61 95 5b c5 2750 fd 30 a5 65 c6 16 ff b2 f3 64 ba ec e6 8f c4 07 2751 53 bc fc 02 5d de 36 93 75 4a a1 f5 c3 37 3b 9c 2753 T = 4d d3 b4 c0 88 a7 f4 5c 21 68 39 64 5b 20 12 bf 2754 2e 62 69 a8 c5 6a 81 6d bc 1b 26 77 61 95 5b c5 2756 Appendix C. Example ECDH-ES Key Agreement Computation 2758 This example uses ECDH-ES Key Agreement and the Concat KDF to derive 2759 the Content Encryption Key (CEK) in the manner described in 2760 Section 4.6. In this example, the ECDH-ES Direct Key Agreement mode 2761 ("alg" value "ECDH-ES") is used to produce an agreed upon key for AES 2762 GCM with a 128 bit key ("enc" value "A128GCM"). 2764 In this example, a sender Alice is encrypting content to a recipient 2765 Bob. The sender (Alice) generates an ephemeral key for the key 2766 agreement computation. Alice's ephemeral key (in JWK format) used 2767 for the key agreement computation in this example (including the 2768 private part) is: 2770 {"kty":"EC", 2771 "crv":"P-256", 2772 "x":"gI0GAILBdu7T53akrFmMyGcsF3n5dO7MmwNBHKW5SV0", 2773 "y":"SLW_xSffzlPWrHEVI30DHM_4egVwt3NQqeUD7nMFpps", 2774 "d":"0_NxaRPUMQoAJt50Gz8YiTr8gRTwyEaCumd-MToTmIo" 2775 } 2777 The recipient's (Bob's) key (in JWK format) used for the key 2778 agreement computation in this example (including the private part) 2779 is: 2781 {"kty":"EC", 2782 "crv":"P-256", 2783 "x":"weNJy2HscCSM6AEDTDg04biOvhFhyyWvOHQfeF_PxMQ", 2784 "y":"e8lnCO-AlStT-NJVX-crhB7QRYhiix03illJOVAOyck", 2785 "d":"VEmDZpDXXK8p8N0Cndsxs924q6nS1RXFASRl6BfUqdw" 2786 } 2788 Header Parameter values used in this example are as follows. In this 2789 example, the "apu" (agreement PartyUInfo) parameter value is the 2790 base64url encoding of the UTF-8 string "Alice" and the "apv" 2791 (agreement PartyVInfo) parameter value is the base64url encoding of 2792 the UTF-8 string "Bob". The "epk" parameter is used to communicate 2793 the sender's (Alice's) ephemeral public key value to the recipient 2794 (Bob). 2796 {"alg":"ECDH-ES", 2797 "enc":"A128GCM", 2798 "apu":"QWxpY2U", 2799 "apv":"Qm9i", 2800 "epk": 2801 {"kty":"EC", 2802 "crv":"P-256", 2803 "x":"gI0GAILBdu7T53akrFmMyGcsF3n5dO7MmwNBHKW5SV0", 2804 "y":"SLW_xSffzlPWrHEVI30DHM_4egVwt3NQqeUD7nMFpps" 2805 } 2806 } 2808 The resulting Concat KDF [NIST.800-56A] parameter values are: 2810 Z 2811 This is set to the ECDH-ES key agreement output. (This value is 2812 often not directly exposed by libraries, due to NIST security 2813 requirements, and only serves as an input to a KDF.) In this 2814 example, Z is the octet sequence: 2815 [158, 86, 217, 29, 129, 113, 53, 211, 114, 131, 66, 131, 191, 132, 2816 38, 156, 251, 49, 110, 163, 218, 128, 106, 72, 246, 218, 167, 121, 2817 140, 254, 144, 196]. 2819 keydatalen 2820 This value is 128 - the number of bits in the desired output key 2821 (because "A128GCM" uses a 128 bit key). 2823 AlgorithmID 2824 This is set to the octets representing the 32 bit big endian value 2825 7 - [0, 0, 0, 7] - the number of octets in the AlgorithmID content 2826 "A128GCM", followed, by the octets representing the UTF-8 string 2827 "A128GCM" - [65, 49, 50, 56, 71, 67, 77]. 2829 PartyUInfo 2830 This is set to the octets representing the 32 bit big endian value 2831 5 - [0, 0, 0, 5] - the number of octets in the PartyUInfo content 2832 "Alice", followed, by the octets representing the UTF-8 string 2833 "Alice" - [65, 108, 105, 99, 101]. 2835 PartyVInfo 2836 This is set to the octets representing the 32 bit big endian value 2837 3 - [0, 0, 0, 3] - the number of octets in the PartyUInfo content 2838 "Bob", followed, by the octets representing the UTF-8 string "Bob" 2839 - [66, 111, 98]. 2841 SuppPubInfo 2842 This is set to the octets representing the 32 bit big endian value 2843 128 - [0, 0, 0, 128] - the keydatalen value. 2845 SuppPrivInfo 2846 This is set to the empty octet sequence. 2848 Concatenating the parameters AlgorithmID through SuppPubInfo results 2849 in an OtherInfo value of: 2850 [0, 0, 0, 7, 65, 49, 50, 56, 71, 67, 77, 0, 0, 0, 5, 65, 108, 105, 2851 99, 101, 0, 0, 0, 3, 66, 111, 98, 0, 0, 0, 128] 2853 Concatenating the round number 1 ([0, 0, 0, 1]), Z, and the OtherInfo 2854 value results in the Concat KDF round 1 hash input of: 2855 [0, 0, 0, 1, 2856 158, 86, 217, 29, 129, 113, 53, 211, 114, 131, 66, 131, 191, 132, 38, 2857 156, 251, 49, 110, 163, 218, 128, 106, 72, 246, 218, 167, 121, 140, 2858 254, 144, 196, 2859 0, 0, 0, 7, 65, 49, 50, 56, 71, 67, 77, 0, 0, 0, 5, 65, 108, 105, 99, 2860 101, 0, 0, 0, 3, 66, 111, 98, 0, 0, 0, 128] 2862 The resulting derived key, which is the first 128 bits of the round 1 2863 hash output is: 2864 [86, 170, 141, 234, 248, 35, 109, 32, 92, 34, 40, 205, 113, 167, 16, 2865 26] 2867 The base64url encoded representation of this derived key is: 2869 VqqN6vgjbSBcIijNcacQGg 2871 Appendix D. Acknowledgements 2873 Solutions for signing and encrypting JSON content were previously 2874 explored by Magic Signatures [MagicSignatures], JSON Simple Sign 2875 [JSS], Canvas Applications [CanvasApp], JSON Simple Encryption [JSE], 2876 and JavaScript Message Security Format [I-D.rescorla-jsms], all of 2877 which influenced this draft. 2879 The Authenticated Encryption with AES-CBC and HMAC-SHA 2880 [I-D.mcgrew-aead-aes-cbc-hmac-sha2] specification, upon which the 2881 AES_CBC_HMAC_SHA2 algorithms are based, was written by David A. 2882 McGrew and Kenny Paterson. The test cases for AES_CBC_HMAC_SHA2 are 2883 based upon those for [I-D.mcgrew-aead-aes-cbc-hmac-sha2] by John 2884 Foley. 2886 Matt Miller wrote Using JavaScript Object Notation (JSON) Web 2887 Encryption (JWE) for Protecting JSON Web Key (JWK) Objects 2889 [I-D.miller-jose-jwe-protected-jwk], which the password-based 2890 encryption content of this draft is based upon. 2892 This specification is the work of the JOSE Working Group, which 2893 includes dozens of active and dedicated participants. In particular, 2894 the following individuals contributed ideas, feedback, and wording 2895 that influenced this specification: 2897 Dirk Balfanz, Richard Barnes, John Bradley, Brian Campbell, Breno de 2898 Medeiros, Vladimir Dzhuvinov, Yaron Y. Goland, Dick Hardt, Jeff 2899 Hodges, Edmund Jay, James Manger, Matt Miller, Tony Nadalin, Axel 2900 Nennker, John Panzer, Emmanuel Raviart, Nat Sakimura, Jim Schaad, 2901 Hannes Tschofenig, and Sean Turner. 2903 Jim Schaad and Karen O'Donoghue chaired the JOSE working group and 2904 Sean Turner and Stephen Farrell served as Security area directors 2905 during the creation of this specification. 2907 Appendix E. Document History 2909 [[ to be removed by the RFC Editor before publication as an RFC ]] 2911 -22 2913 o Corrected RFC 2119 terminology usage. 2915 o Replaced references to draft-ietf-json-rfc4627bis with RFC 7158. 2917 -21 2919 o Compute the PBES2 salt parameter as (UTF8(Alg) || 0x00 || Salt 2920 Input), where the "p2s" Header Parameter encodes the Salt Input 2921 value and Alg is the "alg" Header Parameter value. 2923 o Changed some references from being normative to informative, 2924 addressing issue #90. 2926 -20 2928 o Replaced references to RFC 4627 with draft-ietf-json-rfc4627bis, 2929 addressing issue #90. 2931 -19 2933 o Used tables to show the correspondence between algorithm 2934 identifiers and algorithm descriptions and parameters in the 2935 algorithm definition sections, addressing issue #183. 2937 o Changed the "Implementation Requirements" registry field names to 2938 "JOSE Implementation Requirements" to make it clear that these 2939 implementation requirements apply only to JWS and JWE 2940 implementations. 2942 -18 2944 o Changes to address editorial and minor issues #129, #134, #135, 2945 #158, #161, #185, #186, and #187. 2947 o Added and used Description registry fields. 2949 -17 2951 o Explicitly named all the logical components of a JWS and JWE and 2952 defined the processing rules and serializations in terms of those 2953 components, addressing issues #60, #61, and #62. 2955 o Removed processing steps in algorithm definitions that duplicated 2956 processing steps in JWS or JWE, addressing issue #56. 2958 o Replaced verbose repetitive phases such as "base64url encode the 2959 octets of the UTF-8 representation of X" with mathematical 2960 notation such as "BASE64URL(UTF8(X))". 2962 o Terms used in multiple documents are now defined in one place and 2963 incorporated by reference. Some lightly used or obvious terms 2964 were also removed. This addresses issue #58. 2966 o Changes to address minor issue #53. 2968 -16 2970 o Added a DataLen prefix to the AlgorithmID value in the Concat KDF 2971 computation. 2973 o Added OIDs for encryption algorithms, additional signature 2974 algorithm OIDs, and additional XML DSIG/ENC URIs in the algorithm 2975 cross-reference tables. 2977 o Changes to address editorial and minor issues #28, #36, #39, #52, 2978 #53, #55, #127, #128, #136, #137, #141, #150, #151, #152, and 2979 #155. 2981 -15 2983 o Changed statements about rejecting JWSs to statements about 2984 validation failing, addressing issue #35. 2986 o Stated that changes of implementation requirements are only 2987 permitted on a Specification Required basis, addressing issue #38. 2989 o Made "oct" a required key type, addressing issue #40. 2991 o Updated the example ECDH-ES key agreement values. 2993 o Changes to address editorial and minor issues #34, #37, #49, #63, 2994 #123, #124, #125, #130, #132, #133, #138, #139, #140, #142, #143, 2995 #144, #145, #148, #149, #150, and #162. 2997 -14 2999 o Removed "PBKDF2" key type and added "p2s" and "p2c" header 3000 parameters for use with the PBES2 algorithms. 3002 o Made the RSA private key parameters that are there to enable 3003 optimizations be RECOMMENDED rather than REQUIRED. 3005 o Added algorithm identifiers for AES algorithms using 192 bit keys 3006 and for RSASSA-PSS using HMAC SHA-384. 3008 o Added security considerations about key lifetimes, addressing 3009 issue #18. 3011 o Added an example ECDH-ES key agreement computation. 3013 -13 3015 o Added key encryption with AES GCM as specified in 3016 draft-jones-jose-aes-gcm-key-wrap-01, addressing issue #13. 3018 o Added security considerations text limiting the number of times 3019 that an AES GCM key can be used for key encryption or direct 3020 encryption, per Section 8.3 of NIST SP 800-38D, addressing issue 3021 #28. 3023 o Added password-based key encryption as specified in 3024 draft-miller-jose-jwe-protected-jwk-02. 3026 -12 3028 o In the Direct Key Agreement case, the Concat KDF AlgorithmID is 3029 set to the octets of the UTF-8 representation of the "enc" header 3030 parameter value. 3032 o Restored the "apv" (agreement PartyVInfo) parameter. 3034 o Moved the "epk", "apu", and "apv" Header Parameter definitions to 3035 be with the algorithm descriptions that use them. 3037 o Changed terminology from "block encryption" to "content 3038 encryption". 3040 -11 3042 o Removed the Encrypted Key value from the AAD computation since it 3043 is already effectively integrity protected by the encryption 3044 process. The AAD value now only contains the representation of 3045 the JWE Encrypted Header. 3047 o Removed "apv" (agreement PartyVInfo) since it is no longer used. 3049 o Added more information about the use of PartyUInfo during key 3050 agreement. 3052 o Use the keydatalen as the SuppPubInfo value for the Concat KDF 3053 when doing key agreement, as RFC 2631 does. 3055 o Added algorithm identifiers for RSASSA-PSS with SHA-256 and SHA- 3056 512. 3058 o Added a Parameter Information Class value to the JSON Web Key 3059 Parameters registry, which registers whether the parameter conveys 3060 public or private information. 3062 -10 3064 o Changed the JWE processing rules for multiple recipients so that a 3065 single AAD value contains the header parameters and encrypted key 3066 values for all the recipients, enabling AES GCM to be safely used 3067 for multiple recipients. 3069 -09 3071 o Expanded the scope of the JWK parameters to include private and 3072 symmetric key representations, as specified by 3073 draft-jones-jose-json-private-and-symmetric-key-00. 3075 o Changed term "JWS Secured Input" to "JWS Signing Input". 3077 o Changed from using the term "byte" to "octet" when referring to 8 3078 bit values. 3080 o Specified that AES Key Wrap uses the default initial value 3081 specified in Section 2.2.3.1 of RFC 3394. This addressed issue 3082 #19. 3084 o Added Key Management Mode definitions to terminology section and 3085 used the defined terms to provide clearer key management 3086 instructions. This addressed issue #5. 3088 o Replaced "A128CBC+HS256" and "A256CBC+HS512" with "A128CBC-HS256" 3089 and "A256CBC-HS512". The new algorithms perform the same 3090 cryptographic computations as [I-D.mcgrew-aead-aes-cbc-hmac-sha2], 3091 but with the Initialization Vector and Authentication Tag values 3092 remaining separate from the Ciphertext value in the output 3093 representation. Also deleted the header parameters "epu" 3094 (encryption PartyUInfo) and "epv" (encryption PartyVInfo), since 3095 they are no longer used. 3097 o Changed from using the term "Integrity Value" to "Authentication 3098 Tag". 3100 -08 3102 o Changed the name of the JWK key type parameter from "alg" to 3103 "kty". 3105 o Replaced uses of the term "AEAD" with "Authenticated Encryption", 3106 since the term AEAD in the RFC 5116 sense implied the use of a 3107 particular data representation, rather than just referring to the 3108 class of algorithms that perform authenticated encryption with 3109 associated data. 3111 o Applied editorial improvements suggested by Jeff Hodges. Many of 3112 these simplified the terminology used. 3114 o Added seriesInfo information to Internet Draft references. 3116 -07 3118 o Added a data length prefix to PartyUInfo and PartyVInfo values. 3120 o Changed the name of the JWK RSA modulus parameter from "mod" to 3121 "n" and the name of the JWK RSA exponent parameter from "xpo" to 3122 "e", so that the identifiers are the same as those used in RFC 3123 3447. 3125 o Made several local editorial changes to clean up loose ends left 3126 over from to the decision to only support block encryption methods 3127 providing integrity. 3129 -06 3130 o Removed the "int" and "kdf" parameters and defined the new 3131 composite Authenticated Encryption algorithms "A128CBC+HS256" and 3132 "A256CBC+HS512" to replace the former uses of AES CBC, which 3133 required the use of separate integrity and key derivation 3134 functions. 3136 o Included additional values in the Concat KDF calculation -- the 3137 desired output size and the algorithm value, and optionally 3138 PartyUInfo and PartyVInfo values. Added the optional header 3139 parameters "apu" (agreement PartyUInfo), "apv" (agreement 3140 PartyVInfo), "epu" (encryption PartyUInfo), and "epv" (encryption 3141 PartyVInfo). 3143 o Changed the name of the JWK RSA exponent parameter from "exp" to 3144 "xpo" so as to allow the potential use of the name "exp" for a 3145 future extension that might define an expiration parameter for 3146 keys. (The "exp" name is already used for this purpose in the JWT 3147 specification.) 3149 o Applied changes made by the RFC Editor to RFC 6749's registry 3150 language to this specification. 3152 -05 3154 o Support both direct encryption using a shared or agreed upon 3155 symmetric key, and the use of a shared or agreed upon symmetric 3156 key to key wrap the CMK. Specifically, added the "alg" values 3157 "dir", "ECDH-ES+A128KW", and "ECDH-ES+A256KW" to finish filling in 3158 this set of capabilities. 3160 o Updated open issues. 3162 -04 3164 o Added text requiring that any leading zero bytes be retained in 3165 base64url encoded key value representations for fixed-length 3166 values. 3168 o Added this language to Registration Templates: "This name is case 3169 sensitive. Names that match other registered names in a case 3170 insensitive manner SHOULD NOT be accepted." 3172 o Described additional open issues. 3174 o Applied editorial suggestions. 3176 -03 3177 o Always use a 128 bit "authentication tag" size for AES GCM, 3178 regardless of the key size. 3180 o Specified that use of a 128 bit IV is REQUIRED with AES CBC. It 3181 was previously RECOMMENDED. 3183 o Removed key size language for ECDSA algorithms, since the key size 3184 is implied by the algorithm being used. 3186 o Stated that the "int" key size must be the same as the hash output 3187 size (and not larger, as was previously allowed) so that its size 3188 is defined for key generation purposes. 3190 o Added the "kdf" (key derivation function) header parameter to 3191 provide crypto agility for key derivation. The default KDF 3192 remains the Concat KDF with the SHA-256 digest function. 3194 o Clarified that the "mod" and "exp" values are unsigned. 3196 o Added Implementation Requirements columns to algorithm tables and 3197 Implementation Requirements entries to algorithm registries. 3199 o Changed AES Key Wrap to RECOMMENDED. 3201 o Moved registries JSON Web Signature and Encryption Header 3202 Parameters and JSON Web Signature and Encryption Type Values to 3203 the JWS specification. 3205 o Moved JSON Web Key Parameters registry to the JWK specification. 3207 o Changed registration requirements from RFC Required to 3208 Specification Required with Expert Review. 3210 o Added Registration Template sections for defined registries. 3212 o Added Registry Contents sections to populate registry values. 3214 o No longer say "the UTF-8 representation of the JWS Secured Input 3215 (which is the same as the ASCII representation)". Just call it 3216 "the ASCII representation of the JWS Secured Input". 3218 o Added "Collision Resistant Namespace" to the terminology section. 3220 o Numerous editorial improvements. 3222 -02 3223 o For AES GCM, use the "additional authenticated data" parameter to 3224 provide integrity for the header, encrypted key, and ciphertext 3225 and use the resulting "authentication tag" value as the JWE 3226 Authentication Tag. 3228 o Defined minimum required key sizes for algorithms without 3229 specified key sizes. 3231 o Defined KDF output key sizes. 3233 o Specified the use of PKCS #5 padding with AES CBC. 3235 o Generalized text to allow key agreement to be employed as an 3236 alternative to key wrapping or key encryption. 3238 o Clarified that ECDH-ES is a key agreement algorithm. 3240 o Required implementation of AES-128-KW and AES-256-KW. 3242 o Removed the use of "A128GCM" and "A256GCM" for key wrapping. 3244 o Removed "A512KW" since it turns out that it's not a standard 3245 algorithm. 3247 o Clarified the relationship between "typ" header parameter values 3248 and MIME types. 3250 o Generalized language to refer to Message Authentication Codes 3251 (MACs) rather than Hash-based Message Authentication Codes (HMACs) 3252 unless in a context specific to HMAC algorithms. 3254 o Established registries: JSON Web Signature and Encryption Header 3255 Parameters, JSON Web Signature and Encryption Algorithms, JSON Web 3256 Signature and Encryption "typ" Values, JSON Web Key Parameters, 3257 and JSON Web Key Algorithm Families. 3259 o Moved algorithm-specific definitions from JWK to JWA. 3261 o Reformatted to give each member definition its own section 3262 heading. 3264 -01 3266 o Moved definition of "alg":"none" for JWSs here from the JWT 3267 specification since this functionality is likely to be useful in 3268 more contexts that just for JWTs. 3270 o Added Advanced Encryption Standard (AES) Key Wrap Algorithm using 3271 512 bit keys ("A512KW"). 3273 o Added text "Alternatively, the Encoded JWS Signature MAY be 3274 base64url decoded to produce the JWS Signature and this value can 3275 be compared with the computed HMAC value, as this comparison 3276 produces the same result as comparing the encoded values". 3278 o Corrected the Magic Signatures reference. 3280 o Made other editorial improvements suggested by JOSE working group 3281 participants. 3283 -00 3285 o Created the initial IETF draft based upon 3286 draft-jones-json-web-signature-04 and 3287 draft-jones-json-web-encryption-02 with no normative changes. 3289 o Changed terminology to no longer call both digital signatures and 3290 HMACs "signatures". 3292 Author's Address 3294 Michael B. Jones 3295 Microsoft 3297 Email: mbj@microsoft.com 3298 URI: http://self-issued.info/