idnits 2.17.1 draft-ietf-jose-json-web-algorithms-38.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 23 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 (December 9, 2014) is 3425 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 2927 -- Looks like a reference, but probably isn't: '0' on line 2927 -- Looks like a reference, but probably isn't: '7' on line 2899 -- Looks like a reference, but probably isn't: '65' on line 2907 -- Looks like a reference, but probably isn't: '49' on line 2901 -- Looks like a reference, but probably isn't: '50' on line 2901 -- Looks like a reference, but probably isn't: '56' on line 2901 -- Looks like a reference, but probably isn't: '71' on line 2901 -- Looks like a reference, but probably isn't: '67' on line 2901 -- Looks like a reference, but probably isn't: '77' on line 2901 -- Looks like a reference, but probably isn't: '5' on line 2905 -- Looks like a reference, but probably isn't: '108' on line 2907 -- Looks like a reference, but probably isn't: '105' on line 2907 -- Looks like a reference, but probably isn't: '99' on line 2907 -- Looks like a reference, but probably isn't: '101' on line 2907 -- Looks like a reference, but probably isn't: '3' on line 2911 -- Looks like a reference, but probably isn't: '66' on line 2913 -- Looks like a reference, but probably isn't: '111' on line 2913 -- Looks like a reference, but probably isn't: '98' on line 2913 -- Looks like a reference, but probably isn't: '128' on line 2917 -- Possible downref: Non-RFC (?) normative reference: ref. 'AES' -- Possible downref: Non-RFC (?) normative reference: ref. 'Boneh99' -- 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 ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Downref: Normative reference to an Informational RFC: RFC 4949 ** Downref: Normative reference to an Informational RFC: RFC 6090 ** Obsolete normative reference: RFC 7159 (Obsoleted by RFC 8259) -- Possible downref: Non-RFC (?) normative reference: ref. 'SEC1' -- Possible downref: Non-RFC (?) normative reference: ref. 'SHS' == Outdated reference: A later version (-18) exists of draft-ietf-precis-saslprepbis-12 -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) Summary: 7 errors (**), 0 flaws (~~), 3 warnings (==), 28 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 December 9, 2014 5 Expires: June 12, 2015 7 JSON Web Algorithms (JWA) 8 draft-ietf-jose-json-web-algorithms-38 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 June 12, 2015. 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 . . . . . . . . . . . . 11 61 3.6. Using the Algorithm "none" . . . . . . . . . . . . . . . . 12 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 . . . . . . . . . . . . . . 15 67 4.5. Direct Encryption with a Shared Symmetric Key . . . . . . 16 68 4.6. Key Agreement with Elliptic Curve Diffie-Hellman 69 Ephemeral Static (ECDH-ES) . . . . . . . . . . . . . . . . 16 70 4.6.1. Header Parameters Used for ECDH Key Agreement . . . . 17 71 4.6.1.1. "epk" (Ephemeral Public Key) Header Parameter . . 17 72 4.6.1.2. "apu" (Agreement PartyUInfo) Header Parameter . . 17 73 4.6.1.3. "apv" (Agreement PartyVInfo) Header Parameter . . 17 74 4.6.2. Key Derivation for ECDH Key Agreement . . . . . . . . 18 75 4.7. Key Encryption with AES GCM . . . . . . . . . . . . . . . 19 76 4.7.1. Header Parameters Used for AES GCM Key Encryption . . 20 77 4.7.1.1. "iv" (Initialization Vector) Header Parameter . . 20 78 4.7.1.2. "tag" (Authentication Tag) Header Parameter . . . 20 79 4.8. Key Encryption with PBES2 . . . . . . . . . . . . . . . . 20 80 4.8.1. Header Parameters Used for PBES2 Key Encryption . . . 21 81 4.8.1.1. "p2s" (PBES2 salt input) Parameter . . . . . . . . 21 82 4.8.1.2. "p2c" (PBES2 count) Parameter . . . . . . . . . . 21 83 5. Cryptographic Algorithms for Content Encryption . . . . . . . 22 84 5.1. "enc" (Encryption Algorithm) Header Parameter Values 85 for JWE . . . . . . . . . . . . . . . . . . . . . . . . . 22 86 5.2. AES_CBC_HMAC_SHA2 Algorithms . . . . . . . . . . . . . . . 23 87 5.2.1. Conventions Used in Defining AES_CBC_HMAC_SHA2 . . . . 23 88 5.2.2. Generic AES_CBC_HMAC_SHA2 Algorithm . . . . . . . . . 23 89 5.2.2.1. AES_CBC_HMAC_SHA2 Encryption . . . . . . . . . . . 23 90 5.2.2.2. AES_CBC_HMAC_SHA2 Decryption . . . . . . . . . . . 25 91 5.2.3. AES_128_CBC_HMAC_SHA_256 . . . . . . . . . . . . . . . 25 92 5.2.4. AES_192_CBC_HMAC_SHA_384 . . . . . . . . . . . . . . . 26 93 5.2.5. AES_256_CBC_HMAC_SHA_512 . . . . . . . . . . . . . . . 26 94 5.2.6. Content Encryption with AES_CBC_HMAC_SHA2 . . . . . . 27 95 5.3. Content Encryption with AES GCM . . . . . . . . . . . . . 27 96 6. Cryptographic Algorithms for Keys . . . . . . . . . . . . . . 28 97 6.1. "kty" (Key Type) Parameter Values . . . . . . . . . . . . 28 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 . . . . . . . . . . . . . 29 101 6.2.1.2. "x" (X Coordinate) Parameter . . . . . . . . . . . 29 102 6.2.1.3. "y" (Y Coordinate) Parameter . . . . . . . . . . . 29 103 6.2.2. Parameters for Elliptic Curve Private Keys . . . . . . 30 104 6.2.2.1. "d" (ECC Private Key) Parameter . . . . . . . . . 30 105 6.3. Parameters for RSA Keys . . . . . . . . . . . . . . . . . 30 106 6.3.1. Parameters for RSA Public Keys . . . . . . . . . . . . 30 107 6.3.1.1. "n" (Modulus) Parameter . . . . . . . . . . . . . 30 108 6.3.1.2. "e" (Exponent) Parameter . . . . . . . . . . . . . 30 109 6.3.2. Parameters for RSA Private Keys . . . . . . . . . . . 31 110 6.3.2.1. "d" (Private Exponent) Parameter . . . . . . . . . 31 111 6.3.2.2. "p" (First Prime Factor) Parameter . . . . . . . . 31 112 6.3.2.3. "q" (Second Prime Factor) Parameter . . . . . . . 31 113 6.3.2.4. "dp" (First Factor CRT Exponent) Parameter . . . . 31 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 . . . . . . . 32 117 6.4. Parameters for Symmetric Keys . . . . . . . . . . . . . . 32 118 6.4.1. "k" (Key Value) Parameter . . . . . . . . . . . . . . 32 119 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 33 120 7.1. JSON Web Signature and Encryption Algorithms Registry . . 34 121 7.1.1. Registration Template . . . . . . . . . . . . . . . . 34 122 7.1.2. Initial Registry Contents . . . . . . . . . . . . . . 35 123 7.2. Header Parameter Names Registration . . . . . . . . . . . 41 124 7.2.1. Registry Contents . . . . . . . . . . . . . . . . . . 41 125 7.3. JSON Web Encryption Compression Algorithms Registry . . . 42 126 7.3.1. Registration Template . . . . . . . . . . . . . . . . 42 127 7.3.2. Initial Registry Contents . . . . . . . . . . . . . . 43 128 7.4. JSON Web Key Types Registry . . . . . . . . . . . . . . . 43 129 7.4.1. Registration Template . . . . . . . . . . . . . . . . 44 130 7.4.2. Initial Registry Contents . . . . . . . . . . . . . . 44 131 7.5. JSON Web Key Parameters Registration . . . . . . . . . . . 45 132 7.5.1. Registry Contents . . . . . . . . . . . . . . . . . . 45 133 7.6. JSON Web Key Elliptic Curve Registry . . . . . . . . . . . 47 134 7.6.1. Registration Template . . . . . . . . . . . . . . . . 47 135 7.6.2. Initial Registry Contents . . . . . . . . . . . . . . 48 136 8. Security Considerations . . . . . . . . . . . . . . . . . . . 49 137 8.1. Cryptographic Agility . . . . . . . . . . . . . . . . . . 49 138 8.2. Key Lifetimes . . . . . . . . . . . . . . . . . . . . . . 49 139 8.3. RSAES-PKCS1-v1_5 Security Considerations . . . . . . . . . 49 140 8.4. AES GCM Security Considerations . . . . . . . . . . . . . 49 141 8.5. Unsecured JWS Security Considerations . . . . . . . . . . 50 142 8.6. Denial of Service Attacks . . . . . . . . . . . . . . . . 50 143 8.7. Reusing Key Material when Encrypting Keys . . . . . . . . 51 144 8.8. Password Considerations . . . . . . . . . . . . . . . . . 51 145 8.9. Key Entropy and Random Values . . . . . . . . . . . . . . 52 146 8.10. Differences between Digital Signatures and MACs . . . . . 52 147 8.11. Using Matching Algorithm Strengths . . . . . . . . . . . . 52 148 8.12. Adaptive Chosen-Ciphertext Attacks . . . . . . . . . . . . 52 149 8.13. Timing Attacks . . . . . . . . . . . . . . . . . . . . . . 52 150 8.14. RSA Private Key Representations and Blinding . . . . . . . 52 151 9. Internationalization Considerations . . . . . . . . . . . . . 52 152 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 52 153 10.1. Normative References . . . . . . . . . . . . . . . . . . . 52 154 10.2. Informative References . . . . . . . . . . . . . . . . . . 54 155 Appendix A. Algorithm Identifier Cross-Reference . . . . . . . . 56 156 A.1. Digital Signature/MAC Algorithm Identifier 157 Cross-Reference . . . . . . . . . . . . . . . . . . . . . 57 158 A.2. Key Management Algorithm Identifier Cross-Reference . . . 57 159 A.3. Content Encryption Algorithm Identifier Cross-Reference . 58 160 Appendix B. Test Cases for AES_CBC_HMAC_SHA2 Algorithms . . . . . 59 161 B.1. Test Cases for AES_128_CBC_HMAC_SHA_256 . . . . . . . . . 60 162 B.2. Test Cases for AES_192_CBC_HMAC_SHA_384 . . . . . . . . . 61 163 B.3. Test Cases for AES_256_CBC_HMAC_SHA_512 . . . . . . . . . 62 164 Appendix C. Example ECDH-ES Key Agreement Computation . . . . . . 63 165 Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 65 166 Appendix E. Document History . . . . . . . . . . . . . . . . . . 66 167 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 77 169 1. Introduction 171 The JSON Web Algorithms (JWA) specification registers cryptographic 172 algorithms and identifiers to be used with the JSON Web Signature 173 (JWS) [JWS], JSON Web Encryption (JWE) [JWE], and JSON Web Key (JWK) 174 [JWK] specifications. It defines several IANA registries for these 175 identifiers. All these specifications utilize JavaScript Object 176 Notation (JSON) [RFC7159] based data structures. This specification 177 also describes the semantics and operations that are specific to 178 these algorithms and key types. 180 Registering the algorithms and identifiers here, rather than in the 181 JWS, JWE, and JWK specifications, is intended to allow them to remain 182 unchanged in the face of changes in the set of Required, Recommended, 183 Optional, and Deprecated algorithms over time. This also allows 184 changes to the JWS, JWE, and JWK specifications without changing this 185 document. 187 Names defined by this specification are short because a core goal is 188 for the resulting representations to be compact. 190 1.1. Notational Conventions 192 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 193 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 194 "OPTIONAL" in this document are to be interpreted as described in Key 195 words for use in RFCs to Indicate Requirement Levels [RFC2119]. If 196 these words are used without being spelled in uppercase then they are 197 to be interpreted with their normal natural language meanings. 199 BASE64URL(OCTETS) denotes the base64url encoding of OCTETS, per 200 Section 2 of [JWS]. 202 UTF8(STRING) denotes the octets of the UTF-8 [RFC3629] representation 203 of STRING. 205 ASCII(STRING) denotes the octets of the ASCII [RFC20] representation 206 of STRING. 208 The concatenation of two values A and B is denoted as A || B. 210 2. Terminology 212 These terms defined by the JSON Web Signature (JWS) [JWS] 213 specification are incorporated into this specification: "JSON Web 214 Signature (JWS)", "Base64url Encoding", "Header Parameter", "JOSE 215 Header", "JWS Payload", "JWS Protected Header", "JWS Signature", "JWS 216 Signing Input", and "Unsecured JWS". 218 These terms defined by the JSON Web Encryption (JWE) [JWE] 219 specification are incorporated into this specification: "JSON Web 220 Encryption (JWE)", "Additional Authenticated Data (AAD)", 221 "Authentication Tag", "Content Encryption Key (CEK)", "Direct 222 Encryption", "Direct Key Agreement", "JWE Authentication Tag", "JWE 223 Ciphertext", "JWE Encrypted Key", "JWE Initialization Vector", "JWE 224 Protected Header", "Key Agreement with Key Wrapping", "Key 225 Encryption", "Key Management Mode", and "Key Wrapping". 227 These terms defined by the JSON Web Key (JWK) [JWK] specification are 228 incorporated into this specification: "JSON Web Key (JWK)" and "JSON 229 Web Key Set (JWK Set)". 231 These terms defined by the Internet Security Glossary, Version 2 232 [RFC4949] are incorporated into this specification: "Ciphertext", 233 "Digital Signature", "Message Authentication Code (MAC)", and 234 "Plaintext". 236 This term is defined by this specification: 238 Base64urlUInt 239 The representation of a positive or zero integer value as the 240 base64url encoding of the value's unsigned big endian 241 representation as an octet sequence. The octet sequence MUST 242 utilize the minimum number of octets needed to represent the 243 value. Zero is represented as BASE64URL(single zero-valued 244 octet), which is "AA". 246 3. Cryptographic Algorithms for Digital Signatures and MACs 248 JWS uses cryptographic algorithms to digitally sign or create a 249 Message Authentication Code (MAC) of the contents of the JWS 250 Protected Header and the JWS Payload. 252 3.1. "alg" (Algorithm) Header Parameter Values for JWS 254 The table below is the set of "alg" (algorithm) header parameter 255 values defined by this specification for use with JWS, each of which 256 is explained in more detail in the following sections: 258 +--------------+-----------------------------------+----------------+ 259 | alg Param | Digital Signature or MAC | Implementation | 260 | Value | Algorithm | Requirements | 261 +--------------+-----------------------------------+----------------+ 262 | HS256 | HMAC using SHA-256 | Required | 263 | HS384 | HMAC using SHA-384 | Optional | 264 | HS512 | HMAC using SHA-512 | Optional | 265 | RS256 | RSASSA-PKCS-v1_5 using SHA-256 | Recommended | 266 | RS384 | RSASSA-PKCS-v1_5 using SHA-384 | Optional | 267 | RS512 | RSASSA-PKCS-v1_5 using SHA-512 | Optional | 268 | ES256 | ECDSA using P-256 and SHA-256 | Recommended+ | 269 | ES384 | ECDSA using P-384 and SHA-384 | Optional | 270 | ES512 | ECDSA using P-521 and SHA-512 | Optional | 271 | PS256 | RSASSA-PSS using SHA-256 and MGF1 | Optional | 272 | | with SHA-256 | | 273 | PS384 | RSASSA-PSS using SHA-384 and MGF1 | Optional | 274 | | with SHA-384 | | 275 | PS512 | RSASSA-PSS using SHA-512 and MGF1 | Optional | 276 | | with SHA-512 | | 277 | none | No digital signature or MAC | Optional | 278 | | performed | | 279 +--------------+-----------------------------------+----------------+ 281 The use of "+" in the Implementation Requirements indicates that the 282 requirement strength is likely to be increased in a future version of 283 the specification. 285 See Appendix A.1 for a table cross-referencing the JWS digital 286 signature and MAC "alg" (algorithm) values defined in this 287 specification with the equivalent identifiers used by other standards 288 and software packages. 290 3.2. HMAC with SHA-2 Functions 292 Hash-based Message Authentication Codes (HMACs) enable one to use a 293 secret plus a cryptographic hash function to generate a Message 294 Authentication Code (MAC). This can be used to demonstrate that 295 whoever generated the MAC was in possession of the MAC key. The 296 algorithm for implementing and validating HMACs is provided in RFC 297 2104 [RFC2104]. 299 A key of the same size as the hash output (for instance, 256 bits for 300 "HS256") or larger MUST be used with this algorithm. (This 301 requirement is based on Section 5.3.4 (Security Effect of the HMAC 302 Key) of NIST SP 800-117 [NIST.800-107], which states that the 303 effective security strength is the minimum of the security strength 304 of the key and two times the size of the internal hash value.) 305 The HMAC SHA-256 MAC is generated per RFC 2104, using SHA-256 as the 306 hash algorithm "H", using the JWS Signing Input as the "text" value, 307 and using the shared key. The HMAC output value is the JWS 308 Signature. 310 The following "alg" (algorithm) Header Parameter values are used to 311 indicate that the JWS Signature is an HMAC value computed using the 312 corresponding algorithm: 314 +-----------------+--------------------+ 315 | alg Param Value | MAC Algorithm | 316 +-----------------+--------------------+ 317 | HS256 | HMAC using SHA-256 | 318 | HS384 | HMAC using SHA-384 | 319 | HS512 | HMAC using SHA-512 | 320 +-----------------+--------------------+ 322 The HMAC SHA-256 MAC for a JWS is validated by computing an HMAC 323 value per RFC 2104, using SHA-256 as the hash algorithm "H", using 324 the received JWS Signing Input as the "text" value, and using the 325 shared key. This computed HMAC value is then compared to the result 326 of base64url decoding the received encoded JWS Signature value. The 327 comparison of the computed HMAC value to the JWS Signature value MUST 328 be done in a constant-time manner to thwart timing attacks. 329 Alternatively, the computed HMAC value can be base64url encoded and 330 compared to the received encoded JWS Signature value (also in a 331 constant-time manner), as this comparison produces the same result as 332 comparing the unencoded values. In either case, if the values match, 333 the HMAC has been validated. 335 Securing content and validation with the HMAC SHA-384 and HMAC SHA- 336 512 algorithms is performed identically to the procedure for HMAC 337 SHA-256 -- just using the corresponding hash algorithms with 338 correspondingly larger minimum key sizes and result values: 384 bits 339 each for HMAC SHA-384 and 512 bits each for HMAC SHA-512. 341 An example using this algorithm is shown in Appendix A.1 of [JWS]. 343 3.3. Digital Signature with RSASSA-PKCS1-V1_5 345 This section defines the use of the RSASSA-PKCS1-V1_5 digital 346 signature algorithm as defined in Section 8.2 of RFC 3447 [RFC3447] 347 (commonly known as PKCS #1), using SHA-2 [SHS] hash functions. 349 A key of size 2048 bits or larger MUST be used with these algorithms. 351 The RSASSA-PKCS1-V1_5 SHA-256 digital signature is generated as 352 follows: Generate a digital signature of the JWS Signing Input using 353 RSASSA-PKCS1-V1_5-SIGN and the SHA-256 hash function with the desired 354 private key. This is the JWS Signature value. 356 The following "alg" (algorithm) Header Parameter values are used to 357 indicate that the JWS Signature is a digital signature value computed 358 using the corresponding algorithm: 360 +-----------------+--------------------------------+ 361 | alg Param Value | Digital Signature Algorithm | 362 +-----------------+--------------------------------+ 363 | RS256 | RSASSA-PKCS-v1_5 using SHA-256 | 364 | RS384 | RSASSA-PKCS-v1_5 using SHA-384 | 365 | RS512 | RSASSA-PKCS-v1_5 using SHA-512 | 366 +-----------------+--------------------------------+ 368 The RSASSA-PKCS1-V1_5 SHA-256 digital signature for a JWS is 369 validated as follows: Submit the JWS Signing Input, the JWS 370 Signature, and the public key corresponding to the private key used 371 by the signer to the RSASSA-PKCS1-V1_5-VERIFY algorithm using SHA-256 372 as the hash function. 374 Signing and validation with the RSASSA-PKCS1-V1_5 SHA-384 and RSASSA- 375 PKCS1-V1_5 SHA-512 algorithms is performed identically to the 376 procedure for RSASSA-PKCS1-V1_5 SHA-256 -- just using the 377 corresponding hash algorithms instead of SHA-256. 379 An example using this algorithm is shown in Appendix A.2 of [JWS]. 381 3.4. Digital Signature with ECDSA 383 The Elliptic Curve Digital Signature Algorithm (ECDSA) [DSS] provides 384 for the use of Elliptic Curve cryptography, which is able to provide 385 equivalent security to RSA cryptography but using shorter key sizes 386 and with greater processing speed for many operations. This means 387 that ECDSA digital signatures will be substantially smaller in terms 388 of length than equivalently strong RSA digital signatures. 390 This specification defines the use of ECDSA with the P-256 curve and 391 the SHA-256 cryptographic hash function, ECDSA with the P-384 curve 392 and the SHA-384 hash function, and ECDSA with the P-521 curve and the 393 SHA-512 hash function. The P-256, P-384, and P-521 curves are 394 defined in [DSS]. 396 The ECDSA P-256 SHA-256 digital signature is generated as follows: 398 1. Generate a digital signature of the JWS Signing Input using ECDSA 399 P-256 SHA-256 with the desired private key. The output will be 400 the pair (R, S), where R and S are 256 bit unsigned integers. 402 2. Turn R and S into octet sequences in big endian order, with each 403 array being be 32 octets long. The octet sequence 404 representations MUST NOT be shortened to omit any leading zero 405 octets contained in the values. 407 3. Concatenate the two octet sequences in the order R and then S. 408 (Note that many ECDSA implementations will directly produce this 409 concatenation as their output.) 411 4. The resulting 64 octet sequence is the JWS Signature value. 413 The following "alg" (algorithm) Header Parameter values are used to 414 indicate that the JWS Signature is a digital signature value computed 415 using the corresponding algorithm: 417 +-----------------+-------------------------------+ 418 | alg Param Value | Digital Signature Algorithm | 419 +-----------------+-------------------------------+ 420 | ES256 | ECDSA using P-256 and SHA-256 | 421 | ES384 | ECDSA using P-384 and SHA-384 | 422 | ES512 | ECDSA using P-521 and SHA-512 | 423 +-----------------+-------------------------------+ 425 The ECDSA P-256 SHA-256 digital signature for a JWS is validated as 426 follows: 428 1. The JWS Signature value MUST be a 64 octet sequence. If it is 429 not a 64 octet sequence, the validation has failed. 431 2. Split the 64 octet sequence into two 32 octet sequences. The 432 first octet sequence represents R and the second S. The values R 433 and S are represented as octet sequences using the Integer-to- 434 OctetString Conversion defined in Section 2.3.7 of SEC1 [SEC1] 435 (in big endian octet order). 437 3. Submit the JWS Signing Input R, S and the public key (x, y) to 438 the ECDSA P-256 SHA-256 validator. 440 Signing and validation with the ECDSA P-384 SHA-384 and ECDSA P-521 441 SHA-512 algorithms is performed identically to the procedure for 442 ECDSA P-256 SHA-256 -- just using the corresponding hash algorithms 443 with correspondingly larger result values. For ECDSA P-384 SHA-384, 444 R and S will be 384 bits each, resulting in a 96 octet sequence. For 445 ECDSA P-521 SHA-512, R and S will be 521 bits each, resulting in a 446 132 octet sequence. (Note that the Integer-to-OctetString Conversion 447 defined in Section 2.3.7 of SEC1 [SEC1] used to represent R and S as 448 octet sequences adds zero-valued high-order padding bits when needed 449 to round the size up to a multiple of 8 bits; thus, each 521-bit 450 integer is represented using 528 bits in 66 octets.) 452 Examples using these algorithms are shown in Appendices A.3 and A.4 453 of [JWS]. 455 3.5. Digital Signature with RSASSA-PSS 457 This section defines the use of the RSASSA-PSS digital signature 458 algorithm as defined in Section 8.1 of RFC 3447 [RFC3447] with the 459 MGF1 mask generation function and SHA-2 hash functions, always using 460 the same hash function for both the RSASSA-PSS hash function and the 461 MGF1 hash function. The size of the salt value is the same size as 462 the hash function output. All other algorithm parameters use the 463 defaults specified in Section A.2.3 of RFC 3447. 465 A key of size 2048 bits or larger MUST be used with this algorithm. 467 The RSASSA-PSS SHA-256 digital signature is generated as follows: 468 Generate a digital signature of the JWS Signing Input using RSASSA- 469 PSS-SIGN, the SHA-256 hash function, and the MGF1 mask generation 470 function with SHA-256 with the desired private key. This is the JWS 471 signature value. 473 The following "alg" (algorithm) Header Parameter values are used to 474 indicate that the JWS Signature is a digital signature value computed 475 using the corresponding algorithm: 477 +-----------------+------------------------------------------------+ 478 | alg Param Value | Digital Signature Algorithm | 479 +-----------------+------------------------------------------------+ 480 | PS256 | RSASSA-PSS using SHA-256 and MGF1 with SHA-256 | 481 | PS384 | RSASSA-PSS using SHA-384 and MGF1 with SHA-384 | 482 | PS512 | RSASSA-PSS using SHA-512 and MGF1 with SHA-512 | 483 +-----------------+------------------------------------------------+ 485 The RSASSA-PSS SHA-256 digital signature for a JWS is validated as 486 follows: Submit the JWS Signing Input, the JWS Signature, and the 487 public key corresponding to the private key used by the signer to the 488 RSASSA-PSS-VERIFY algorithm using SHA-256 as the hash function and 489 using MGF1 as the mask generation function with SHA-256. 491 Signing and validation with the RSASSA-PSS SHA-384 and RSASSA-PSS 492 SHA-512 algorithms is performed identically to the procedure for 493 RSASSA-PSS SHA-256 -- just using the alternative hash algorithm in 494 both roles. 496 3.6. Using the Algorithm "none" 498 JWSs MAY also be created that do not provide integrity protection. 499 Such a JWS is called an Unsecured JWS. An Unsecured JWS uses the 500 "alg" value "none" and is formatted identically to other JWSs, but 501 MUST use the empty octet sequence as its JWS Signature value. 502 Recipients MUST verify that the JWS Signature value is the empty 503 octet sequence. 505 Implementations that support Unsecured JWSs MUST NOT accept such 506 objects as valid unless the application specifies that it is 507 acceptable for a specific object to not be integrity protected. 508 Implementations MUST NOT accept Unsecured JWSs by default. In order 509 to mitigate downgrade attacks, applications MUST NOT signal 510 acceptance of Unsecured JWSs at a global level, and SHOULD signal 511 acceptance on a per-object basis. See Section 8.5 for security 512 considerations associated with using this algorithm. 514 4. Cryptographic Algorithms for Key Management 516 JWE uses cryptographic algorithms to encrypt or determine the Content 517 Encryption Key (CEK). 519 4.1. "alg" (Algorithm) Header Parameter Values for JWE 521 The table below is the set of "alg" (algorithm) Header Parameter 522 values that are defined by this specification for use with JWE. 523 These algorithms are used to encrypt the CEK, producing the JWE 524 Encrypted Key, or to use key agreement to agree upon the CEK. 526 +--------------------+--------------------+--------+----------------+ 527 | alg Param Value | Key Management | More | Implementation | 528 | | Algorithm | Header | Requirements | 529 | | | Params | | 530 +--------------------+--------------------+--------+----------------+ 531 | RSA1_5 | RSAES-PKCS1-V1_5 | (none) | Recommended- | 532 | RSA-OAEP | RSAES OAEP using | (none) | Recommended+ | 533 | | default parameters | | | 534 | RSA-OAEP-256 | RSAES OAEP using | (none) | Optional | 535 | | SHA-256 and MGF1 | | | 536 | | with SHA-256 | | | 537 | A128KW | AES Key Wrap with | (none) | Recommended | 538 | | default initial | | | 539 | | value using 128 | | | 540 | | bit key | | | 541 | A192KW | AES Key Wrap with | (none) | Optional | 542 | | default initial | | | 543 | | value using 192 | | | 544 | | bit key | | | 545 | A256KW | AES Key Wrap with | (none) | Recommended | 546 | | default initial | | | 547 | | value using 256 | | | 548 | | bit key | | | 549 | dir | Direct use of a | (none) | Recommended | 550 | | shared symmetric | | | 551 | | key as the CEK | | | 552 | ECDH-ES | Elliptic Curve | "epk", | Recommended+ | 553 | | Diffie-Hellman | "apu", | | 554 | | Ephemeral Static | "apv" | | 555 | | key agreement | | | 556 | | using Concat KDF | | | 557 | ECDH-ES+A128KW | ECDH-ES using | "epk", | Recommended | 558 | | Concat KDF and CEK | "apu", | | 559 | | wrapped with | "apv" | | 560 | | "A128KW" | | | 561 | ECDH-ES+A192KW | ECDH-ES using | "epk", | Optional | 562 | | Concat KDF and CEK | "apu", | | 563 | | wrapped with | "apv" | | 564 | | "A192KW" | | | 565 | ECDH-ES+A256KW | ECDH-ES using | "epk", | Recommended | 566 | | Concat KDF and CEK | "apu", | | 567 | | wrapped with | "apv" | | 568 | | "A256KW" | | | 569 | A128GCMKW | Key wrapping with | "iv", | Optional | 570 | | AES GCM using 128 | "tag" | | 571 | | bit key | | | 572 | A192GCMKW | Key wrapping with | "iv", | Optional | 573 | | AES GCM using 192 | "tag" | | 574 | | bit key | | | 575 | A256GCMKW | Key wrapping with | "iv", | Optional | 576 | | AES GCM using 256 | "tag" | | 577 | | bit key | | | 578 | PBES2-HS256+A128KW | PBES2 with HMAC | "p2s", | Optional | 579 | | SHA-256 and | "p2c" | | 580 | | "A128KW" wrapping | | | 581 | PBES2-HS384+A192KW | PBES2 with HMAC | "p2s", | Optional | 582 | | SHA-384 and | "p2c" | | 583 | | "A192KW" wrapping | | | 584 | PBES2-HS512+A256KW | PBES2 with HMAC | "p2s", | Optional | 585 | | SHA-512 and | "p2c" | | 586 | | "A256KW" wrapping | | | 587 +--------------------+--------------------+--------+----------------+ 589 The More Header Params column indicates what additional Header 590 Parameters are used by the algorithm, beyond "alg", which all use. 591 All but "dir" and "ECDH-ES" also produce a JWE Encrypted Key value. 593 The use of "+" in the Implementation Requirements indicates that the 594 requirement strength is likely to be increased in a future version of 595 the specification. 597 See Appendix A.2 for a table cross-referencing the JWE "alg" 598 (algorithm) values defined in this specification with the equivalent 599 identifiers used by other standards and software packages. 601 4.2. Key Encryption with RSAES-PKCS1-V1_5 603 This section defines the specifics of encrypting a JWE CEK with 604 RSAES-PKCS1-V1_5 [RFC3447]. The "alg" Header Parameter value 605 "RSA1_5" is used for this algorithm. 607 A key of size 2048 bits or larger MUST be used with this algorithm. 609 An example using this algorithm is shown in Appendix A.2 of [JWE]. 611 4.3. Key Encryption with RSAES OAEP 613 This section defines the specifics of encrypting a JWE CEK with RSAES 614 using Optimal Asymmetric Encryption Padding (OAEP) [RFC3447]. Two 615 sets of parameters for using OAEP are defined, which use different 616 hash functions. In the first case, the default parameters specified 617 by RFC 3447 in Section A.2.1 are used. (Those default parameters are 618 the SHA-1 hash function and the MGF1 with SHA-1 mask generation 619 function.) In the second case, the SHA-256 hash function and the 620 MGF1 with SHA-256 mask generation function are used. 622 The following "alg" (algorithm) Header Parameter values are used to 623 indicate that the JWE Encrypted Key is the result of encrypting the 624 CEK using the corresponding algorithm: 626 +-----------------+------------------------------------------------+ 627 | alg Param Value | Key Management Algorithm | 628 +-----------------+------------------------------------------------+ 629 | RSA-OAEP | RSAES OAEP using default parameters | 630 | RSA-OAEP-256 | RSAES OAEP using SHA-256 and MGF1 with SHA-256 | 631 +-----------------+------------------------------------------------+ 633 A key of size 2048 bits or larger MUST be used with these algorithms. 634 (This requirement is based on Table 4 (Security-strength time frames) 635 of NIST SP 800-57 [NIST.800-57], which requires 112 bits of security 636 for new uses, and Table 2 (Comparable strengths) of the same, which 637 states that 2048 bit RSA keys provide 112 bits of security.) 639 An example using RSAES OAEP with the default parameters is shown in 640 Appendix A.1 of [JWE]. 642 4.4. Key Wrapping with AES Key Wrap 644 This section defines the specifics of encrypting a JWE CEK with the 645 Advanced Encryption Standard (AES) Key Wrap Algorithm [RFC3394] using 646 the default initial value specified in Section 2.2.3.1. 648 The following "alg" (algorithm) Header Parameter values are used to 649 indicate that the JWE Encrypted Key is the result of encrypting the 650 CEK using the corresponding algorithm and key size: 652 +---------------+---------------------------------------------------+ 653 | alg Param | Key Management Algorithm | 654 | Value | | 655 +---------------+---------------------------------------------------+ 656 | A128KW | AES Key Wrap with default initial value using 128 | 657 | | bit key | 658 | A192KW | AES Key Wrap with default initial value using 192 | 659 | | bit key | 660 | A256KW | AES Key Wrap with default initial value using 256 | 661 | | bit key | 662 +---------------+---------------------------------------------------+ 664 An example using this algorithm is shown in Appendix A.3 of [JWE]. 666 4.5. Direct Encryption with a Shared Symmetric Key 668 This section defines the specifics of directly performing symmetric 669 key encryption without performing a key wrapping step. In this case, 670 the shared symmetric key is used directly as the Content Encryption 671 Key (CEK) value for the "enc" algorithm. An empty octet sequence is 672 used as the JWE Encrypted Key value. The "alg" Header Parameter 673 value "dir" is used in this case. 675 Refer to the security considerations on key lifetimes in Section 8.2 676 and AES GCM in Section 8.4 when considering utilizing direct 677 encryption. 679 4.6. Key Agreement with Elliptic Curve Diffie-Hellman Ephemeral Static 680 (ECDH-ES) 682 This section defines the specifics of key agreement with Elliptic 683 Curve Diffie-Hellman Ephemeral Static [RFC6090], in combination with 684 the Concat KDF, as defined in Section 5.8.1 of [NIST.800-56A]. The 685 key agreement result can be used in one of two ways: 687 1. directly as the Content Encryption Key (CEK) for the "enc" 688 algorithm, in the Direct Key Agreement mode, or 690 2. as a symmetric key used to wrap the CEK with the "A128KW", 691 "A192KW", or "A256KW" algorithms, in the Key Agreement with Key 692 Wrapping mode. 694 A new ephemeral public key value MUST be generated for each key 695 agreement operation. 697 In Direct Key Agreement mode, the output of the Concat KDF MUST be a 698 key of the same length as that used by the "enc" algorithm. In this 699 case, the empty octet sequence is used as the JWE Encrypted Key 700 value. The "alg" Header Parameter value "ECDH-ES" is used in the 701 Direct Key Agreement mode. 703 In Key Agreement with Key Wrapping mode, the output of the Concat KDF 704 MUST be a key of the length needed for the specified key wrapping 705 algorithm. In this case, the JWE Encrypted Key is the CEK wrapped 706 with the agreed upon key. 708 The following "alg" (algorithm) Header Parameter values are used to 709 indicate that the JWE Encrypted Key is the result of encrypting the 710 CEK using the result of the key agreement algorithm as the key 711 encryption key for the corresponding key wrapping algorithm: 713 +----------------+--------------------------------------------------+ 714 | alg Param | Key Management Algorithm | 715 | Value | | 716 +----------------+--------------------------------------------------+ 717 | ECDH-ES+A128KW | ECDH-ES using Concat KDF and CEK wrapped with | 718 | | "A128KW" | 719 | ECDH-ES+A192KW | ECDH-ES using Concat KDF and CEK wrapped with | 720 | | "A192KW" | 721 | ECDH-ES+A256KW | ECDH-ES using Concat KDF and CEK wrapped with | 722 | | "A256KW" | 723 +----------------+--------------------------------------------------+ 725 4.6.1. Header Parameters Used for ECDH Key Agreement 727 The following Header Parameter names are used for key agreement as 728 defined below. 730 4.6.1.1. "epk" (Ephemeral Public Key) Header Parameter 732 The "epk" (ephemeral public key) value created by the originator for 733 the use in key agreement algorithms. This key is represented as a 734 JSON Web Key [JWK] public key value. It MUST contain only public key 735 parameters and SHOULD contain only the minimum JWK parameters 736 necessary to represent the key; other JWK parameters included can be 737 checked for consistency and honored or can be ignored. This Header 738 Parameter MUST be present and MUST be understood and processed by 739 implementations when these algorithms are used. 741 4.6.1.2. "apu" (Agreement PartyUInfo) Header Parameter 743 The "apu" (agreement PartyUInfo) value for key agreement algorithms 744 using it (such as "ECDH-ES"), represented as a base64url encoded 745 string. When used, the PartyUInfo value contains information about 746 the producer. Use of this Header Parameter is OPTIONAL. This Header 747 Parameter MUST be understood and processed by implementations when 748 these algorithms are used. 750 4.6.1.3. "apv" (Agreement PartyVInfo) Header Parameter 752 The "apv" (agreement PartyVInfo) value for key agreement algorithms 753 using it (such as "ECDH-ES"), represented as a base64url encoded 754 string. When used, the PartyVInfo value contains information about 755 the recipient. Use of this Header Parameter is OPTIONAL. This 756 Header Parameter MUST be understood and processed by implementations 757 when these algorithms are used. 759 4.6.2. Key Derivation for ECDH Key Agreement 761 The key derivation process derives the agreed upon key from the 762 shared secret Z established through the ECDH algorithm, per Section 763 6.2.2.2 of [NIST.800-56A]. 765 Key derivation is performed using the Concat KDF, as defined in 766 Section 5.8.1 of [NIST.800-56A], where the Digest Method is SHA-256. 767 The Concat KDF parameters are set as follows: 769 Z 770 This is set to the representation of the shared secret Z as an 771 octet sequence. 773 keydatalen 774 This is set to the number of bits in the desired output key. For 775 "ECDH-ES", this is length of the key used by the "enc" algorithm. 776 For "ECDH-ES+A128KW", "ECDH-ES+A192KW", and "ECDH-ES+A256KW", this 777 is 128, 192, and 256, respectively. 779 AlgorithmID 780 The AlgorithmID value is of the form Datalen || Data, where Data 781 is a variable-length string of zero or more octets, and Datalen is 782 a fixed-length, big endian 32 bit counter that indicates the 783 length (in octets) of Data. In the Direct Key Agreement case, 784 Data is set to the octets of the ASCII representation of the "enc" 785 Header Parameter value. In the Key Agreement with Key Wrapping 786 case, Data is set to the octets of the ASCII representation of the 787 "alg" Header Parameter value. 789 PartyUInfo 790 The PartyUInfo value is of the form Datalen || Data, where Data is 791 a variable-length string of zero or more octets, and Datalen is a 792 fixed-length, big endian 32 bit counter that indicates the length 793 (in octets) of Data. If an "apu" (agreement PartyUInfo) Header 794 Parameter is present, Data is set to the result of base64url 795 decoding the "apu" value and Datalen is set to the number of 796 octets in Data. Otherwise, Datalen is set to 0 and Data is set to 797 the empty octet sequence. 799 PartyVInfo 800 The PartyVInfo value is of the form Datalen || Data, where Data is 801 a variable-length string of zero or more octets, and Datalen is a 802 fixed-length, big endian 32 bit counter that indicates the length 803 (in octets) of Data. If an "apv" (agreement PartyVInfo) Header 804 Parameter is present, Data is set to the result of base64url 805 decoding the "apv" value and Datalen is set to the number of 806 octets in Data. Otherwise, Datalen is set to 0 and Data is set to 807 the empty octet sequence. 809 SuppPubInfo 810 This is set to the keydatalen represented as a 32 bit big endian 811 integer. 813 SuppPrivInfo 814 This is set to the empty octet sequence. 816 Applications need to specify how the "apu" and "apv" parameters are 817 used for that application. The "apu" and "apv" values MUST be 818 distinct, when used. Applications wishing to conform to 819 [NIST.800-56A] need to provide values that meet the requirements of 820 that document, e.g., by using values that identify the producer and 821 consumer. Alternatively, applications MAY conduct key derivation in 822 a manner similar to The Diffie-Hellman Key Agreement Method 823 [RFC2631]: In that case, the "apu" field MAY either be omitted or 824 represent a random 512-bit value (analogous to PartyAInfo in 825 Ephemeral-Static mode in RFC 2631) and the "apv" field SHOULD NOT be 826 present. 828 See Appendix C for an example key agreement computation using this 829 method. 831 4.7. Key Encryption with AES GCM 833 This section defines the specifics of encrypting a JWE Content 834 Encryption Key (CEK) with Advanced Encryption Standard (AES) in 835 Galois/Counter Mode (GCM) [AES, NIST.800-38D]. 837 Use of an Initialization Vector of size 96 bits is REQUIRED with this 838 algorithm. The Initialization Vector is represented in base64url 839 encoded form as the "iv" (initialization vector) Header Parameter 840 value. 842 The Additional Authenticated Data value used is the empty octet 843 string. 845 The requested size of the Authentication Tag output MUST be 128 bits, 846 regardless of the key size. 848 The JWE Encrypted Key value is the Ciphertext output. 850 The Authentication Tag output is represented in base64url encoded 851 form as the "tag" (authentication tag) Header Parameter value. 853 The following "alg" (algorithm) Header Parameter values are used to 854 indicate that the JWE Encrypted Key is the result of encrypting the 855 CEK using the corresponding algorithm and key size: 857 +-----------------+---------------------------------------------+ 858 | alg Param Value | Key Management Algorithm | 859 +-----------------+---------------------------------------------+ 860 | A128GCMKW | Key wrapping with AES GCM using 128 bit key | 861 | A192GCMKW | Key wrapping with AES GCM using 192 bit key | 862 | A256GCMKW | Key wrapping with AES GCM using 256 bit key | 863 +-----------------+---------------------------------------------+ 865 4.7.1. Header Parameters Used for AES GCM Key Encryption 867 The following Header Parameters are used for AES GCM key encryption. 869 4.7.1.1. "iv" (Initialization Vector) Header Parameter 871 The "iv" (initialization vector) Header Parameter value is the 872 base64url encoded representation of the 96 bit Initialization Vector 873 value used for the key encryption operation. This Header Parameter 874 MUST be present and MUST be understood and processed by 875 implementations when these algorithms are used. 877 4.7.1.2. "tag" (Authentication Tag) Header Parameter 879 The "tag" (authentication tag) Header Parameter value is the 880 base64url encoded representation of the 128 bit Authentication Tag 881 value resulting from the key encryption operation. This Header 882 Parameter MUST be present and MUST be understood and processed by 883 implementations when these algorithms are used. 885 4.8. Key Encryption with PBES2 887 This section defines the specifics of performing password-based 888 encryption of a JWE CEK, by first deriving a key encryption key from 889 a user-supplied password using PBES2 schemes as specified in Section 890 6.2 of [RFC2898], then by encrypting the JWE CEK using the derived 891 key. 893 These algorithms use HMAC SHA-2 algorithms as the Pseudo-Random 894 Function (PRF) for the PBKDF2 key derivation and AES Key Wrap 895 [RFC3394] for the encryption scheme. The PBES2 password input is an 896 octet sequence; if the password to be used is represented as a text 897 string rather than an octet sequence, the UTF-8 encoding of the text 898 string MUST be used as the octet sequence. The salt parameter MUST 899 be computed from the "p2s" (PBES2 salt input) Header Parameter value 900 and the "alg" (algorithm) Header Parameter value as specified in the 901 "p2s" definition below. The iteration count parameter MUST be 902 provided as the "p2c" Header Parameter value. The algorithms 903 respectively use HMAC SHA-256, HMAC SHA-384, and HMAC SHA-512 as the 904 PRF and use 128, 192, and 256 bit AES Key Wrap keys. Their derived- 905 key lengths respectively are 16, 24, and 32 octets. 907 The following "alg" (algorithm) Header Parameter values are used to 908 indicate that the JWE Encrypted Key is the result of encrypting the 909 CEK using the result of the corresponding password-based encryption 910 algorithm as the key encryption key for the corresponding key 911 wrapping algorithm: 913 +--------------------+----------------------------------------------+ 914 | alg Param Value | Key Management Algorithm | 915 +--------------------+----------------------------------------------+ 916 | PBES2-HS256+A128KW | PBES2 with HMAC SHA-256 and "A128KW" | 917 | | wrapping | 918 | PBES2-HS384+A192KW | PBES2 with HMAC SHA-384 and "A192KW" | 919 | | wrapping | 920 | PBES2-HS512+A256KW | PBES2 with HMAC SHA-512 and "A256KW" | 921 | | wrapping | 922 +--------------------+----------------------------------------------+ 924 See Appendix C of JSON Web Key (JWK) [JWK] for an example key 925 encryption computation using "PBES2-HS256+A128KW". 927 4.8.1. Header Parameters Used for PBES2 Key Encryption 929 The following Header Parameters are used for Key Encryption with 930 PBES2. 932 4.8.1.1. "p2s" (PBES2 salt input) Parameter 934 The "p2s" (PBES2 salt input) Header Parameter encodes a Salt Input 935 value, which is used as part of the PBKDF2 salt value. The "p2s" 936 value is BASE64URL(Salt Input). This Header Parameter MUST be 937 present and MUST be understood and processed by implementations when 938 these algorithms are used. 940 The salt expands the possible keys that can be derived from a given 941 password. A Salt Input value containing 8 or more octets MUST be 942 used. A new Salt Input value MUST be generated randomly for every 943 encryption operation; see RFC 4086 [RFC4086] for considerations on 944 generating random values. The salt value used is (UTF8(Alg) || 0x00 945 || Salt Input), where Alg is the "alg" Header Parameter value. 947 4.8.1.2. "p2c" (PBES2 count) Parameter 949 The "p2c" (PBES2 count) Header Parameter contains the PBKDF2 950 iteration count, represented as a positive JSON integer. This Header 951 Parameter MUST be present and MUST be understood and processed by 952 implementations when these algorithms are used. 954 The iteration count adds computational expense, ideally compounded by 955 the possible range of keys introduced by the salt. A minimum 956 iteration count of 1000 is RECOMMENDED. 958 5. Cryptographic Algorithms for Content Encryption 960 JWE uses cryptographic algorithms to encrypt and integrity protect 961 the Plaintext and to also integrity protect additional authenticated 962 data. 964 5.1. "enc" (Encryption Algorithm) Header Parameter Values for JWE 966 The table below is the set of "enc" (encryption algorithm) Header 967 Parameter values that are defined by this specification for use with 968 JWE. 970 +---------------+----------------------------------+----------------+ 971 | enc Param | Content Encryption Algorithm | Implementation | 972 | Value | | Requirements | 973 +---------------+----------------------------------+----------------+ 974 | A128CBC-HS256 | AES_128_CBC_HMAC_SHA_256 | Required | 975 | | authenticated encryption | | 976 | | algorithm, as defined in | | 977 | | Section 5.2.3 | | 978 | A192CBC-HS384 | AES_192_CBC_HMAC_SHA_384 | Optional | 979 | | authenticated encryption | | 980 | | algorithm, as defined in | | 981 | | Section 5.2.4 | | 982 | A256CBC-HS512 | AES_256_CBC_HMAC_SHA_512 | Required | 983 | | authenticated encryption | | 984 | | algorithm, as defined in | | 985 | | Section 5.2.5 | | 986 | A128GCM | AES GCM using 128 bit key | Recommended | 987 | A192GCM | AES GCM using 192 bit key | Optional | 988 | A256GCM | AES GCM using 256 bit key | Recommended | 989 +---------------+----------------------------------+----------------+ 991 All also use a JWE Initialization Vector value and produce JWE 992 Ciphertext and JWE Authentication Tag values. 994 See Appendix A.3 for a table cross-referencing the JWE "enc" 995 (encryption algorithm) values defined in this specification with the 996 equivalent identifiers used by other standards and software packages. 998 5.2. AES_CBC_HMAC_SHA2 Algorithms 1000 This section defines a family of authenticated encryption algorithms 1001 built using a composition of Advanced Encryption Standard (AES) [AES] 1002 in Cipher Block Chaining (CBC) mode [NIST.800-38A] with PKCS #7 1003 padding [RFC5652], Section 6.3 operations and HMAC [RFC2104, SHS] 1004 operations. This algorithm family is called AES_CBC_HMAC_SHA2. It 1005 also defines three instances of this family, the first using 128 bit 1006 CBC keys and HMAC SHA-256, the second using 192 bit CBC keys and HMAC 1007 SHA-384, and the third using 256 bit CBC keys and HMAC SHA-512. Test 1008 cases for these algorithms can be found in Appendix B. 1010 These algorithms are based upon Authenticated Encryption with AES-CBC 1011 and HMAC-SHA [I-D.mcgrew-aead-aes-cbc-hmac-sha2], performing the same 1012 cryptographic computations, but with the Initialization Vector and 1013 Authentication Tag values remaining separate, rather than being 1014 concatenated with the Ciphertext value in the output representation. 1015 This option is discussed in Appendix B of that specification. This 1016 algorithm family is a generalization of the algorithm family in 1017 [I-D.mcgrew-aead-aes-cbc-hmac-sha2], and can be used to implement 1018 those algorithms. 1020 5.2.1. Conventions Used in Defining AES_CBC_HMAC_SHA2 1022 We use the following notational conventions. 1024 CBC-PKCS5-ENC(X, P) denotes the AES CBC encryption of P using PKCS 1025 #7 padding using the cipher with the key X. 1027 MAC(Y, M) denotes the application of the Message Authentication 1028 Code (MAC) to the message M, using the key Y. 1030 5.2.2. Generic AES_CBC_HMAC_SHA2 Algorithm 1032 This section defines AES_CBC_HMAC_SHA2 in a manner that is 1033 independent of the AES CBC key size or hash function to be used. 1034 Section 5.2.2.1 and Section 5.2.2.2 define the generic encryption and 1035 decryption algorithms. Sections 5.2.3 through 5.2.5 define instances 1036 of AES_CBC_HMAC_SHA2 that specify those details. 1038 5.2.2.1. AES_CBC_HMAC_SHA2 Encryption 1040 The authenticated encryption algorithm takes as input four octet 1041 strings: a secret key K, a plaintext P, additional authenticated data 1042 A, and an initialization vector IV. The authenticated ciphertext 1043 value E and the authentication tag value T are provided as outputs. 1044 The data in the plaintext are encrypted and authenticated, and the 1045 additional authenticated data are authenticated, but not encrypted. 1047 The encryption process is as follows, or uses an equivalent set of 1048 steps: 1050 1. The secondary keys MAC_KEY and ENC_KEY are generated from the 1051 input key K as follows. Each of these two keys is an octet 1052 string. 1054 MAC_KEY consists of the initial MAC_KEY_LEN octets of K, in 1055 order. 1057 ENC_KEY consists of the final ENC_KEY_LEN octets of K, in 1058 order. 1060 The number of octets in the input key K MUST be the sum of 1061 MAC_KEY_LEN and ENC_KEY_LEN. The values of these parameters are 1062 specified by the Authenticated Encryption algorithms in Sections 1063 5.2.3 through 5.2.5. Note that the MAC key comes before the 1064 encryption key in the input key K; this is in the opposite order 1065 of the algorithm names in the identifier "AES_CBC_HMAC_SHA2". 1067 2. The Initialization Vector (IV) used is a 128 bit value generated 1068 randomly or pseudorandomly for use in the cipher. 1070 3. The plaintext is CBC encrypted using PKCS #7 padding using 1071 ENC_KEY as the key, and the IV. We denote the ciphertext output 1072 from this step as E. 1074 4. The octet string AL is equal to the number of bits in the 1075 additional authenticated data A expressed as a 64-bit unsigned 1076 big endian integer. 1078 5. A message authentication tag T is computed by applying HMAC 1079 [RFC2104] to the following data, in order: 1081 the additional authenticated data A, 1083 the initialization vector IV, 1085 the ciphertext E computed in the previous step, and 1087 the octet string AL defined above. 1089 The string MAC_KEY is used as the MAC key. We denote the output 1090 of the MAC computed in this step as M. The first T_LEN bits of M 1091 are used as T. 1093 6. The Ciphertext E and the Authentication Tag T are returned as the 1094 outputs of the authenticated encryption. 1096 The encryption process can be illustrated as follows. Here K, P, A, 1097 IV, and E denote the key, plaintext, additional authenticated data, 1098 initialization vector, and ciphertext, respectively. 1100 MAC_KEY = initial MAC_KEY_LEN octets of K, 1102 ENC_KEY = final ENC_KEY_LEN octets of K, 1104 E = CBC-PKCS5-ENC(ENC_KEY, P), 1106 M = MAC(MAC_KEY, A || IV || E || AL), 1108 T = initial T_LEN octets of M. 1110 5.2.2.2. AES_CBC_HMAC_SHA2 Decryption 1112 The authenticated decryption operation has five inputs: K, A, IV, E, 1113 and T as defined above. It has only a single output, either a 1114 plaintext value P or a special symbol FAIL that indicates that the 1115 inputs are not authentic. The authenticated decryption algorithm is 1116 as follows, or uses an equivalent set of steps: 1118 1. The secondary keys MAC_KEY and ENC_KEY are generated from the 1119 input key K as in Step 1 of Section 5.2.2.1. 1121 2. The integrity and authenticity of A and E are checked by 1122 computing an HMAC with the inputs as in Step 5 of 1123 Section 5.2.2.1. The value T, from the previous step, is 1124 compared to the first MAC_KEY length bits of the HMAC output. If 1125 those values are identical, then A and E are considered valid, 1126 and processing is continued. Otherwise, all of the data used in 1127 the MAC validation are discarded, and the Authenticated 1128 Encryption decryption operation returns an indication that it 1129 failed, and the operation halts. (But see Section 11.5 of [JWE] 1130 for security considerations on thwarting timing attacks.) 1132 3. The value E is decrypted and the PKCS #7 padding is checked and 1133 removed. The value IV is used as the initialization vector. The 1134 value ENC_KEY is used as the decryption key. 1136 4. The plaintext value is returned. 1138 5.2.3. AES_128_CBC_HMAC_SHA_256 1140 This algorithm is a concrete instantiation of the generic 1141 AES_CBC_HMAC_SHA2 algorithm above. It uses the HMAC message 1142 authentication code [RFC2104] with the SHA-256 hash function [SHS] to 1143 provide message authentication, with the HMAC output truncated to 128 1144 bits, corresponding to the HMAC-SHA-256-128 algorithm defined in 1145 [RFC4868]. For encryption, it uses AES in the Cipher Block Chaining 1146 (CBC) mode of operation as defined in Section 6.2 of [NIST.800-38A], 1147 with PKCS #7 padding and a 128 bit initialization vector (IV) value. 1149 The AES_CBC_HMAC_SHA2 parameters specific to AES_128_CBC_HMAC_SHA_256 1150 are: 1152 The input key K is 32 octets long. 1154 ENC_KEY_LEN is 16 octets. 1156 MAC_KEY_LEN is 16 octets. 1158 The SHA-256 hash algorithm is used for the HMAC. 1160 The HMAC-SHA-256 output is truncated to T_LEN=16 octets, by 1161 stripping off the final 16 octets. 1163 5.2.4. AES_192_CBC_HMAC_SHA_384 1165 AES_192_CBC_HMAC_SHA_384 is based on AES_128_CBC_HMAC_SHA_256, but 1166 with the following differences: 1168 The input key K is 48 octets long instead of 32. 1170 ENC_KEY_LEN is 24 octets instead of 16. 1172 MAC_KEY_LEN is 24 octets instead of 16. 1174 SHA-384 is used for the HMAC instead of SHA-256. 1176 The HMAC SHA-384 value is truncated to T_LEN=24 octets instead of 1177 16. 1179 5.2.5. AES_256_CBC_HMAC_SHA_512 1181 AES_256_CBC_HMAC_SHA_512 is based on AES_128_CBC_HMAC_SHA_256, but 1182 with the following differences: 1184 The input key K is 64 octets long instead of 32. 1186 ENC_KEY_LEN is 32 octets instead of 16. 1188 MAC_KEY_LEN is 32 octets instead of 16. 1190 SHA-512 is used for the HMAC instead of SHA-256. 1192 The HMAC SHA-512 value is truncated to T_LEN=32 octets instead of 1193 16. 1195 5.2.6. Content Encryption with AES_CBC_HMAC_SHA2 1197 This section defines the specifics of performing authenticated 1198 encryption with the AES_CBC_HMAC_SHA2 algorithms. 1200 The CEK is used as the secret key K. 1202 The following "enc" (encryption algorithm) Header Parameter values 1203 are used to indicate that the JWE Ciphertext and JWE Authentication 1204 Tag values have been computed using the corresponding algorithm: 1206 +---------------+---------------------------------------------------+ 1207 | enc Param | Content Encryption Algorithm | 1208 | Value | | 1209 +---------------+---------------------------------------------------+ 1210 | A128CBC-HS256 | AES_128_CBC_HMAC_SHA_256 authenticated encryption | 1211 | | algorithm, as defined in Section 5.2.3 | 1212 | A192CBC-HS384 | AES_192_CBC_HMAC_SHA_384 authenticated encryption | 1213 | | algorithm, as defined in Section 5.2.4 | 1214 | A256CBC-HS512 | AES_256_CBC_HMAC_SHA_512 authenticated encryption | 1215 | | algorithm, as defined in Section 5.2.5 | 1216 +---------------+---------------------------------------------------+ 1218 5.3. Content Encryption with AES GCM 1220 This section defines the specifics of performing authenticated 1221 encryption with Advanced Encryption Standard (AES) in Galois/Counter 1222 Mode (GCM) [AES, NIST.800-38D]. 1224 The CEK is used as the encryption key. 1226 Use of an initialization vector of size 96 bits is REQUIRED with this 1227 algorithm. 1229 The requested size of the Authentication Tag output MUST be 128 bits, 1230 regardless of the key size. 1232 The following "enc" (encryption algorithm) Header Parameter values 1233 are used to indicate that the JWE Ciphertext and JWE Authentication 1234 Tag values have been computed using the corresponding algorithm and 1235 key size: 1237 +-----------------+------------------------------+ 1238 | enc Param Value | Content Encryption Algorithm | 1239 +-----------------+------------------------------+ 1240 | A128GCM | AES GCM using 128 bit key | 1241 | A192GCM | AES GCM using 192 bit key | 1242 | A256GCM | AES GCM using 256 bit key | 1243 +-----------------+------------------------------+ 1245 An example using this algorithm is shown in Appendix A.1 of [JWE]. 1247 6. Cryptographic Algorithms for Keys 1249 A JSON Web Key (JWK) [JWK] is a JSON data structure that represents a 1250 cryptographic key. These keys can be either asymmetric or symmetric. 1251 They can hold both public and private information about the key. 1252 This section defines the parameters for keys using the algorithms 1253 specified by this document. 1255 6.1. "kty" (Key Type) Parameter Values 1257 The table below is the set of "kty" (key type) parameter values that 1258 are defined by this specification for use in JWKs. 1260 +-------------+------------------------------------+----------------+ 1261 | kty Param | Key Type | Implementation | 1262 | Value | | Requirements | 1263 +-------------+------------------------------------+----------------+ 1264 | EC | Elliptic Curve [DSS] | Recommended+ | 1265 | RSA | RSA [RFC3447] | Required | 1266 | oct | Octet sequence (used to represent | Required | 1267 | | symmetric keys) | | 1268 +-------------+------------------------------------+----------------+ 1270 The use of "+" in the Implementation Requirements indicates that the 1271 requirement strength is likely to be increased in a future version of 1272 the specification. 1274 6.2. Parameters for Elliptic Curve Keys 1276 JWKs can represent Elliptic Curve [DSS] keys. In this case, the 1277 "kty" member value is "EC". 1279 6.2.1. Parameters for Elliptic Curve Public Keys 1281 An elliptic curve public key is represented by a pair of coordinates 1282 drawn from a finite field, which together define a point on an 1283 elliptic curve. The following members MUST be present for all 1284 elliptic curve public keys: 1286 o "crv" 1287 o "x" 1289 The following member MUST also be present for elliptic curve public 1290 keys for the three curves defined in the following section: 1292 o "y" 1294 6.2.1.1. "crv" (Curve) Parameter 1296 The "crv" (curve) member identifies the cryptographic curve used with 1297 the key. Curve values from [DSS] used by this specification are: 1299 o "P-256" 1300 o "P-384" 1301 o "P-521" 1303 These values are registered in the IANA JSON Web Key Elliptic Curve 1304 registry defined in Section 7.6. Additional "crv" values can be 1305 registered by other specifications. Specifications registering 1306 additional curves must define what parameters are used to represent 1307 keys for the curves registered. The "crv" value is a case-sensitive 1308 string. 1310 SEC1 [SEC1] point compression is not supported for any of these three 1311 curves. 1313 6.2.1.2. "x" (X Coordinate) Parameter 1315 The "x" (x coordinate) member contains the x coordinate for the 1316 elliptic curve point. It is represented as the base64url encoding of 1317 the octet string representation of the coordinate, as defined in 1318 Section 2.3.5 of SEC1 [SEC1]. The length of this octet string MUST 1319 be the full size of a coordinate for the curve specified in the "crv" 1320 parameter. For example, if the value of "crv" is "P-521", the octet 1321 string must be 66 octets long. 1323 6.2.1.3. "y" (Y Coordinate) Parameter 1325 The "y" (y coordinate) member contains the y coordinate for the 1326 elliptic curve point. It is represented as the base64url encoding of 1327 the octet string representation of the coordinate, as defined in 1328 Section 2.3.5 of SEC1 [SEC1]. The length of this octet string MUST 1329 be the full size of a coordinate for the curve specified in the "crv" 1330 parameter. For example, if the value of "crv" is "P-521", the octet 1331 string must be 66 octets long. 1333 6.2.2. Parameters for Elliptic Curve Private Keys 1335 In addition to the members used to represent Elliptic Curve public 1336 keys, the following member MUST be present to represent Elliptic 1337 Curve private keys. 1339 6.2.2.1. "d" (ECC Private Key) Parameter 1341 The "d" (ECC private key) member contains the Elliptic Curve private 1342 key value. It is represented as the base64url encoding of the octet 1343 string representation of the private key value, as defined in Section 1344 2.3.7 of SEC1 [SEC1]. The length of this octet string MUST be 1345 ceiling(log-base-2(n)/8) octets (where n is the order of the curve). 1347 6.3. Parameters for RSA Keys 1349 JWKs can represent RSA [RFC3447] keys. In this case, the "kty" 1350 member value is "RSA". The semantics of the parameters defined below 1351 are the same as those defined in Sections 3.1 and 3.2 of RFC 3447. 1353 6.3.1. Parameters for RSA Public Keys 1355 The following members MUST be present for RSA public keys. 1357 6.3.1.1. "n" (Modulus) Parameter 1359 The "n" (modulus) member contains the modulus value for the RSA 1360 public key. It is represented as a Base64urlUInt encoded value. 1362 Note that implementers have found that some cryptographic libraries 1363 prefix an extra zero-valued octet to the modulus representations they 1364 return, for instance, returning 257 octets for a 2048 bit key, rather 1365 than 256. Implementations using such libraries will need to take 1366 care to omit the extra octet from the base64url encoded 1367 representation. 1369 6.3.1.2. "e" (Exponent) Parameter 1371 The "e" (exponent) member contains the exponent value for the RSA 1372 public key. It is represented as a Base64urlUInt encoded value. 1374 For instance, when representing the value 65537, the octet sequence 1375 to be base64url encoded MUST consist of the three octets [1, 0, 1]; 1376 the resulting representation for this value is "AQAB". 1378 6.3.2. Parameters for RSA Private Keys 1380 In addition to the members used to represent RSA public keys, the 1381 following members are used to represent RSA private keys. The 1382 parameter "d" is REQUIRED for RSA private keys. The others enable 1383 optimizations and SHOULD be included by producers of JWKs 1384 representing RSA private keys. If the producer includes any of the 1385 other private key parameters, then all of the others MUST be present, 1386 with the exception of "oth", which MUST only be present when more 1387 than two prime factors were used. 1389 6.3.2.1. "d" (Private Exponent) Parameter 1391 The "d" (private exponent) member contains the private exponent value 1392 for the RSA private key. It is represented as a Base64urlUInt 1393 encoded value. 1395 6.3.2.2. "p" (First Prime Factor) Parameter 1397 The "p" (first prime factor) member contains the first prime factor. 1398 It is represented as a Base64urlUInt encoded value. 1400 6.3.2.3. "q" (Second Prime Factor) Parameter 1402 The "q" (second prime factor) member contains the second prime 1403 factor. It is represented as a Base64urlUInt encoded value. 1405 6.3.2.4. "dp" (First Factor CRT Exponent) Parameter 1407 The "dp" (first factor CRT exponent) member contains the Chinese 1408 Remainder Theorem (CRT) exponent of the first factor. It is 1409 represented as a Base64urlUInt encoded value. 1411 6.3.2.5. "dq" (Second Factor CRT Exponent) Parameter 1413 The "dq" (second factor CRT exponent) member contains the Chinese 1414 Remainder Theorem (CRT) exponent of the second factor. It is 1415 represented as a Base64urlUInt encoded value. 1417 6.3.2.6. "qi" (First CRT Coefficient) Parameter 1419 The "qi" (first CRT coefficient) member contains the Chinese 1420 Remainder Theorem (CRT) coefficient of the second factor. It is 1421 represented as a Base64urlUInt encoded value. 1423 6.3.2.7. "oth" (Other Primes Info) Parameter 1425 The "oth" (other primes info) member contains an array of information 1426 about any third and subsequent primes, should they exist. When only 1427 two primes have been used (the normal case), this parameter MUST be 1428 omitted. When three or more primes have been used, the number of 1429 array elements MUST be the number of primes used minus two. For more 1430 information on this case, see the description of the OtherPrimeInfo 1431 parameters in Section A.1.2 of RFC 3447 [RFC3447], upon which the 1432 following parameters are modelled. If the consumer of a JWK does not 1433 support private keys with more than two primes and it encounters a 1434 private key that includes the "oth" parameter, then it MUST NOT use 1435 the key. Each array element MUST be an object with the following 1436 members: 1438 6.3.2.7.1. "r" (Prime Factor) 1440 The "r" (prime factor) parameter within an "oth" array member 1441 represents the value of a subsequent prime factor. It is represented 1442 as a Base64urlUInt encoded value. 1444 6.3.2.7.2. "d" (Factor CRT Exponent) 1446 The "d" (Factor CRT Exponent) parameter within an "oth" array member 1447 represents the CRT exponent of the corresponding prime factor. It is 1448 represented as a Base64urlUInt encoded value. 1450 6.3.2.7.3. "t" (Factor CRT Coefficient) 1452 The "t" (factor CRT coefficient) parameter within an "oth" array 1453 member represents the CRT coefficient of the corresponding prime 1454 factor. It is represented as a Base64urlUInt encoded value. 1456 6.4. Parameters for Symmetric Keys 1458 When the JWK "kty" member value is "oct" (octet sequence), the member 1459 "k" is used to represent a symmetric key (or another key whose value 1460 is a single octet sequence). An "alg" member SHOULD also be present 1461 to identify the algorithm intended to be used with the key, unless 1462 the application uses another means or convention to determine the 1463 algorithm used. 1465 6.4.1. "k" (Key Value) Parameter 1467 The "k" (key value) member contains the value of the symmetric (or 1468 other single-valued) key. It is represented as the base64url 1469 encoding of the octet sequence containing the key value. 1471 7. IANA Considerations 1473 The following registration procedure is used for all the registries 1474 established by this specification. 1476 Values are registered on a Specification Required [RFC5226] basis 1477 after a three-week review period on the jose-reg-review@ietf.org 1478 mailing list, on the advice of one or more Designated Experts. 1479 However, to allow for the allocation of values prior to publication, 1480 the Designated Expert(s) may approve registration once they are 1481 satisfied that such a specification will be published. 1483 Registration requests must be sent to the jose-reg-review@ietf.org 1484 mailing list for review and comment, with an appropriate subject 1485 (e.g., "Request to register algorithm: example"). 1487 Within the review period, the Designated Expert(s) will either 1488 approve or deny the registration request, communicating this decision 1489 to the review list and IANA. Denials should include an explanation 1490 and, if applicable, suggestions as to how to make the request 1491 successful. Registration requests that are undetermined for a period 1492 longer than 21 days can be brought to the IESG's attention (using the 1493 iesg@ietf.org mailing list) for resolution. 1495 Criteria that should be applied by the Designated Expert(s) includes 1496 determining whether the proposed registration duplicates existing 1497 functionality, determining whether it is likely to be of general 1498 applicability or whether it is useful only for a single application, 1499 and whether the registration description is clear. 1501 IANA must only accept registry updates from the Designated Expert(s) 1502 and should direct all requests for registration to the review mailing 1503 list. 1505 It is suggested that multiple Designated Experts be appointed who are 1506 able to represent the perspectives of different applications using 1507 this specification, in order to enable broadly-informed review of 1508 registration decisions. In cases where a registration decision could 1509 be perceived as creating a conflict of interest for a particular 1510 Expert, that Expert should defer to the judgment of the other 1511 Expert(s). 1513 [[ Note to the RFC Editor and IANA: Pearl Liang of ICANN had 1514 requested that the draft supply the following proposed registry 1515 description information. It is to be used for all registries 1516 established by this specification. 1518 o Protocol Category: JSON Object Signing and Encryption (JOSE) 1520 o Registry Location: http://www.iana.org/assignments/jose 1522 o Webpage Title: (same as the protocol category) 1524 o Registry Name: (same as the section title, but excluding the word 1525 "Registry", for example "JSON Web Signature and Encryption 1526 Algorithms") 1528 ]] 1530 7.1. JSON Web Signature and Encryption Algorithms Registry 1532 This specification establishes the IANA JSON Web Signature and 1533 Encryption Algorithms registry for values of the JWS and JWE "alg" 1534 (algorithm) and "enc" (encryption algorithm) Header Parameters. The 1535 registry records the algorithm name, the algorithm usage locations, 1536 implementation requirements, and a reference to the specification 1537 that defines it. The same algorithm name can be registered multiple 1538 times, provided that the sets of usage locations are disjoint. 1540 It is suggested that when multiple variations of algorithms are being 1541 registered that use keys of different lengths and the key lengths for 1542 each need to be fixed (for instance, because they will be created by 1543 key derivation functions), that the length of the key be included in 1544 the algorithm name. This allows readers of the JSON text to more 1545 easily make security decisions. 1547 The Designated Expert(s) should perform reasonable due diligence that 1548 algorithms being registered are either currently considered 1549 cryptographically credible or are being registered as Deprecated or 1550 Prohibited. 1552 The implementation requirements of an algorithm may be changed over 1553 time as the cryptographic landscape evolves, for instance, to change 1554 the status of an algorithm to Deprecated, or to change the status of 1555 an algorithm from Optional to Recommended+ or Required. Changes of 1556 implementation requirements are only permitted on a Specification 1557 Required basis after review by the Designated Experts(s), with the 1558 new specification defining the revised implementation requirements 1559 level. 1561 7.1.1. Registration Template 1562 Algorithm Name: 1563 The name requested (e.g., "HS256"). This name is a case-sensitive 1564 ASCII string. Names may not match other registered names in a 1565 case-insensitive manner unless the Designated Expert(s) state that 1566 there is a compelling reason to allow an exception in this 1567 particular case. 1569 Algorithm Description: 1570 Brief description of the Algorithm (e.g., "HMAC using SHA-256"). 1572 Algorithm Usage Location(s): 1573 The algorithm usage location. This must be one or more of the 1574 values "alg" or "enc" if the algorithm is to be used with JWS or 1575 JWE. The value "JWK" is used if the algorithm identifier will be 1576 used as a JWK "alg" member value, but will not be used with JWS or 1577 JWE; this could be the case, for instance, for non-authenticated 1578 encryption algorithms. Other values may be used with the approval 1579 of a Designated Expert. 1581 JOSE Implementation Requirements: 1582 The algorithm implementation requirements for JWS and JWE, which 1583 must be one the words Required, Recommended, Optional, Deprecated, 1584 or Prohibited. Optionally, the word can be followed by a "+" or 1585 "-". The use of "+" indicates that the requirement strength is 1586 likely to be increased in a future version of the specification. 1587 The use of "-" indicates that the requirement strength is likely 1588 to be decreased in a future version of the specification. Any 1589 identifiers registered for non-authenticated encryption algorithms 1590 or other algorithms that are otherwise unsuitable for direct use 1591 as JWS or JWE algorithms must be registered as "Prohibited". 1593 Change Controller: 1594 For Standards Track RFCs, state "IESG". For others, give the name 1595 of the responsible party. Other details (e.g., postal address, 1596 email address, home page URI) may also be included. 1598 Specification Document(s): 1599 Reference to the document(s) that specify the parameter, 1600 preferably including URI(s) that can be used to retrieve copies of 1601 the document(s). An indication of the relevant sections may also 1602 be included but is not required. 1604 7.1.2. Initial Registry Contents 1606 o Algorithm Name: "HS256" 1607 o Algorithm Description: HMAC using SHA-256 1608 o Algorithm Usage Location(s): "alg" 1609 o JOSE Implementation Requirements: Required 1610 o Change Controller: IESG 1611 o Specification Document(s): Section 3.1 of [[ this document ]] 1613 o Algorithm Name: "HS384" 1614 o Algorithm Description: HMAC using SHA-384 1615 o Algorithm Usage Location(s): "alg" 1616 o JOSE Implementation Requirements: Optional 1617 o Change Controller: IESG 1618 o Specification Document(s): Section 3.1 of [[ this document ]] 1620 o Algorithm Name: "HS512" 1621 o Algorithm Description: HMAC using SHA-512 1622 o Algorithm Usage Location(s): "alg" 1623 o JOSE Implementation Requirements: Optional 1624 o Change Controller: IESG 1625 o Specification Document(s): Section 3.1 of [[ this document ]] 1627 o Algorithm Name: "RS256" 1628 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-256 1629 o Algorithm Usage Location(s): "alg" 1630 o JOSE Implementation Requirements: Recommended 1631 o Change Controller: IESG 1632 o Specification Document(s): Section 3.1 of [[ this document ]] 1634 o Algorithm Name: "RS384" 1635 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-384 1636 o Algorithm Usage Location(s): "alg" 1637 o JOSE Implementation Requirements: Optional 1638 o Change Controller: IESG 1639 o Specification Document(s): Section 3.1 of [[ this document ]] 1641 o Algorithm Name: "RS512" 1642 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-512 1643 o Algorithm Usage Location(s): "alg" 1644 o JOSE Implementation Requirements: Optional 1645 o Change Controller: IESG 1646 o Specification Document(s): Section 3.1 of [[ this document ]] 1648 o Algorithm Name: "ES256" 1649 o Algorithm Description: ECDSA using P-256 and SHA-256 1650 o Algorithm Usage Location(s): "alg" 1651 o JOSE Implementation Requirements: Recommended+ 1652 o Change Controller: IESG 1653 o Specification Document(s): Section 3.1 of [[ this document ]] 1654 o Algorithm Name: "ES384" 1655 o Algorithm Description: ECDSA using P-384 and SHA-384 1656 o Algorithm Usage Location(s): "alg" 1657 o JOSE Implementation Requirements: Optional 1658 o Change Controller: IESG 1659 o Specification Document(s): Section 3.1 of [[ this document ]] 1661 o Algorithm Name: "ES512" 1662 o Algorithm Description: ECDSA using P-521 and SHA-512 1663 o Algorithm Usage Location(s): "alg" 1664 o JOSE Implementation Requirements: Optional 1665 o Change Controller: IESG 1666 o Specification Document(s): Section 3.1 of [[ this document ]] 1668 o Algorithm Name: "PS256" 1669 o Algorithm Description: RSASSA-PSS using SHA-256 and MGF1 with SHA- 1670 256 1671 o Algorithm Usage Location(s): "alg" 1672 o JOSE Implementation Requirements: Optional 1673 o Change Controller: IESG 1674 o Specification Document(s): Section 3.1 of [[ this document ]] 1676 o Algorithm Name: "PS384" 1677 o Algorithm Description: RSASSA-PSS using SHA-384 and MGF1 with SHA- 1678 384 1679 o Algorithm Usage Location(s): "alg" 1680 o JOSE Implementation Requirements: Optional 1681 o Change Controller: IESG 1682 o Specification Document(s): Section 3.1 of [[ this document ]] 1684 o Algorithm Name: "PS512" 1685 o Algorithm Description: RSASSA-PSS using SHA-512 and MGF1 with SHA- 1686 512 1687 o Algorithm Usage Location(s): "alg" 1688 o JOSE Implementation Requirements: Optional 1689 o Change Controller: IESG 1690 o Specification Document(s): Section 3.1 of [[ this document ]] 1692 o Algorithm Name: "none" 1693 o Algorithm Description: No digital signature or MAC performed 1694 o Algorithm Usage Location(s): "alg" 1695 o JOSE Implementation Requirements: Optional 1696 o Change Controller: IESG 1697 o Specification Document(s): Section 3.1 of [[ this document ]] 1699 o Algorithm Name: "RSA1_5" 1700 o Algorithm Description: RSAES-PKCS1-V1_5 1701 o Algorithm Usage Location(s): "alg" 1702 o JOSE Implementation Requirements: Recommended- 1703 o Change Controller: IESG 1704 o Specification Document(s): Section 4.1 of [[ this document ]] 1706 o Algorithm Name: "RSA-OAEP" 1707 o Algorithm Description: RSAES OAEP using default parameters 1708 o Algorithm Usage Location(s): "alg" 1709 o JOSE Implementation Requirements: Recommended+ 1710 o Change Controller: IESG 1711 o Specification Document(s): Section 4.1 of [[ this document ]] 1713 o Algorithm Name: "RSA-OAEP-256" 1714 o Algorithm Description: RSAES OAEP using SHA-256 and MGF1 with SHA- 1715 256 1716 o Algorithm Usage Location(s): "alg" 1717 o JOSE Implementation Requirements: Optional 1718 o Change Controller: IESG 1719 o Specification Document(s): Section 4.1 of [[ this document ]] 1721 o Algorithm Name: "A128KW" 1722 o Algorithm Description: AES Key Wrap using 128 bit key 1723 o Algorithm Usage Location(s): "alg" 1724 o JOSE Implementation Requirements: Recommended 1725 o Change Controller: IESG 1726 o Specification Document(s): Section 4.1 of [[ this document ]] 1728 o Algorithm Name: "A192KW" 1729 o Algorithm Description: AES Key Wrap using 192 bit key 1730 o Algorithm Usage Location(s): "alg" 1731 o JOSE Implementation Requirements: Optional 1732 o Change Controller: IESG 1733 o Specification Document(s): Section 4.1 of [[ this document ]] 1735 o Algorithm Name: "A256KW" 1736 o Algorithm Description: AES Key Wrap using 256 bit key 1737 o Algorithm Usage Location(s): "alg" 1738 o JOSE Implementation Requirements: Recommended 1739 o Change Controller: IESG 1740 o Specification Document(s): Section 4.1 of [[ this document ]] 1742 o Algorithm Name: "dir" 1743 o Algorithm Description: Direct use of a shared symmetric key 1744 o Algorithm Usage Location(s): "alg" 1745 o JOSE Implementation Requirements: Recommended 1746 o Change Controller: IESG 1747 o Specification Document(s): Section 4.1 of [[ this document ]] 1749 o Algorithm Name: "ECDH-ES" 1750 o Algorithm Description: ECDH-ES using Concat KDF 1751 o Algorithm Usage Location(s): "alg" 1752 o JOSE Implementation Requirements: Recommended+ 1753 o Change Controller: IESG 1754 o Specification Document(s): Section 4.1 of [[ this document ]] 1756 o Algorithm Name: "ECDH-ES+A128KW" 1757 o Algorithm Description: ECDH-ES using Concat KDF and "A128KW" 1758 wrapping 1759 o Algorithm Usage Location(s): "alg" 1760 o JOSE Implementation Requirements: Recommended 1761 o Change Controller: IESG 1762 o Specification Document(s): Section 4.1 of [[ this document ]] 1764 o Algorithm Name: "ECDH-ES+A192KW" 1765 o Algorithm Description: ECDH-ES using Concat KDF and "A192KW" 1766 wrapping 1767 o Algorithm Usage Location(s): "alg" 1768 o JOSE Implementation Requirements: Optional 1769 o Change Controller: IESG 1770 o Specification Document(s): Section 4.1 of [[ this document ]] 1772 o Algorithm Name: "ECDH-ES+A256KW" 1773 o Algorithm Description: ECDH-ES using Concat KDF and "A256KW" 1774 wrapping 1775 o Algorithm Usage Location(s): "alg" 1776 o JOSE Implementation Requirements: Recommended 1777 o Change Controller: IESG 1778 o Specification Document(s): Section 4.1 of [[ this document ]] 1780 o Algorithm Name: "A128GCMKW" 1781 o Algorithm Description: Key wrapping with AES GCM using 128 bit key 1782 o Algorithm Usage Location(s): "alg" 1783 o JOSE Implementation Requirements: Optional 1784 o Change Controller: IESG 1785 o Specification Document(s): Section 4.7 of [[ this document ]] 1787 o Algorithm Name: "A192GCMKW" 1788 o Algorithm Description: Key wrapping with AES GCM using 192 bit key 1789 o Algorithm Usage Location(s): "alg" 1790 o JOSE Implementation Requirements: Optional 1791 o Change Controller: IESG 1792 o Specification Document(s): Section 4.7 of [[ this document ]] 1794 o Algorithm Name: "A256GCMKW" 1795 o Algorithm Description: Key wrapping with AES GCM using 256 bit key 1796 o Algorithm Usage Location(s): "alg" 1797 o JOSE Implementation Requirements: Optional 1798 o Change Controller: IESG 1799 o Specification Document(s): Section 4.7 of [[ this document ]] 1801 o Algorithm Name: "PBES2-HS256+A128KW" 1802 o Algorithm Description: PBES2 with HMAC SHA-256 and "A128KW" 1803 wrapping 1804 o Algorithm Usage Location(s): "alg" 1805 o JOSE Implementation Requirements: Optional 1806 o Change Controller: IESG 1807 o Specification Document(s): Section 4.8 of [[ this document ]] 1809 o Algorithm Name: "PBES2-HS384+A192KW" 1810 o Algorithm Description: PBES2 with HMAC SHA-384 and "A192KW" 1811 wrapping 1812 o Algorithm Usage Location(s): "alg" 1813 o JOSE Implementation Requirements: Optional 1814 o Change Controller: IESG 1815 o Specification Document(s): Section 4.8 of [[ this document ]] 1817 o Algorithm Name: "PBES2-HS512+A256KW" 1818 o Algorithm Description: PBES2 with HMAC SHA-512 and "A256KW" 1819 wrapping 1820 o Algorithm Usage Location(s): "alg" 1821 o JOSE Implementation Requirements: Optional 1822 o Change Controller: IESG 1823 o Specification Document(s): Section 4.8 of [[ this document ]] 1825 o Algorithm Name: "A128CBC-HS256" 1826 o Algorithm Description: AES_128_CBC_HMAC_SHA_256 authenticated 1827 encryption algorithm 1828 o Algorithm Usage Location(s): "enc" 1829 o JOSE Implementation Requirements: Required 1830 o Change Controller: IESG 1831 o Specification Document(s): Section 5.1 of [[ this document ]] 1833 o Algorithm Name: "A192CBC-HS384" 1834 o Algorithm Description: AES_192_CBC_HMAC_SHA_384 authenticated 1835 encryption algorithm 1836 o Algorithm Usage Location(s): "enc" 1837 o JOSE Implementation Requirements: Optional 1838 o Change Controller: IESG 1839 o Specification Document(s): Section 5.1 of [[ this document ]] 1841 o Algorithm Name: "A256CBC-HS512" 1842 o Algorithm Description: AES_256_CBC_HMAC_SHA_512 authenticated 1843 encryption algorithm 1844 o Algorithm Usage Location(s): "enc" 1845 o JOSE Implementation Requirements: Required 1846 o Change Controller: IESG 1847 o Specification Document(s): Section 5.1 of [[ this document ]] 1849 o Algorithm Name: "A128GCM" 1850 o Algorithm Description: AES GCM using 128 bit key 1851 o Algorithm Usage Location(s): "enc" 1852 o JOSE Implementation Requirements: Recommended 1853 o Change Controller: IESG 1854 o Specification Document(s): Section 5.1 of [[ this document ]] 1856 o Algorithm Name: "A192GCM" 1857 o Algorithm Description: AES GCM using 192 bit key 1858 o Algorithm Usage Location(s): "enc" 1859 o JOSE Implementation Requirements: Optional 1860 o Change Controller: IESG 1861 o Specification Document(s): Section 5.1 of [[ this document ]] 1863 o Algorithm Name: "A256GCM" 1864 o Algorithm Description: AES GCM using 256 bit key 1865 o Algorithm Usage Location(s): "enc" 1866 o JOSE Implementation Requirements: Recommended 1867 o Change Controller: IESG 1868 o Specification Document(s): Section 5.1 of [[ this document ]] 1870 7.2. Header Parameter Names Registration 1872 This specification registers the Header Parameter names defined in 1873 Section 4.6.1, Section 4.7.1, and Section 4.8.1 in the IANA JSON Web 1874 Signature and Encryption Header Parameters registry defined in [JWS]. 1876 7.2.1. Registry Contents 1878 o Header Parameter Name: "epk" 1879 o Header Parameter Description: Ephemeral Public Key 1880 o Header Parameter Usage Location(s): JWE 1881 o Change Controller: IESG 1882 o Specification Document(s): Section 4.6.1.1 of [[ this document ]] 1883 o Header Parameter Name: "apu" 1884 o Header Parameter Description: Agreement PartyUInfo 1885 o Header Parameter Usage Location(s): JWE 1886 o Change Controller: IESG 1887 o Specification Document(s): Section 4.6.1.2 of [[ this document ]] 1889 o Header Parameter Name: "apv" 1890 o Header Parameter Description: Agreement PartyVInfo 1891 o Header Parameter Usage Location(s): JWE 1892 o Change Controller: IESG 1893 o Specification Document(s): Section 4.6.1.3 of [[ this document ]] 1895 o Header Parameter Name: "iv" 1896 o Header Parameter Description: Initialization Vector 1897 o Header Parameter Usage Location(s): JWE 1898 o Change Controller: IESG 1899 o Specification Document(s): Section 4.7.1.1 of [[ this document ]] 1901 o Header Parameter Name: "tag" 1902 o Header Parameter Description: Authentication Tag 1903 o Header Parameter Usage Location(s): JWE 1904 o Change Controller: IESG 1905 o Specification Document(s): Section 4.7.1.2 of [[ this document ]] 1907 o Header Parameter Name: "p2s" 1908 o Header Parameter Description: PBES2 salt 1909 o Header Parameter Usage Location(s): JWE 1910 o Change Controller: IESG 1911 o Specification Document(s): Section 4.8.1.1 of [[ this document ]] 1913 o Header Parameter Name: "p2c" 1914 o Header Parameter Description: PBES2 count 1915 o Header Parameter Usage Location(s): JWE 1916 o Change Controller: IESG 1917 o Specification Document(s): Section 4.8.1.2 of [[ this document ]] 1919 7.3. JSON Web Encryption Compression Algorithms Registry 1921 This specification establishes the IANA JSON Web Encryption 1922 Compression Algorithms registry for JWE "zip" member values. The 1923 registry records the compression algorithm value and a reference to 1924 the specification that defines it. 1926 7.3.1. Registration Template 1927 Compression Algorithm Value: 1928 The name requested (e.g., "DEF"). Because a core goal of this 1929 specification is for the resulting representations to be compact, 1930 it is RECOMMENDED that the name be short -- not to exceed 8 1931 characters without a compelling reason to do so. This name is 1932 case-sensitive. Names may not match other registered names in a 1933 case-insensitive manner unless the Designated Expert(s) state that 1934 there is a compelling reason to allow an exception in this 1935 particular case. 1937 Compression Algorithm Description: 1938 Brief description of the compression algorithm (e.g., "DEFLATE"). 1940 Change Controller: 1941 For Standards Track RFCs, state "IESG". For others, give the name 1942 of the responsible party. Other details (e.g., postal address, 1943 email address, home page URI) may also be included. 1945 Specification Document(s): 1946 Reference to the document(s) that specify the parameter, 1947 preferably including URI(s) that can be used to retrieve copies of 1948 the document(s). An indication of the relevant sections may also 1949 be included but is not required. 1951 7.3.2. Initial Registry Contents 1953 o Compression Algorithm Value: "DEF" 1954 o Compression Algorithm Description: DEFLATE 1955 o Change Controller: IESG 1956 o Specification Document(s): JSON Web Encryption (JWE) [JWE] 1958 7.4. JSON Web Key Types Registry 1960 This specification establishes the IANA JSON Web Key Types registry 1961 for values of the JWK "kty" (key type) parameter. The registry 1962 records the "kty" value, implementation requirements, and a reference 1963 to the specification that defines it. 1965 The implementation requirements of a key type may be changed over 1966 time as the cryptographic landscape evolves, for instance, to change 1967 the status of a key type to Deprecated, or to change the status of a 1968 key type from Optional to Recommended+ or Required. Changes of 1969 implementation requirements are only permitted on a Specification 1970 Required basis after review by the Designated Experts(s), with the 1971 new specification defining the revised implementation requirements 1972 level. 1974 7.4.1. Registration Template 1976 "kty" Parameter Value: 1977 The name requested (e.g., "EC"). Because a core goal of this 1978 specification is for the resulting representations to be compact, 1979 it is RECOMMENDED that the name be short -- not to exceed 8 1980 characters without a compelling reason to do so. This name is 1981 case-sensitive. Names may not match other registered names in a 1982 case-insensitive manner unless the Designated Expert(s) state that 1983 there is a compelling reason to allow an exception in this 1984 particular case. 1986 Key Type Description: 1987 Brief description of the Key Type (e.g., "Elliptic Curve"). 1989 Change Controller: 1990 For Standards Track RFCs, state "IESG". For others, give the name 1991 of the responsible party. Other details (e.g., postal address, 1992 email address, home page URI) may also be included. 1994 JOSE Implementation Requirements: 1995 The key type implementation requirements for JWS and JWE, which 1996 must be one the words Required, Recommended, Optional, Deprecated, 1997 or Prohibited. Optionally, the word can be followed by a "+" or 1998 "-". The use of "+" indicates that the requirement strength is 1999 likely to be increased in a future version of the specification. 2000 The use of "-" indicates that the requirement strength is likely 2001 to be decreased in a future version of the specification. 2003 Specification Document(s): 2004 Reference to the document(s) that specify the parameter, 2005 preferably including URI(s) that can be used to retrieve copies of 2006 the document(s). An indication of the relevant sections may also 2007 be included but is not required. 2009 7.4.2. Initial Registry Contents 2011 This specification registers the values defined in Section 6.1. 2013 o "kty" Parameter Value: "EC" 2014 o Key Type Description: Elliptic Curve 2015 o JOSE Implementation Requirements: Recommended+ 2016 o Change Controller: IESG 2017 o Specification Document(s): Section 6.2 of [[ this document ]] 2019 o "kty" Parameter Value: "RSA" 2020 o Key Type Description: RSA 2021 o JOSE Implementation Requirements: Required 2022 o Change Controller: IESG 2023 o Specification Document(s): Section 6.3 of [[ this document ]] 2025 o "kty" Parameter Value: "oct" 2026 o Key Type Description: Octet sequence 2027 o JOSE Implementation Requirements: Required 2028 o Change Controller: IESG 2029 o Specification Document(s): Section 6.4 of [[ this document ]] 2031 7.5. JSON Web Key Parameters Registration 2033 This specification registers the parameter names defined in Sections 2034 6.2, 6.3, and 6.4 in the IANA JSON Web Key Parameters registry 2035 defined in [JWK]. 2037 7.5.1. Registry Contents 2039 o Parameter Name: "crv" 2040 o Parameter Description: Curve 2041 o Used with "kty" Value(s): "EC" 2042 o Parameter Information Class: Public 2043 o Change Controller: IESG 2044 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2046 o Parameter Name: "x" 2047 o Parameter Description: X Coordinate 2048 o Used with "kty" Value(s): "EC" 2049 o Parameter Information Class: Public 2050 o Change Controller: IESG 2051 o Specification Document(s): Section 6.2.1.2 of [[ this document ]] 2053 o Parameter Name: "y" 2054 o Parameter Description: Y Coordinate 2055 o Used with "kty" Value(s): "EC" 2056 o Parameter Information Class: Public 2057 o Change Controller: IESG 2058 o Specification Document(s): Section 6.2.1.3 of [[ this document ]] 2060 o Parameter Name: "d" 2061 o Parameter Description: ECC Private Key 2062 o Used with "kty" Value(s): "EC" 2063 o Parameter Information Class: Private 2064 o Change Controller: IESG 2065 o Specification Document(s): Section 6.2.2.1 of [[ this document ]] 2066 o Parameter Name: "n" 2067 o Parameter Description: Modulus 2068 o Used with "kty" Value(s): "RSA" 2069 o Parameter Information Class: Public 2070 o Change Controller: IESG 2071 o Specification Document(s): Section 6.3.1.1 of [[ this document ]] 2073 o Parameter Name: "e" 2074 o Parameter Description: Exponent 2075 o Used with "kty" Value(s): "RSA" 2076 o Parameter Information Class: Public 2077 o Change Controller: IESG 2078 o Specification Document(s): Section 6.3.1.2 of [[ this document ]] 2080 o Parameter Name: "d" 2081 o Parameter Description: Private Exponent 2082 o Used with "kty" Value(s): "RSA" 2083 o Parameter Information Class: Private 2084 o Change Controller: IESG 2085 o Specification Document(s): Section 6.3.2.1 of [[ this document ]] 2087 o Parameter Name: "p" 2088 o Parameter Description: First Prime Factor 2089 o Used with "kty" Value(s): "RSA" 2090 o Parameter Information Class: Private 2091 o Change Controller: IESG 2092 o Specification Document(s): Section 6.3.2.2 of [[ this document ]] 2094 o Parameter Name: "q" 2095 o Parameter Description: Second Prime Factor 2096 o Used with "kty" Value(s): "RSA" 2097 o Parameter Information Class: Private 2098 o Change Controller: IESG 2099 o Specification Document(s): Section 6.3.2.3 of [[ this document ]] 2101 o Parameter Name: "dp" 2102 o Parameter Description: First Factor CRT Exponent 2103 o Used with "kty" Value(s): "RSA" 2104 o Parameter Information Class: Private 2105 o Change Controller: IESG 2106 o Specification Document(s): Section 6.3.2.4 of [[ this document ]] 2108 o Parameter Name: "dq" 2109 o Parameter Description: Second Factor CRT Exponent 2110 o Used with "kty" Value(s): "RSA" 2111 o Parameter Information Class: Private 2112 o Change Controller: IESG 2113 o Specification Document(s): Section 6.3.2.5 of [[ this document ]] 2115 o Parameter Name: "qi" 2116 o Parameter Description: First CRT Coefficient 2117 o Used with "kty" Value(s): "RSA" 2118 o Parameter Information Class: Private 2119 o Change Controller: IESG 2120 o Specification Document(s): Section 6.3.2.6 of [[ this document ]] 2122 o Parameter Name: "oth" 2123 o Parameter Description: Other Primes Info 2124 o Used with "kty" Value(s): "RSA" 2125 o Parameter Information Class: Private 2126 o Change Controller: IESG 2127 o Specification Document(s): Section 6.3.2.7 of [[ this document ]] 2129 o Parameter Name: "k" 2130 o Parameter Description: Key Value 2131 o Used with "kty" Value(s): "oct" 2132 o Parameter Information Class: Private 2133 o Change Controller: IESG 2134 o Specification Document(s): Section 6.4.1 of [[ this document ]] 2136 7.6. JSON Web Key Elliptic Curve Registry 2138 This specification establishes the IANA JSON Web Key Elliptic Curve 2139 registry for JWK "crv" member values. The registry records the curve 2140 name, implementation requirements, and a reference to the 2141 specification that defines it. This specification registers the 2142 parameter names defined in Section 6.2.1.1. 2144 The implementation requirements of a curve may be changed over time 2145 as the cryptographic landscape evolves, for instance, to change the 2146 status of a curve to Deprecated, or to change the status of a curve 2147 from Optional to Recommended+ or Required. Changes of implementation 2148 requirements are only permitted on a Specification Required basis 2149 after review by the Designated Experts(s), with the new specification 2150 defining the revised implementation requirements level. 2152 7.6.1. Registration Template 2154 Curve Name: 2155 The name requested (e.g., "P-256"). Because a core goal of this 2156 specification is for the resulting representations to be compact, 2157 it is RECOMMENDED that the name be short -- not to exceed 8 2158 characters without a compelling reason to do so. This name is 2159 case-sensitive. Names may not match other registered names in a 2160 case-insensitive manner unless the Designated Expert(s) state that 2161 there is a compelling reason to allow an exception in this 2162 particular case. 2164 Curve Description: 2165 Brief description of the curve (e.g., "P-256 curve"). 2167 JOSE Implementation Requirements: 2168 The curve implementation requirements for JWS and JWE, which must 2169 be one the words Required, Recommended, Optional, Deprecated, or 2170 Prohibited. Optionally, the word can be followed by a "+" or "-". 2171 The use of "+" indicates that the requirement strength is likely 2172 to be increased in a future version of the specification. The use 2173 of "-" indicates that the requirement strength is likely to be 2174 decreased in a future version of the specification. 2176 Change Controller: 2177 For Standards Track RFCs, state "IESG". For others, give the name 2178 of the responsible party. Other details (e.g., postal address, 2179 email address, home page URI) may also be included. 2181 Specification Document(s): 2182 Reference to the document(s) that specify the parameter, 2183 preferably including URI(s) that can be used to retrieve copies of 2184 the document(s). An indication of the relevant sections may also 2185 be included but is not required. 2187 7.6.2. Initial Registry Contents 2189 o Curve Name: "P-256" 2190 o Curve Description: P-256 curve 2191 o JOSE Implementation Requirements: Recommended+ 2192 o Change Controller: IESG 2193 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2195 o Curve Name: "P-384" 2196 o Curve Description: P-384 curve 2197 o JOSE Implementation Requirements: Optional 2198 o Change Controller: IESG 2199 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2201 o Curve Name: "P-521" 2202 o Curve Description: P-521 curve 2203 o JOSE Implementation Requirements: Optional 2204 o Change Controller: IESG 2205 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2207 8. Security Considerations 2209 All of the security issues that are pertinent to any cryptographic 2210 application must be addressed by JWS/JWE/JWK agents. Among these 2211 issues are protecting the user's asymmetric private and symmetric 2212 secret keys and employing countermeasures to various attacks. 2214 The security considerations in [AES], [DSS], [JWE], [JWK], [JWS], 2215 [NIST.800-38D], [NIST.800-56A], [NIST.800-107], [RFC2104], [RFC3394], 2216 [RFC3447], [RFC5116], [RFC6090], and [SHS] apply to this 2217 specification. 2219 8.1. Cryptographic Agility 2221 Implementers should be aware that cryptographic algorithms become 2222 weaker with time. As new cryptanalysis techniques are developed and 2223 computing performance improves, the work factor to break a particular 2224 cryptographic algorithm will be reduced. Therefore, implementers and 2225 deployments must be prepared for the set of algorithms that are 2226 supported and used to change over time. Thus, cryptographic 2227 algorithm implementations should be modular, allowing new algorithms 2228 to be readily inserted. 2230 8.2. Key Lifetimes 2232 Many algorithms have associated security considerations related to 2233 key lifetimes and/or the number of times that a key may be used. 2234 Those security considerations continue to apply when using those 2235 algorithms with JOSE data structures. See NIST SP 800-57 2236 [NIST.800-57] for specific guidance on key lifetimes. 2238 8.3. RSAES-PKCS1-v1_5 Security Considerations 2240 While Section 8 of RFC 3447 [RFC3447] explicitly calls for people not 2241 to adopt RSASSA-PKCS-v1_5 for new applications and instead requests 2242 that people transition to RSASSA-PSS, this specification does include 2243 RSASSA-PKCS-v1_5, for interoperability reasons, because it is 2244 commonly implemented. 2246 Keys used with RSAES-PKCS1-v1_5 must follow the constraints in 2247 Section 7.2 of RFC 3447. Also, keys with a low public key exponent 2248 value, as described in Section 3 of Twenty years of attacks on the 2249 RSA cryptosystem [Boneh99], must not be used. 2251 8.4. AES GCM Security Considerations 2253 Keys used with AES GCM must follow the constraints in Section 8.3 of 2254 [NIST.800-38D], which states: "The total number of invocations of the 2255 authenticated encryption function shall not exceed 2^32, including 2256 all IV lengths and all instances of the authenticated encryption 2257 function with the given key". In accordance with this rule, AES GCM 2258 MUST NOT be used with the same key value more than 2^32 times. 2260 An Initialization Vector value MUST NOT ever be used multiple times 2261 with the same AES GCM key. One way to prevent this is to store a 2262 counter with the key and increment it with every use. The counter 2263 can also be used to prevent exceeding the 2^32 limit above. 2265 This security consideration does not apply to the composite AES-CBC 2266 HMAC SHA-2 or AES Key Wrap algorithms. 2268 8.5. Unsecured JWS Security Considerations 2270 Unsecured JWSs (JWSs that use the "alg" value "none") provide no 2271 integrity protection. Thus, they must only be used in contexts in 2272 which the payload is secured by means other than a digital signature 2273 or MAC value, or need not be secured. 2275 An example means of preventing accepting Unsecured JWSs by default is 2276 for the "verify" method of a hypothetical JWS software library to 2277 have a Boolean "acceptUnsecured" parameter that indicates "none" is 2278 an acceptable "alg" value. As another example, the "verify" method 2279 might take a list of algorithms that are acceptable to the 2280 application as a parameter and would reject Unsecured JWS values if 2281 "none" is not in that list. 2283 The following example illustrates the reasons for not accepting 2284 Unsecured JWSs at a global level. Suppose an application accepts 2285 JWSs over two channels, (1) HTTP and (2) HTTPS with client 2286 authentication. It requires a JWS signature on objects received over 2287 HTTP, but accepts Unsecured JWSs over HTTPS. If the application were 2288 to globally indicate that "none" is acceptable, then an attacker 2289 could provide it with an Unsecured JWS over HTTP and still have that 2290 object successfully validate. Instead, the application needs to 2291 indicate acceptance of "none" for each object received over HTTPS 2292 (e.g., by setting "acceptUnsecured" to "true" for the first 2293 hypothetical JWS software library above), but not for each object 2294 received over HTTP. 2296 8.6. Denial of Service Attacks 2298 Receiving agents that validate signatures and sending agents that 2299 encrypt messages need to be cautious of cryptographic processing 2300 usage when validating signatures and encrypting messages using keys 2301 larger than those mandated in this specification. An attacker could 2302 supply content using keys that would result in excessive 2303 cryptographic processing, for example, keys larger than those 2304 mandated in this specification. Implementations should set and 2305 enforce upper limits on the key sizes they accept. Section 5.6.1 2306 (Comparable Algorithm Strengths) of NIST SP 800-57 [NIST.800-57] 2307 contains statements on largest approved key sizes that may be 2308 applicable. 2310 8.7. Reusing Key Material when Encrypting Keys 2312 It is NOT RECOMMENDED to reuse the same entire set of key material 2313 (Key Encryption Key, Content Encryption Key, Initialization Vector, 2314 etc.) to encrypt multiple JWK or JWK Set objects, or to encrypt the 2315 same JWK or JWK Set object multiple times. One suggestion for 2316 preventing re-use is to always generate at least one new piece of key 2317 material for each encryption operation (e.g., a new Content 2318 Encryption Key, a new Initialization Vector, and/or a new PBES2 2319 Salt), based on the considerations noted in this document as well as 2320 from RFC 4086 [RFC4086]. 2322 8.8. Password Considerations 2324 Passwords are vulnerable to a number of attacks. To help mitigate 2325 some of these limitations, this document applies principles from RFC 2326 2898 [RFC2898] to derive cryptographic keys from user-supplied 2327 passwords. 2329 However, the strength of the password still has a significant impact. 2330 A high-entropy password has greater resistance to dictionary attacks. 2331 [NIST.800-63-1] contains guidelines for estimating password entropy, 2332 which can help applications and users generate stronger passwords. 2334 An ideal password is one that is as large as (or larger than) the 2335 derived key length. However, passwords larger than a certain 2336 algorithm-specific size are first hashed, which reduces an attacker's 2337 effective search space to the length of the hash algorithm. It is 2338 RECOMMENDED that a password used for "PBES2-HS256+A128KW" be no 2339 shorter than 16 octets and no longer than 128 octets and a password 2340 used for "PBES2-HS512+A256KW" be no shorter than 32 octets and no 2341 longer than 128 octets long. 2343 Still, care needs to be taken in where and how password-based 2344 encryption is used. These algorithms can still be susceptible to 2345 dictionary-based attacks if the iteration count is too small; this is 2346 of particular concern if these algorithms are used to protect data 2347 that an attacker can have indefinite number of attempts to circumvent 2348 the protection, such as protected data stored on a file system. 2350 8.9. Key Entropy and Random Values 2352 See Section 10.1 of [JWS] for security considerations on key entropy 2353 and random values. 2355 8.10. Differences between Digital Signatures and MACs 2357 See Section 10.5 of [JWS] for security considerations on differences 2358 between digital signatures and MACs. 2360 8.11. Using Matching Algorithm Strengths 2362 See Section 11.3 of [JWE] for security considerations on using 2363 matching algorithm strengths. 2365 8.12. Adaptive Chosen-Ciphertext Attacks 2367 See Section 11.4 of [JWE] for security considerations on adaptive 2368 chosen-ciphertext attacks. 2370 8.13. Timing Attacks 2372 See Section 10.9 of [JWS] and Section 11.5 of [JWE] for security 2373 considerations on timing attacks. 2375 8.14. RSA Private Key Representations and Blinding 2377 See Section 9.3 of [JWK] for security considerations on RSA private 2378 key representations and blinding. 2380 9. Internationalization Considerations 2382 Passwords obtained from users are likely to require preparation and 2383 normalization to account for differences of octet sequences generated 2384 by different input devices, locales, etc. It is RECOMMENDED that 2385 applications to perform the steps outlined in 2386 [I-D.ietf-precis-saslprepbis] to prepare a password supplied directly 2387 by a user before performing key derivation and encryption. 2389 10. References 2391 10.1. Normative References 2393 [AES] National Institute of Standards and Technology (NIST), 2394 "Advanced Encryption Standard (AES)", FIPS PUB 197, 2395 November 2001. 2397 [Boneh99] "Twenty years of attacks on the RSA cryptosystem", Notices 2398 of the American Mathematical Society (AMS), Vol. 46, No. 2399 2, pp. 203-213 http://crypto.stanford.edu/~dabo/pubs/ 2400 papers/RSA-survey.pdf, 1999. 2402 [DSS] National Institute of Standards and Technology, "Digital 2403 Signature Standard (DSS)", FIPS PUB 186-4, July 2013. 2405 [JWE] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", 2406 draft-ietf-jose-json-web-encryption (work in progress), 2407 December 2014. 2409 [JWK] Jones, M., "JSON Web Key (JWK)", 2410 draft-ietf-jose-json-web-key (work in progress), 2411 December 2014. 2413 [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 2414 Signature (JWS)", draft-ietf-jose-json-web-signature (work 2415 in progress), December 2014. 2417 [NIST.800-38A] 2418 National Institute of Standards and Technology (NIST), 2419 "Recommendation for Block Cipher Modes of Operation", 2420 NIST PUB 800-38A, December 2001. 2422 [NIST.800-38D] 2423 National Institute of Standards and Technology (NIST), 2424 "Recommendation for Block Cipher Modes of Operation: 2425 Galois/Counter Mode (GCM) and GMAC", NIST PUB 800-38D, 2426 December 2001. 2428 [NIST.800-56A] 2429 National Institute of Standards and Technology (NIST), 2430 "Recommendation for Pair-Wise Key Establishment Schemes 2431 Using Discrete Logarithm Cryptography", NIST Special 2432 Publication 800-56A, Revision 2, May 2013. 2434 [NIST.800-57] 2435 National Institute of Standards and Technology (NIST), 2436 "Recommendation for Key Management - Part 1: General 2437 (Revision 3)", NIST Special Publication 800-57, Part 1, 2438 Revision 3, July 2012. 2440 [RFC20] Cerf, V., "ASCII format for Network Interchange", RFC 20, 2441 October 1969. 2443 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 2444 Hashing for Message Authentication", RFC 2104, 2445 February 1997. 2447 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2448 Requirement Levels", BCP 14, RFC 2119, March 1997. 2450 [RFC2898] Kaliski, B., "PKCS #5: Password-Based Cryptography 2451 Specification Version 2.0", RFC 2898, September 2000. 2453 [RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard 2454 (AES) Key Wrap Algorithm", RFC 3394, September 2002. 2456 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 2457 Standards (PKCS) #1: RSA Cryptography Specifications 2458 Version 2.1", RFC 3447, February 2003. 2460 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2461 10646", STD 63, RFC 3629, November 2003. 2463 [RFC4868] Kelly, S. and S. Frankel, "Using HMAC-SHA-256, HMAC-SHA- 2464 384, and HMAC-SHA-512 with IPsec", RFC 4868, May 2007. 2466 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2467 RFC 4949, August 2007. 2469 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 2470 RFC 5652, September 2009. 2472 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 2473 Curve Cryptography Algorithms", RFC 6090, February 2011. 2475 [RFC7159] Bray, T., "The JavaScript Object Notation (JSON) Data 2476 Interchange Format", RFC 7159, March 2014. 2478 [SEC1] Standards for Efficient Cryptography Group, "SEC 1: 2479 Elliptic Curve Cryptography", Version 2.0, May 2009. 2481 [SHS] National Institute of Standards and Technology, "Secure 2482 Hash Standard (SHS)", FIPS PUB 180-4, March 2012. 2484 10.2. Informative References 2486 [CanvasApp] 2487 Facebook, "Canvas Applications", 2010. 2489 [I-D.ietf-precis-saslprepbis] 2490 Saint-Andre, P. and A. Melnikov, "Preparation, 2491 Enforcement, and Comparison of Internationalized Strings 2492 Representing Usernames and Passwords", 2493 draft-ietf-precis-saslprepbis-12 (work in progress), 2494 December 2014. 2496 [I-D.mcgrew-aead-aes-cbc-hmac-sha2] 2497 McGrew, D., Foley, J., and K. Paterson, "Authenticated 2498 Encryption with AES-CBC and HMAC-SHA", 2499 draft-mcgrew-aead-aes-cbc-hmac-sha2-05 (work in progress), 2500 July 2014. 2502 [I-D.miller-jose-jwe-protected-jwk] 2503 Miller, M., "Using JavaScript Object Notation (JSON) Web 2504 Encryption (JWE) for Protecting JSON Web Key (JWK) 2505 Objects", draft-miller-jose-jwe-protected-jwk-02 (work in 2506 progress), June 2013. 2508 [I-D.rescorla-jsms] 2509 Rescorla, E. and J. Hildebrand, "JavaScript Message 2510 Security Format", draft-rescorla-jsms-00 (work in 2511 progress), March 2011. 2513 [JCA] Oracle, "Java Cryptography Architecture (JCA) Reference 2514 Guide", 2014. 2516 [JSE] Bradley, J. and N. Sakimura (editor), "JSON Simple 2517 Encryption", September 2010. 2519 [JSS] Bradley, J. and N. Sakimura (editor), "JSON Simple Sign", 2520 September 2010. 2522 [MagicSignatures] 2523 Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic 2524 Signatures", January 2011. 2526 [NIST.800-107] 2527 National Institute of Standards and Technology (NIST), 2528 "Recommendation for Applications Using Approved Hash 2529 Algorithms", NIST Special Publication 800-107, Revision 1, 2530 August 2012. 2532 [NIST.800-63-1] 2533 National Institute of Standards and Technology (NIST), 2534 "Electronic Authentication Guideline", NIST Special 2535 Publication 800-63-1, December 2011. 2537 [RFC2631] Rescorla, E., "Diffie-Hellman Key Agreement Method", 2538 RFC 2631, June 1999. 2540 [RFC3275] Eastlake, D., Reagle, J., and D. Solo, "(Extensible Markup 2541 Language) XML-Signature Syntax and Processing", RFC 3275, 2542 March 2002. 2544 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 2545 Requirements for Security", BCP 106, RFC 4086, June 2005. 2547 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 2548 Encryption", RFC 5116, January 2008. 2550 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2551 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2552 May 2008. 2554 [W3C.NOTE-xmldsig-core2-20130411] 2555 Eastlake, D., Reagle, J., Solo, D., Hirsch, F., Roessler, 2556 T., Yiu, K., Datta, P., and S. Cantor, "XML Signature 2557 Syntax and Processing Version 2.0", World Wide Web 2558 Consortium Note NOTE-xmldsig-core2-20130411, April 2013, 2559 . 2561 [W3C.REC-xmlenc-core-20021210] 2562 Eastlake, D. and J. Reagle, "XML Encryption Syntax and 2563 Processing", World Wide Web Consortium Recommendation REC- 2564 xmlenc-core-20021210, December 2002, 2565 . 2567 [W3C.REC-xmlenc-core1-20130411] 2568 Eastlake, D., Reagle, J., Hirsch, F., and T. Roessler, 2569 "XML Encryption Syntax and Processing Version 1.1", World 2570 Wide Web Consortium Recommendation REC-xmlenc-core1- 2571 20130411, April 2013, 2572 . 2574 Appendix A. Algorithm Identifier Cross-Reference 2576 This appendix contains tables cross-referencing the cryptographic 2577 algorithm identifier values defined in this specification with the 2578 equivalent identifiers used by other standards and software packages. 2579 See XML DSIG [RFC3275], XML DSIG 2.0 2580 [W3C.NOTE-xmldsig-core2-20130411], XML Encryption 2581 [W3C.REC-xmlenc-core-20021210], XML Encryption 1.1 2582 [W3C.REC-xmlenc-core1-20130411], and Java Cryptography Architecture 2583 [JCA] for more information about the names defined by those 2584 documents. 2586 A.1. Digital Signature/MAC Algorithm Identifier Cross-Reference 2588 This section contains a table cross-referencing the JWS digital 2589 signature and MAC "alg" (algorithm) values defined in this 2590 specification with the equivalent identifiers used by other standards 2591 and software packages. 2593 +-------+------------------------------+-------------+--------------+ 2594 | JWS | XML DSIG | JCA | OID | 2595 +-------+------------------------------+-------------+--------------+ 2596 | HS256 | http://www.w3.org/2001/04/xm | HmacSHA256 | 1.2.840.1135 | 2597 | | ldsig-more#hmac-sha256 | | 49.2.9 | 2598 | HS384 | http://www.w3.org/2001/04/xm | HmacSHA384 | 1.2.840.1135 | 2599 | | ldsig-more#hmac-sha384 | | 49.2.10 | 2600 | HS512 | http://www.w3.org/2001/04/xm | HmacSHA512 | 1.2.840.1135 | 2601 | | ldsig-more#hmac-sha512 | | 49.2.11 | 2602 | RS256 | http://www.w3.org/2001/04/xm | SHA256withR | 1.2.840.1135 | 2603 | | ldsig-more#rsa-sha256 | SA | 49.1.1.11 | 2604 | RS384 | http://www.w3.org/2001/04/xm | SHA384withR | 1.2.840.1135 | 2605 | | ldsig-more#rsa-sha384 | SA | 49.1.1.12 | 2606 | RS512 | http://www.w3.org/2001/04/xm | SHA512withR | 1.2.840.1135 | 2607 | | ldsig-more#rsa-sha512 | SA | 49.1.1.13 | 2608 | ES256 | http://www.w3.org/2001/04/xm | SHA256withE | 1.2.840.1004 | 2609 | | ldsig-more#ecdsa-sha256 | CDSA | 5.4.3.2 | 2610 | ES384 | http://www.w3.org/2001/04/xm | SHA384withE | 1.2.840.1004 | 2611 | | ldsig-more#ecdsa-sha384 | CDSA | 5.4.3.3 | 2612 | ES512 | http://www.w3.org/2001/04/xm | SHA512withE | 1.2.840.1004 | 2613 | | ldsig-more#ecdsa-sha512 | CDSA | 5.4.3.4 | 2614 | PS256 | http://www.w3.org/2007/05/xm | SHA256withR | 1.2.840.1135 | 2615 | | ldsig-more#sha256-rsa-MGF1 | SAandMGF1 | 49.1.1.10 | 2616 | PS384 | http://www.w3.org/2007/05/xm | SHA384withR | 1.2.840.1135 | 2617 | | ldsig-more#sha384-rsa-MGF1 | SAandMGF1 | 49.1.1.10 | 2618 | PS512 | http://www.w3.org/2007/05/xm | SHA512withR | 1.2.840.1135 | 2619 | | ldsig-more#sha512-rsa-MGF1 | SAandMGF1 | 49.1.1.10 | 2620 +-------+------------------------------+-------------+--------------+ 2622 A.2. Key Management Algorithm Identifier Cross-Reference 2624 This section contains a table cross-referencing the JWE "alg" 2625 (algorithm) values defined in this specification with the equivalent 2626 identifiers used by other standards and software packages. 2628 +----------+----------------------+-------------------+-------------+ 2629 | JWE | XML ENC | JCA | OID | 2630 +----------+----------------------+-------------------+-------------+ 2631 | RSA1_5 | http://www.w3.org/20 | RSA/ECB/PKCS1Padd | 1.2.840.113 | 2632 | | 01/04/xmlenc#rsa-1_5 | ing | 549.1.1.1 | 2633 | RSA-OAEP | http://www.w3.org/20 | RSA/ECB/OAEPWithS | 1.2.840.113 | 2634 | | 01/04/xmlenc#rsa-oae | HA-1AndMGF1Paddin | 549.1.1.7 | 2635 | | p-mgf1p | g | | 2636 | RSA-OAEP | http://www.w3.org/20 | RSA/ECB/OAEPWithS | 1.2.840.113 | 2637 | -256 | 09/xmlenc11#rsa-oaep | HA-256AndMGF1Padd | 549.1.1.7 | 2638 | | & | ing & | | 2639 | | http://www.w3.org/2 | MGF1ParameterSp | | 2640 | | 009/xmlenc11#mgf1sha | ec.SHA256 | | 2641 | | 256 | | | 2642 | ECDH-ES | http://www.w3.org/20 | ECDH | 1.3.132.1.1 | 2643 | | 09/xmlenc11#ECDH-ES | | 2 | 2644 | A128KW | http://www.w3.org/20 | AESWrap | 2.16.840.1. | 2645 | | 01/04/xmlenc#kw-aes1 | | 101.3.4.1.5 | 2646 | | 28 | | | 2647 | A192KW | http://www.w3.org/20 | AESWrap | 2.16.840.1. | 2648 | | 01/04/xmlenc#kw-aes1 | | 101.3.4.1.2 | 2649 | | 92 | | 5 | 2650 | A256KW | http://www.w3.org/20 | AESWrap | 2.16.840.1. | 2651 | | 01/04/xmlenc#kw-aes2 | | 101.3.4.1.4 | 2652 | | 56 | | 5 | 2653 +----------+----------------------+-------------------+-------------+ 2655 A.3. Content Encryption Algorithm Identifier Cross-Reference 2657 This section contains a table cross-referencing the JWE "enc" 2658 (encryption algorithm) values defined in this specification with the 2659 equivalent identifiers used by other standards and software packages. 2661 For the composite algorithms "A128CBC-HS256", "A192CBC-HS384", and 2662 "A256CBC-HS512", the corresponding AES CBC algorithm identifiers are 2663 listed. 2665 +----------+-------------------------+--------------+---------------+ 2666 | JWE | XML ENC | JCA | OID | 2667 +----------+-------------------------+--------------+---------------+ 2668 | A128CBC- | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.10 | 2669 | HS256 | 04/xmlenc#aes128-cbc | 5Padding | 1.3.4.1.2 | 2670 | A192CBC- | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.10 | 2671 | HS384 | 04/xmlenc#aes192-cbc | 5Padding | 1.3.4.1.22 | 2672 | A256CBC- | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.10 | 2673 | HS512 | 04/xmlenc#aes256-cbc | 5Padding | 1.3.4.1.42 | 2674 | A128GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.10 | 2675 | | xmlenc11#aes128-gcm | dding | 1.3.4.1.6 | 2676 | A192GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.10 | 2677 | | xmlenc11#aes192-gcm | dding | 1.3.4.1.26 | 2678 | A256GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.10 | 2679 | | xmlenc11#aes256-gcm | dding | 1.3.4.1.46 | 2680 +----------+-------------------------+--------------+---------------+ 2682 Appendix B. Test Cases for AES_CBC_HMAC_SHA2 Algorithms 2684 The following test cases can be used to validate implementations of 2685 the AES_CBC_HMAC_SHA2 algorithms defined in Section 5.2. They are 2686 also intended to correspond to test cases that may appear in a future 2687 version of [I-D.mcgrew-aead-aes-cbc-hmac-sha2], demonstrating that 2688 the cryptographic computations performed are the same. 2690 The variable names are those defined in Section 5.2. All values are 2691 hexadecimal. 2693 B.1. Test Cases for AES_128_CBC_HMAC_SHA_256 2695 AES_128_CBC_HMAC_SHA_256 2697 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2698 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2700 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2702 ENC_KEY = 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2704 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2705 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2706 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2707 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2708 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2709 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2710 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2711 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2713 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2715 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2716 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2717 4b 65 72 63 6b 68 6f 66 66 73 2719 AL = 00 00 00 00 00 00 01 50 2721 E = c8 0e df a3 2d df 39 d5 ef 00 c0 b4 68 83 42 79 2722 a2 e4 6a 1b 80 49 f7 92 f7 6b fe 54 b9 03 a9 c9 2723 a9 4a c9 b4 7a d2 65 5c 5f 10 f9 ae f7 14 27 e2 2724 fc 6f 9b 3f 39 9a 22 14 89 f1 63 62 c7 03 23 36 2725 09 d4 5a c6 98 64 e3 32 1c f8 29 35 ac 40 96 c8 2726 6e 13 33 14 c5 40 19 e8 ca 79 80 df a4 b9 cf 1b 2727 38 4c 48 6f 3a 54 c5 10 78 15 8e e5 d7 9d e5 9f 2728 bd 34 d8 48 b3 d6 95 50 a6 76 46 34 44 27 ad e5 2729 4b 88 51 ff b5 98 f7 f8 00 74 b9 47 3c 82 e2 db 2731 M = 65 2c 3f a3 6b 0a 7c 5b 32 19 fa b3 a3 0b c1 c4 2732 e6 e5 45 82 47 65 15 f0 ad 9f 75 a2 b7 1c 73 ef 2734 T = 65 2c 3f a3 6b 0a 7c 5b 32 19 fa b3 a3 0b c1 c4 2736 B.2. Test Cases for AES_192_CBC_HMAC_SHA_384 2738 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2739 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2740 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2742 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2743 10 11 12 13 14 15 16 17 2745 ENC_KEY = 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 2746 28 29 2a 2b 2c 2d 2e 2f 2748 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2749 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2750 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2751 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2752 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2753 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2754 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2755 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2757 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2759 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2760 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2761 4b 65 72 63 6b 68 6f 66 66 73 2763 AL = 00 00 00 00 00 00 01 50 2765 E = ea 65 da 6b 59 e6 1e db 41 9b e6 2d 19 71 2a e5 2766 d3 03 ee b5 00 52 d0 df d6 69 7f 77 22 4c 8e db 2767 00 0d 27 9b dc 14 c1 07 26 54 bd 30 94 42 30 c6 2768 57 be d4 ca 0c 9f 4a 84 66 f2 2b 22 6d 17 46 21 2769 4b f8 cf c2 40 0a dd 9f 51 26 e4 79 66 3f c9 0b 2770 3b ed 78 7a 2f 0f fc bf 39 04 be 2a 64 1d 5c 21 2771 05 bf e5 91 ba e2 3b 1d 74 49 e5 32 ee f6 0a 9a 2772 c8 bb 6c 6b 01 d3 5d 49 78 7b cd 57 ef 48 49 27 2773 f2 80 ad c9 1a c0 c4 e7 9c 7b 11 ef c6 00 54 e3 2775 M = 84 90 ac 0e 58 94 9b fe 51 87 5d 73 3f 93 ac 20 2776 75 16 80 39 cc c7 33 d7 45 94 f8 86 b3 fa af d4 2777 86 f2 5c 71 31 e3 28 1e 36 c7 a2 d1 30 af de 57 2779 T = 84 90 ac 0e 58 94 9b fe 51 87 5d 73 3f 93 ac 20 2780 75 16 80 39 cc c7 33 d7 2782 B.3. Test Cases for AES_256_CBC_HMAC_SHA_512 2784 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2785 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2786 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2787 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 2789 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2790 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2792 ENC_KEY = 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2793 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 2795 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2796 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2797 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2798 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2799 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2800 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2801 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2802 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2804 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2806 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2807 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2808 4b 65 72 63 6b 68 6f 66 66 73 2810 AL = 00 00 00 00 00 00 01 50 2812 E = 4a ff aa ad b7 8c 31 c5 da 4b 1b 59 0d 10 ff bd 2813 3d d8 d5 d3 02 42 35 26 91 2d a0 37 ec bc c7 bd 2814 82 2c 30 1d d6 7c 37 3b cc b5 84 ad 3e 92 79 c2 2815 e6 d1 2a 13 74 b7 7f 07 75 53 df 82 94 10 44 6b 2816 36 eb d9 70 66 29 6a e6 42 7e a7 5c 2e 08 46 a1 2817 1a 09 cc f5 37 0d c8 0b fe cb ad 28 c7 3f 09 b3 2818 a3 b7 5e 66 2a 25 94 41 0a e4 96 b2 e2 e6 60 9e 2819 31 e6 e0 2c c8 37 f0 53 d2 1f 37 ff 4f 51 95 0b 2820 be 26 38 d0 9d d7 a4 93 09 30 80 6d 07 03 b1 f6 2822 M = 4d d3 b4 c0 88 a7 f4 5c 21 68 39 64 5b 20 12 bf 2823 2e 62 69 a8 c5 6a 81 6d bc 1b 26 77 61 95 5b c5 2824 fd 30 a5 65 c6 16 ff b2 f3 64 ba ec e6 8f c4 07 2825 53 bc fc 02 5d de 36 93 75 4a a1 f5 c3 37 3b 9c 2827 T = 4d d3 b4 c0 88 a7 f4 5c 21 68 39 64 5b 20 12 bf 2828 2e 62 69 a8 c5 6a 81 6d bc 1b 26 77 61 95 5b c5 2830 Appendix C. Example ECDH-ES Key Agreement Computation 2832 This example uses ECDH-ES Key Agreement and the Concat KDF to derive 2833 the Content Encryption Key (CEK) in the manner described in 2834 Section 4.6. In this example, the ECDH-ES Direct Key Agreement mode 2835 ("alg" value "ECDH-ES") is used to produce an agreed upon key for AES 2836 GCM with a 128 bit key ("enc" value "A128GCM"). 2838 In this example, a producer Alice is encrypting content to a consumer 2839 Bob. The producer (Alice) generates an ephemeral key for the key 2840 agreement computation. Alice's ephemeral key (in JWK format) used 2841 for the key agreement computation in this example (including the 2842 private part) is: 2844 {"kty":"EC", 2845 "crv":"P-256", 2846 "x":"gI0GAILBdu7T53akrFmMyGcsF3n5dO7MmwNBHKW5SV0", 2847 "y":"SLW_xSffzlPWrHEVI30DHM_4egVwt3NQqeUD7nMFpps", 2848 "d":"0_NxaRPUMQoAJt50Gz8YiTr8gRTwyEaCumd-MToTmIo" 2849 } 2851 The consumer's (Bob's) key (in JWK format) used for the key agreement 2852 computation in this example (including the private part) is: 2854 {"kty":"EC", 2855 "crv":"P-256", 2856 "x":"weNJy2HscCSM6AEDTDg04biOvhFhyyWvOHQfeF_PxMQ", 2857 "y":"e8lnCO-AlStT-NJVX-crhB7QRYhiix03illJOVAOyck", 2858 "d":"VEmDZpDXXK8p8N0Cndsxs924q6nS1RXFASRl6BfUqdw" 2859 } 2861 Header Parameter values used in this example are as follows. In this 2862 example, the "apu" (agreement PartyUInfo) parameter value is the 2863 base64url encoding of the UTF-8 string "Alice" and the "apv" 2864 (agreement PartyVInfo) parameter value is the base64url encoding of 2865 the UTF-8 string "Bob". The "epk" parameter is used to communicate 2866 the producer's (Alice's) ephemeral public key value to the consumer 2867 (Bob). 2869 {"alg":"ECDH-ES", 2870 "enc":"A128GCM", 2871 "apu":"QWxpY2U", 2872 "apv":"Qm9i", 2873 "epk": 2874 {"kty":"EC", 2875 "crv":"P-256", 2876 "x":"gI0GAILBdu7T53akrFmMyGcsF3n5dO7MmwNBHKW5SV0", 2877 "y":"SLW_xSffzlPWrHEVI30DHM_4egVwt3NQqeUD7nMFpps" 2878 } 2879 } 2881 The resulting Concat KDF [NIST.800-56A] parameter values are: 2883 Z 2884 This is set to the ECDH-ES key agreement output. (This value is 2885 often not directly exposed by libraries, due to NIST security 2886 requirements, and only serves as an input to a KDF.) In this 2887 example, Z is following the octet sequence (using JSON array 2888 notation): 2889 [158, 86, 217, 29, 129, 113, 53, 211, 114, 131, 66, 131, 191, 132, 2890 38, 156, 251, 49, 110, 163, 218, 128, 106, 72, 246, 218, 167, 121, 2891 140, 254, 144, 196]. 2893 keydatalen 2894 This value is 128 - the number of bits in the desired output key 2895 (because "A128GCM" uses a 128 bit key). 2897 AlgorithmID 2898 This is set to the octets representing the 32 bit big endian value 2899 7 - [0, 0, 0, 7] - the number of octets in the AlgorithmID content 2900 "A128GCM", followed, by the octets representing the ASCII string 2901 "A128GCM" - [65, 49, 50, 56, 71, 67, 77]. 2903 PartyUInfo 2904 This is set to the octets representing the 32 bit big endian value 2905 5 - [0, 0, 0, 5] - the number of octets in the PartyUInfo content 2906 "Alice", followed, by the octets representing the UTF-8 string 2907 "Alice" - [65, 108, 105, 99, 101]. 2909 PartyVInfo 2910 This is set to the octets representing the 32 bit big endian value 2911 3 - [0, 0, 0, 3] - the number of octets in the PartyUInfo content 2912 "Bob", followed, by the octets representing the UTF-8 string "Bob" 2913 - [66, 111, 98]. 2915 SuppPubInfo 2916 This is set to the octets representing the 32 bit big endian value 2917 128 - [0, 0, 0, 128] - the keydatalen value. 2919 SuppPrivInfo 2920 This is set to the empty octet sequence. 2922 Concatenating the parameters AlgorithmID through SuppPubInfo results 2923 in an OtherInfo value of: 2924 [0, 0, 0, 7, 65, 49, 50, 56, 71, 67, 77, 0, 0, 0, 5, 65, 108, 105, 2925 99, 101, 0, 0, 0, 3, 66, 111, 98, 0, 0, 0, 128] 2927 Concatenating the round number 1 ([0, 0, 0, 1]), Z, and the OtherInfo 2928 value results in the Concat KDF round 1 hash input of: 2929 [0, 0, 0, 1, 2930 158, 86, 217, 29, 129, 113, 53, 211, 114, 131, 66, 131, 191, 132, 38, 2931 156, 251, 49, 110, 163, 218, 128, 106, 72, 246, 218, 167, 121, 140, 2932 254, 144, 196, 2933 0, 0, 0, 7, 65, 49, 50, 56, 71, 67, 77, 0, 0, 0, 5, 65, 108, 105, 99, 2934 101, 0, 0, 0, 3, 66, 111, 98, 0, 0, 0, 128] 2936 The resulting derived key, which is the first 128 bits of the round 1 2937 hash output is: 2938 [86, 170, 141, 234, 248, 35, 109, 32, 92, 34, 40, 205, 113, 167, 16, 2939 26] 2941 The base64url encoded representation of this derived key is: 2943 VqqN6vgjbSBcIijNcacQGg 2945 Appendix D. Acknowledgements 2947 Solutions for signing and encrypting JSON content were previously 2948 explored by Magic Signatures [MagicSignatures], JSON Simple Sign 2949 [JSS], Canvas Applications [CanvasApp], JSON Simple Encryption [JSE], 2950 and JavaScript Message Security Format [I-D.rescorla-jsms], all of 2951 which influenced this draft. 2953 The Authenticated Encryption with AES-CBC and HMAC-SHA 2954 [I-D.mcgrew-aead-aes-cbc-hmac-sha2] specification, upon which the 2955 AES_CBC_HMAC_SHA2 algorithms are based, was written by David A. 2956 McGrew and Kenny Paterson. The test cases for AES_CBC_HMAC_SHA2 are 2957 based upon those for [I-D.mcgrew-aead-aes-cbc-hmac-sha2] by John 2958 Foley. 2960 Matt Miller wrote Using JavaScript Object Notation (JSON) Web 2961 Encryption (JWE) for Protecting JSON Web Key (JWK) Objects 2963 [I-D.miller-jose-jwe-protected-jwk], which the password-based 2964 encryption content of this draft is based upon. 2966 This specification is the work of the JOSE Working Group, which 2967 includes dozens of active and dedicated participants. In particular, 2968 the following individuals contributed ideas, feedback, and wording 2969 that influenced this specification: 2971 Dirk Balfanz, Richard Barnes, Carsten Bormann, John Bradley, Brian 2972 Campbell, Alissa Cooper, Breno de Medeiros, Vladimir Dzhuvinov, Roni 2973 Even, Stephen Farrell, Yaron Y. Goland, Dick Hardt, Joe Hildebrand, 2974 Jeff Hodges, Edmund Jay, Charlie Kaufman, Barry Leiba, James Manger, 2975 Matt Miller, Kathleen Moriarty, Tony Nadalin, Axel Nennker, John 2976 Panzer, Emmanuel Raviart, Eric Rescorla, Pete Resnick, Nat Sakimura, 2977 Jim Schaad, Hannes Tschofenig, and Sean Turner. 2979 Jim Schaad and Karen O'Donoghue chaired the JOSE working group and 2980 Sean Turner, Stephen Farrell, and Kathleen Moriarty served as 2981 Security area directors during the creation of this specification. 2983 Appendix E. Document History 2985 [[ to be removed by the RFC Editor before publication as an RFC ]] 2987 -38 2989 o Require discarding private keys with an "oth" parameter when the 2990 implementation does not support private keys with more than two 2991 primes. 2993 o Replaced uses of the phrases "JWS object" and "JWE object" with 2994 "JWS" and "JWE". 2996 -37 2998 o Restricted algorithm names to using only ASCII characters. 3000 o Added language about ignoring private keys with an "oth" parameter 3001 when the implementation does not support private keys with more 3002 than two primes. 3004 o Updated the example IANA registration request subject line. 3006 -36 3008 o Moved the normative "alg":"none" security considerations text into 3009 the algorithm definition. 3011 o Specified that registration reviews occur on the 3012 jose-reg-review@ietf.org mailing list. 3014 -35 3016 o Addressed AppsDir reviews by Carsten Bormann. 3018 o Adjusted some table column widths. 3020 -34 3022 o Addressed IESG review comments by Barry Leiba, Alissa Cooper, Pete 3023 Resnick, Stephen Farrell, and Richard Barnes. 3025 -33 3027 o Changed the registration review period to three weeks. 3029 o Acknowledged additional contributors. 3031 -32 3033 o Added a note to implementers about libraries that prefix an extra 3034 zero-valued octet to RSA modulus representations returned. 3036 o Addressed secdir review comments by Charlie Kaufman, Scott Kelly, 3037 and Stephen Kent. 3039 o Addressed Gen-ART review comments by Roni Even. 3041 o Replaced the term Plaintext JWS with Unsecured JWS. 3043 -31 3045 o Referenced NIST SP 800-57 for guidance on key lifetimes. 3047 o Updated the reference to draft-mcgrew-aead-aes-cbc-hmac-sha2. 3049 -30 3051 o Cleaned up the reference syntax in a few places. 3053 o Applied minor wording changes to the Security Considerations 3054 section. 3056 -29 3057 o Replaced the terms JWS Header, JWE Header, and JWT Header with a 3058 single JOSE Header term defined in the JWS specification. This 3059 also enabled a single Header Parameter definition to be used and 3060 reduced other areas of duplication between specifications. 3062 -28 3064 o Specified the use of PKCS #7 padding with AES CBC, rather than 3065 PKCS #5. (PKCS #7 is a superset of PKCS #5, and is appropriate 3066 for the 16 octet blocks used by AES CBC.) 3068 o Revised the introduction to the Security Considerations section. 3069 Also introduced additional subsection headings for security 3070 considerations items and moved a few security consideration items 3071 from here to the JWS and JWE drafts. 3073 -27 3075 o Described additional security considerations. 3077 o Updated the JCA and XMLENC parameters for "RSA-OAEP-256" and the 3078 JCA parameters for "A128KW", "A192KW", "A256KW", and "ECDH-ES". 3080 -26 3082 o Added algorithm identifier "RSA-OAEP-256" for RSAES OAEP using 3083 SHA-256 and MGF1 with SHA-256. 3085 o Clarified that the ECDSA signature values R and S are represented 3086 as octet sequences as defined in Section 2.3.7 of SEC1 [SEC1]. 3088 o Noted that octet sequences are depicted using JSON array notation. 3090 o Updated references, including to W3C specifications. 3092 -25 3094 o Corrected an external section number reference that had changed. 3096 -24 3098 o Replaced uses of the term "associated data" wherever it was used 3099 to refer to a data value with "additional authenticated data", 3100 since both terms were being used as synonyms, causing confusion. 3102 o Updated the JSON reference to RFC 7159. 3104 -23 3105 o No changes were made, other than to the version number and date. 3107 -22 3109 o Corrected RFC 2119 terminology usage. 3111 o Replaced references to draft-ietf-json-rfc4627bis with RFC 7158. 3113 -21 3115 o Compute the PBES2 salt parameter as (UTF8(Alg) || 0x00 || Salt 3116 Input), where the "p2s" Header Parameter encodes the Salt Input 3117 value and Alg is the "alg" Header Parameter value. 3119 o Changed some references from being normative to informative, 3120 addressing issue #90. 3122 -20 3124 o Replaced references to RFC 4627 with draft-ietf-json-rfc4627bis, 3125 addressing issue #90. 3127 -19 3129 o Used tables to show the correspondence between algorithm 3130 identifiers and algorithm descriptions and parameters in the 3131 algorithm definition sections, addressing issue #183. 3133 o Changed the "Implementation Requirements" registry field names to 3134 "JOSE Implementation Requirements" to make it clear that these 3135 implementation requirements apply only to JWS and JWE 3136 implementations. 3138 -18 3140 o Changes to address editorial and minor issues #129, #134, #135, 3141 #158, #161, #185, #186, and #187. 3143 o Added and used Description registry fields. 3145 -17 3147 o Explicitly named all the logical components of a JWS and JWE and 3148 defined the processing rules and serializations in terms of those 3149 components, addressing issues #60, #61, and #62. 3151 o Removed processing steps in algorithm definitions that duplicated 3152 processing steps in JWS or JWE, addressing issue #56. 3154 o Replaced verbose repetitive phases such as "base64url encode the 3155 octets of the UTF-8 representation of X" with mathematical 3156 notation such as "BASE64URL(UTF8(X))". 3158 o Terms used in multiple documents are now defined in one place and 3159 incorporated by reference. Some lightly used or obvious terms 3160 were also removed. This addresses issue #58. 3162 o Changes to address minor issue #53. 3164 -16 3166 o Added a DataLen prefix to the AlgorithmID value in the Concat KDF 3167 computation. 3169 o Added OIDs for encryption algorithms, additional signature 3170 algorithm OIDs, and additional XML DSIG/ENC URIs in the algorithm 3171 cross-reference tables. 3173 o Changes to address editorial and minor issues #28, #36, #39, #52, 3174 #53, #55, #127, #128, #136, #137, #141, #150, #151, #152, and 3175 #155. 3177 -15 3179 o Changed statements about rejecting JWSs to statements about 3180 validation failing, addressing issue #35. 3182 o Stated that changes of implementation requirements are only 3183 permitted on a Specification Required basis, addressing issue #38. 3185 o Made "oct" a required key type, addressing issue #40. 3187 o Updated the example ECDH-ES key agreement values. 3189 o Changes to address editorial and minor issues #34, #37, #49, #63, 3190 #123, #124, #125, #130, #132, #133, #138, #139, #140, #142, #143, 3191 #144, #145, #148, #149, #150, and #162. 3193 -14 3195 o Removed "PBKDF2" key type and added "p2s" and "p2c" header 3196 parameters for use with the PBES2 algorithms. 3198 o Made the RSA private key parameters that are there to enable 3199 optimizations be RECOMMENDED rather than REQUIRED. 3201 o Added algorithm identifiers for AES algorithms using 192 bit keys 3202 and for RSASSA-PSS using HMAC SHA-384. 3204 o Added security considerations about key lifetimes, addressing 3205 issue #18. 3207 o Added an example ECDH-ES key agreement computation. 3209 -13 3211 o Added key encryption with AES GCM as specified in 3212 draft-jones-jose-aes-gcm-key-wrap-01, addressing issue #13. 3214 o Added security considerations text limiting the number of times 3215 that an AES GCM key can be used for key encryption or direct 3216 encryption, per Section 8.3 of NIST SP 800-38D, addressing issue 3217 #28. 3219 o Added password-based key encryption as specified in 3220 draft-miller-jose-jwe-protected-jwk-02. 3222 -12 3224 o In the Direct Key Agreement case, the Concat KDF AlgorithmID is 3225 set to the octets of the UTF-8 representation of the "enc" header 3226 parameter value. 3228 o Restored the "apv" (agreement PartyVInfo) parameter. 3230 o Moved the "epk", "apu", and "apv" Header Parameter definitions to 3231 be with the algorithm descriptions that use them. 3233 o Changed terminology from "block encryption" to "content 3234 encryption". 3236 -11 3238 o Removed the Encrypted Key value from the AAD computation since it 3239 is already effectively integrity protected by the encryption 3240 process. The AAD value now only contains the representation of 3241 the JWE Encrypted Header. 3243 o Removed "apv" (agreement PartyVInfo) since it is no longer used. 3245 o Added more information about the use of PartyUInfo during key 3246 agreement. 3248 o Use the keydatalen as the SuppPubInfo value for the Concat KDF 3249 when doing key agreement, as RFC 2631 does. 3251 o Added algorithm identifiers for RSASSA-PSS with SHA-256 and SHA- 3252 512. 3254 o Added a Parameter Information Class value to the JSON Web Key 3255 Parameters registry, which registers whether the parameter conveys 3256 public or private information. 3258 -10 3260 o Changed the JWE processing rules for multiple recipients so that a 3261 single AAD value contains the header parameters and encrypted key 3262 values for all the recipients, enabling AES GCM to be safely used 3263 for multiple recipients. 3265 -09 3267 o Expanded the scope of the JWK parameters to include private and 3268 symmetric key representations, as specified by 3269 draft-jones-jose-json-private-and-symmetric-key-00. 3271 o Changed term "JWS Secured Input" to "JWS Signing Input". 3273 o Changed from using the term "byte" to "octet" when referring to 8 3274 bit values. 3276 o Specified that AES Key Wrap uses the default initial value 3277 specified in Section 2.2.3.1 of RFC 3394. This addressed issue 3278 #19. 3280 o Added Key Management Mode definitions to terminology section and 3281 used the defined terms to provide clearer key management 3282 instructions. This addressed issue #5. 3284 o Replaced "A128CBC+HS256" and "A256CBC+HS512" with "A128CBC-HS256" 3285 and "A256CBC-HS512". The new algorithms perform the same 3286 cryptographic computations as [I-D.mcgrew-aead-aes-cbc-hmac-sha2], 3287 but with the Initialization Vector and Authentication Tag values 3288 remaining separate from the Ciphertext value in the output 3289 representation. Also deleted the header parameters "epu" 3290 (encryption PartyUInfo) and "epv" (encryption PartyVInfo), since 3291 they are no longer used. 3293 o Changed from using the term "Integrity Value" to "Authentication 3294 Tag". 3296 -08 3298 o Changed the name of the JWK key type parameter from "alg" to 3299 "kty". 3301 o Replaced uses of the term "AEAD" with "Authenticated Encryption", 3302 since the term AEAD in the RFC 5116 sense implied the use of a 3303 particular data representation, rather than just referring to the 3304 class of algorithms that perform authenticated encryption with 3305 associated data. 3307 o Applied editorial improvements suggested by Jeff Hodges. Many of 3308 these simplified the terminology used. 3310 o Added seriesInfo information to Internet Draft references. 3312 -07 3314 o Added a data length prefix to PartyUInfo and PartyVInfo values. 3316 o Changed the name of the JWK RSA modulus parameter from "mod" to 3317 "n" and the name of the JWK RSA exponent parameter from "xpo" to 3318 "e", so that the identifiers are the same as those used in RFC 3319 3447. 3321 o Made several local editorial changes to clean up loose ends left 3322 over from to the decision to only support block encryption methods 3323 providing integrity. 3325 -06 3327 o Removed the "int" and "kdf" parameters and defined the new 3328 composite Authenticated Encryption algorithms "A128CBC+HS256" and 3329 "A256CBC+HS512" to replace the former uses of AES CBC, which 3330 required the use of separate integrity and key derivation 3331 functions. 3333 o Included additional values in the Concat KDF calculation -- the 3334 desired output size and the algorithm value, and optionally 3335 PartyUInfo and PartyVInfo values. Added the optional header 3336 parameters "apu" (agreement PartyUInfo), "apv" (agreement 3337 PartyVInfo), "epu" (encryption PartyUInfo), and "epv" (encryption 3338 PartyVInfo). 3340 o Changed the name of the JWK RSA exponent parameter from "exp" to 3341 "xpo" so as to allow the potential use of the name "exp" for a 3342 future extension that might define an expiration parameter for 3343 keys. (The "exp" name is already used for this purpose in the JWT 3344 specification.) 3346 o Applied changes made by the RFC Editor to RFC 6749's registry 3347 language to this specification. 3349 -05 3351 o Support both direct encryption using a shared or agreed upon 3352 symmetric key, and the use of a shared or agreed upon symmetric 3353 key to key wrap the CMK. Specifically, added the "alg" values 3354 "dir", "ECDH-ES+A128KW", and "ECDH-ES+A256KW" to finish filling in 3355 this set of capabilities. 3357 o Updated open issues. 3359 -04 3361 o Added text requiring that any leading zero bytes be retained in 3362 base64url encoded key value representations for fixed-length 3363 values. 3365 o Added this language to Registration Templates: "This name is case 3366 sensitive. Names that match other registered names in a case 3367 insensitive manner SHOULD NOT be accepted." 3369 o Described additional open issues. 3371 o Applied editorial suggestions. 3373 -03 3375 o Always use a 128 bit "authentication tag" size for AES GCM, 3376 regardless of the key size. 3378 o Specified that use of a 128 bit IV is REQUIRED with AES CBC. It 3379 was previously RECOMMENDED. 3381 o Removed key size language for ECDSA algorithms, since the key size 3382 is implied by the algorithm being used. 3384 o Stated that the "int" key size must be the same as the hash output 3385 size (and not larger, as was previously allowed) so that its size 3386 is defined for key generation purposes. 3388 o Added the "kdf" (key derivation function) header parameter to 3389 provide crypto agility for key derivation. The default KDF 3390 remains the Concat KDF with the SHA-256 digest function. 3392 o Clarified that the "mod" and "exp" values are unsigned. 3394 o Added Implementation Requirements columns to algorithm tables and 3395 Implementation Requirements entries to algorithm registries. 3397 o Changed AES Key Wrap to RECOMMENDED. 3399 o Moved registries JSON Web Signature and Encryption Header 3400 Parameters and JSON Web Signature and Encryption Type Values to 3401 the JWS specification. 3403 o Moved JSON Web Key Parameters registry to the JWK specification. 3405 o Changed registration requirements from RFC Required to 3406 Specification Required with Expert Review. 3408 o Added Registration Template sections for defined registries. 3410 o Added Registry Contents sections to populate registry values. 3412 o No longer say "the UTF-8 representation of the JWS Secured Input 3413 (which is the same as the ASCII representation)". Just call it 3414 "the ASCII representation of the JWS Secured Input". 3416 o Added "Collision Resistant Namespace" to the terminology section. 3418 o Numerous editorial improvements. 3420 -02 3422 o For AES GCM, use the "additional authenticated data" parameter to 3423 provide integrity for the header, encrypted key, and ciphertext 3424 and use the resulting "authentication tag" value as the JWE 3425 Authentication Tag. 3427 o Defined minimum required key sizes for algorithms without 3428 specified key sizes. 3430 o Defined KDF output key sizes. 3432 o Specified the use of PKCS #5 padding with AES CBC. 3434 o Generalized text to allow key agreement to be employed as an 3435 alternative to key wrapping or key encryption. 3437 o Clarified that ECDH-ES is a key agreement algorithm. 3439 o Required implementation of AES-128-KW and AES-256-KW. 3441 o Removed the use of "A128GCM" and "A256GCM" for key wrapping. 3443 o Removed "A512KW" since it turns out that it's not a standard 3444 algorithm. 3446 o Clarified the relationship between "typ" header parameter values 3447 and MIME types. 3449 o Generalized language to refer to Message Authentication Codes 3450 (MACs) rather than Hash-based Message Authentication Codes (HMACs) 3451 unless in a context specific to HMAC algorithms. 3453 o Established registries: JSON Web Signature and Encryption Header 3454 Parameters, JSON Web Signature and Encryption Algorithms, JSON Web 3455 Signature and Encryption "typ" Values, JSON Web Key Parameters, 3456 and JSON Web Key Algorithm Families. 3458 o Moved algorithm-specific definitions from JWK to JWA. 3460 o Reformatted to give each member definition its own section 3461 heading. 3463 -01 3465 o Moved definition of "alg":"none" for JWSs here from the JWT 3466 specification since this functionality is likely to be useful in 3467 more contexts that just for JWTs. 3469 o Added Advanced Encryption Standard (AES) Key Wrap Algorithm using 3470 512 bit keys ("A512KW"). 3472 o Added text "Alternatively, the Encoded JWS Signature MAY be 3473 base64url decoded to produce the JWS Signature and this value can 3474 be compared with the computed HMAC value, as this comparison 3475 produces the same result as comparing the encoded values". 3477 o Corrected the Magic Signatures reference. 3479 o Made other editorial improvements suggested by JOSE working group 3480 participants. 3482 -00 3484 o Created the initial IETF draft based upon 3485 draft-jones-json-web-signature-04 and 3486 draft-jones-json-web-encryption-02 with no normative changes. 3488 o Changed terminology to no longer call both digital signatures and 3489 HMACs "signatures". 3491 Author's Address 3493 Michael B. Jones 3494 Microsoft 3496 Email: mbj@microsoft.com 3497 URI: http://self-issued.info/