idnits 2.17.1 draft-ietf-jose-json-web-algorithms-35.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 (October 17, 2014) is 3472 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 == Unused Reference: 'USASCII' is defined on line 2480, but no explicit reference was found in the text -- 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' -- Possible downref: Non-RFC (?) normative reference: ref. 'USASCII' == Outdated reference: A later version (-18) exists of draft-ietf-precis-saslprepbis-08 -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) Summary: 7 errors (**), 0 flaws (~~), 4 warnings (==), 29 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 JOSE Working Group M. Jones 3 Internet-Draft Microsoft 4 Intended status: Standards Track October 17, 2014 5 Expires: April 20, 2015 7 JSON Web Algorithms (JWA) 8 draft-ietf-jose-json-web-algorithms-35 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 April 20, 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 . . . . . . 15 68 4.6. Key Agreement with Elliptic Curve Diffie-Hellman 69 Ephemeral Static (ECDH-ES) . . . . . . . . . . . . . . . . 15 70 4.6.1. Header Parameters Used for ECDH Key Agreement . . . . 16 71 4.6.1.1. "epk" (Ephemeral Public Key) Header Parameter . . 16 72 4.6.1.2. "apu" (Agreement PartyUInfo) Header Parameter . . 17 73 4.6.1.3. "apv" (Agreement PartyVInfo) Header Parameter . . 17 74 4.6.2. Key Derivation for ECDH Key Agreement . . . . . . . . 17 75 4.7. Key Encryption with AES GCM . . . . . . . . . . . . . . . 19 76 4.7.1. Header Parameters Used for AES GCM Key Encryption . . 19 77 4.7.1.1. "iv" (Initialization Vector) Header Parameter . . 19 78 4.7.1.2. "tag" (Authentication Tag) Header Parameter . . . 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 . . . . . . . 21 84 5.1. "enc" (Encryption Algorithm) Header Parameter Values 85 for JWE . . . . . . . . . . . . . . . . . . . . . . . . . 21 86 5.2. AES_CBC_HMAC_SHA2 Algorithms . . . . . . . . . . . . . . . 22 87 5.2.1. Conventions Used in Defining AES_CBC_HMAC_SHA2 . . . . 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 . . . . . . . . . . . 24 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 . . . . . . 26 95 5.3. Content Encryption with AES GCM . . . . . . . . . . . . . 27 96 6. Cryptographic Algorithms for Keys . . . . . . . . . . . . . . 27 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 . . . . . . . . . . . . . 28 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 . . . . . . 29 104 6.2.2.1. "d" (ECC Private Key) Parameter . . . . . . . . . 29 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 . . . . . . . . . . . 30 110 6.3.2.1. "d" (Private Exponent) Parameter . . . . . . . . . 30 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 . . . . . . . 31 117 6.4. Parameters for Symmetric Keys . . . . . . . . . . . . . . 32 118 6.4.1. "k" (Key Value) Parameter . . . . . . . . . . . . . . 32 119 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 32 120 7.1. JSON Web Signature and Encryption Algorithms Registry . . 33 121 7.1.1. Registration Template . . . . . . . . . . . . . . . . 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 . . . . . . . . . . . . . . . . 43 130 7.4.2. Initial Registry Contents . . . . . . . . . . . . . . 44 131 7.5. JSON Web Key Parameters Registration . . . . . . . . . . . 44 132 7.5.1. Registry Contents . . . . . . . . . . . . . . . . . . 44 133 7.6. JSON Web Key Elliptic Curve Registry . . . . . . . . . . . 47 134 7.6.1. Registration Template . . . . . . . . . . . . . . . . 47 135 7.6.2. Initial Registry Contents . . . . . . . . . . . . . . 48 136 8. Security Considerations . . . . . . . . . . . . . . . . . . . 48 137 8.1. Cryptographic Agility . . . . . . . . . . . . . . . . . . 48 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 . . . . . . . . . . 49 142 8.6. Denial of Service Attacks . . . . . . . . . . . . . . . . 50 143 8.7. Reusing Key Material when Encrypting Keys . . . . . . . . 50 144 8.8. Password Considerations . . . . . . . . . . . . . . . . . 51 145 8.9. Key Entropy and Random Values . . . . . . . . . . . . . . 51 146 8.10. Differences between Digital Signatures and MACs . . . . . 51 147 8.11. Using Matching Algorithm Strengths . . . . . . . . . . . . 51 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 . . . . . . . . . . . . . . . . . . . . . 56 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 . . . . . . . . . . . . . . . . . . . . . . . . . 76 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 MUST use 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. See Section 8.5 for security considerations 504 associated with using this algorithm. 506 4. Cryptographic Algorithms for Key Management 508 JWE uses cryptographic algorithms to encrypt or determine the Content 509 Encryption Key (CEK). 511 4.1. "alg" (Algorithm) Header Parameter Values for JWE 513 The table below is the set of "alg" (algorithm) Header Parameter 514 values that are defined by this specification for use with JWE. 515 These algorithms are used to encrypt the CEK, producing the JWE 516 Encrypted Key, or to use key agreement to agree upon the CEK. 518 +--------------------+--------------------+--------+----------------+ 519 | alg Param Value | Key Management | More | Implementation | 520 | | Algorithm | Header | Requirements | 521 | | | Params | | 522 +--------------------+--------------------+--------+----------------+ 523 | RSA1_5 | RSAES-PKCS1-V1_5 | (none) | Recommended- | 524 | RSA-OAEP | RSAES OAEP using | (none) | Recommended+ | 525 | | default parameters | | | 526 | RSA-OAEP-256 | RSAES OAEP using | (none) | Optional | 527 | | SHA-256 and MGF1 | | | 528 | | with SHA-256 | | | 529 | A128KW | AES Key Wrap with | (none) | Recommended | 530 | | default initial | | | 531 | | value using 128 | | | 532 | | bit key | | | 533 | A192KW | AES Key Wrap with | (none) | Optional | 534 | | default initial | | | 535 | | value using 192 | | | 536 | | bit key | | | 537 | A256KW | AES Key Wrap with | (none) | Recommended | 538 | | default initial | | | 539 | | value using 256 | | | 540 | | bit key | | | 541 | dir | Direct use of a | (none) | Recommended | 542 | | shared symmetric | | | 543 | | key as the CEK | | | 544 | ECDH-ES | Elliptic Curve | "epk", | Recommended+ | 545 | | Diffie-Hellman | "apu", | | 546 | | Ephemeral Static | "apv" | | 547 | | key agreement | | | 548 | | using Concat KDF | | | 549 | ECDH-ES+A128KW | ECDH-ES using | "epk", | Recommended | 550 | | Concat KDF and CEK | "apu", | | 551 | | wrapped with | "apv" | | 552 | | "A128KW" | | | 553 | ECDH-ES+A192KW | ECDH-ES using | "epk", | Optional | 554 | | Concat KDF and CEK | "apu", | | 555 | | wrapped with | "apv" | | 556 | | "A192KW" | | | 557 | ECDH-ES+A256KW | ECDH-ES using | "epk", | Recommended | 558 | | Concat KDF and CEK | "apu", | | 559 | | wrapped with | "apv" | | 560 | | "A256KW" | | | 561 | A128GCMKW | Key wrapping with | "iv", | Optional | 562 | | AES GCM using 128 | "tag" | | 563 | | bit key | | | 564 | A192GCMKW | Key wrapping with | "iv", | Optional | 565 | | AES GCM using 192 | "tag" | | 566 | | bit key | | | 567 | A256GCMKW | Key wrapping with | "iv", | Optional | 568 | | AES GCM using 256 | "tag" | | 569 | | bit key | | | 570 | PBES2-HS256+A128KW | PBES2 with HMAC | "p2s", | Optional | 571 | | SHA-256 and | "p2c" | | 572 | | "A128KW" wrapping | | | 573 | PBES2-HS384+A192KW | PBES2 with HMAC | "p2s", | Optional | 574 | | SHA-384 and | "p2c" | | 575 | | "A192KW" wrapping | | | 576 | PBES2-HS512+A256KW | PBES2 with HMAC | "p2s", | Optional | 577 | | SHA-512 and | "p2c" | | 578 | | "A256KW" wrapping | | | 579 +--------------------+--------------------+--------+----------------+ 581 The More Header Params column indicates what additional Header 582 Parameters are used by the algorithm, beyond "alg", which all use. 583 All but "dir" and "ECDH-ES" also produce a JWE Encrypted Key value. 585 The use of "+" in the Implementation Requirements indicates that the 586 requirement strength is likely to be increased in a future version of 587 the specification. 589 See Appendix A.2 for a table cross-referencing the JWE "alg" 590 (algorithm) values defined in this specification with the equivalent 591 identifiers used by other standards and software packages. 593 4.2. Key Encryption with RSAES-PKCS1-V1_5 595 This section defines the specifics of encrypting a JWE CEK with 596 RSAES-PKCS1-V1_5 [RFC3447]. The "alg" Header Parameter value 597 "RSA1_5" is used for this algorithm. 599 A key of size 2048 bits or larger MUST be used with this algorithm. 601 An example using this algorithm is shown in Appendix A.2 of [JWE]. 603 4.3. Key Encryption with RSAES OAEP 605 This section defines the specifics of encrypting a JWE CEK with RSAES 606 using Optimal Asymmetric Encryption Padding (OAEP) [RFC3447]. Two 607 sets of parameters for using OAEP are defined, which use different 608 hash functions. In the first case, the default parameters specified 609 by RFC 3447 in Section A.2.1 are used. (Those default parameters are 610 the SHA-1 hash function and the MGF1 with SHA-1 mask generation 611 function.) In the second case, the SHA-256 hash function and the 612 MGF1 with SHA-256 mask generation function are used. 614 The following "alg" (algorithm) Header Parameter values are used to 615 indicate that the JWE Encrypted Key is the result of encrypting the 616 CEK using the corresponding algorithm: 618 +-----------------+------------------------------------------------+ 619 | alg Param Value | Key Management Algorithm | 620 +-----------------+------------------------------------------------+ 621 | RSA-OAEP | RSAES OAEP using default parameters | 622 | RSA-OAEP-256 | RSAES OAEP using SHA-256 and MGF1 with SHA-256 | 623 +-----------------+------------------------------------------------+ 625 A key of size 2048 bits or larger MUST be used with these algorithms. 626 (This requirement is based on Table 4 (Security-strength time frames) 627 of NIST SP 800-57 [NIST.800-57], which requires 112 bits of security 628 for new uses, and Table 2 (Comparable strengths) of the same, which 629 states that 2048 bit RSA keys provide 112 bits of security.) 631 An example using RSAES OAEP with the default parameters is shown in 632 Appendix A.1 of [JWE]. 634 4.4. Key Wrapping with AES Key Wrap 636 This section defines the specifics of encrypting a JWE CEK with the 637 Advanced Encryption Standard (AES) Key Wrap Algorithm [RFC3394] using 638 the default initial value specified in Section 2.2.3.1. 640 The following "alg" (algorithm) Header Parameter values are used to 641 indicate that the JWE Encrypted Key is the result of encrypting the 642 CEK using the corresponding algorithm and key size: 644 +---------------+---------------------------------------------------+ 645 | alg Param | Key Management Algorithm | 646 | Value | | 647 +---------------+---------------------------------------------------+ 648 | A128KW | AES Key Wrap with default initial value using 128 | 649 | | bit key | 650 | A192KW | AES Key Wrap with default initial value using 192 | 651 | | bit key | 652 | A256KW | AES Key Wrap with default initial value using 256 | 653 | | bit key | 654 +---------------+---------------------------------------------------+ 656 An example using this algorithm is shown in Appendix A.3 of [JWE]. 658 4.5. Direct Encryption with a Shared Symmetric Key 660 This section defines the specifics of directly performing symmetric 661 key encryption without performing a key wrapping step. In this case, 662 the shared symmetric key is used directly as the Content Encryption 663 Key (CEK) value for the "enc" algorithm. An empty octet sequence is 664 used as the JWE Encrypted Key value. The "alg" Header Parameter 665 value "dir" is used in this case. 667 Refer to the security considerations on key lifetimes in Section 8.2 668 and AES GCM in Section 8.4 when considering utilizing direct 669 encryption. 671 4.6. Key Agreement with Elliptic Curve Diffie-Hellman Ephemeral Static 672 (ECDH-ES) 674 This section defines the specifics of key agreement with Elliptic 675 Curve Diffie-Hellman Ephemeral Static [RFC6090], in combination with 676 the Concat KDF, as defined in Section 5.8.1 of [NIST.800-56A]. The 677 key agreement result can be used in one of two ways: 679 1. directly as the Content Encryption Key (CEK) for the "enc" 680 algorithm, in the Direct Key Agreement mode, or 682 2. as a symmetric key used to wrap the CEK with the "A128KW", 683 "A192KW", or "A256KW" algorithms, in the Key Agreement with Key 684 Wrapping mode. 686 A new ephemeral public key value MUST be generated for each key 687 agreement operation. 689 In Direct Key Agreement mode, the output of the Concat KDF MUST be a 690 key of the same length as that used by the "enc" algorithm. In this 691 case, the empty octet sequence is used as the JWE Encrypted Key 692 value. The "alg" Header Parameter value "ECDH-ES" is used in the 693 Direct Key Agreement mode. 695 In Key Agreement with Key Wrapping mode, the output of the Concat KDF 696 MUST be a key of the length needed for the specified key wrapping 697 algorithm. In this case, the JWE Encrypted Key is the CEK wrapped 698 with the agreed upon key. 700 The following "alg" (algorithm) Header Parameter values are used to 701 indicate that the JWE Encrypted Key is the result of encrypting the 702 CEK using the result of the key agreement algorithm as the key 703 encryption key for the corresponding key wrapping algorithm: 705 +----------------+--------------------------------------------------+ 706 | alg Param | Key Management Algorithm | 707 | Value | | 708 +----------------+--------------------------------------------------+ 709 | ECDH-ES+A128KW | ECDH-ES using Concat KDF and CEK wrapped with | 710 | | "A128KW" | 711 | ECDH-ES+A192KW | ECDH-ES using Concat KDF and CEK wrapped with | 712 | | "A192KW" | 713 | ECDH-ES+A256KW | ECDH-ES using Concat KDF and CEK wrapped with | 714 | | "A256KW" | 715 +----------------+--------------------------------------------------+ 717 4.6.1. Header Parameters Used for ECDH Key Agreement 719 The following Header Parameter names are used for key agreement as 720 defined below. 722 4.6.1.1. "epk" (Ephemeral Public Key) Header Parameter 724 The "epk" (ephemeral public key) value created by the originator for 725 the use in key agreement algorithms. This key is represented as a 726 JSON Web Key [JWK] public key value. It MUST contain only public key 727 parameters and SHOULD contain only the minimum JWK parameters 728 necessary to represent the key; other JWK parameters included can be 729 checked for consistency and honored or can be ignored. This Header 730 Parameter MUST be present and MUST be understood and processed by 731 implementations when these algorithms are used. 733 4.6.1.2. "apu" (Agreement PartyUInfo) Header Parameter 735 The "apu" (agreement PartyUInfo) value for key agreement algorithms 736 using it (such as "ECDH-ES"), represented as a base64url encoded 737 string. When used, the PartyUInfo value contains information about 738 the producer. Use of this Header Parameter is OPTIONAL. This Header 739 Parameter MUST be understood and processed by implementations when 740 these algorithms are used. 742 4.6.1.3. "apv" (Agreement PartyVInfo) Header Parameter 744 The "apv" (agreement PartyVInfo) value for key agreement algorithms 745 using it (such as "ECDH-ES"), represented as a base64url encoded 746 string. When used, the PartyVInfo value contains information about 747 the recipient. Use of this Header Parameter is OPTIONAL. This 748 Header Parameter MUST be understood and processed by implementations 749 when these algorithms are used. 751 4.6.2. Key Derivation for ECDH Key Agreement 753 The key derivation process derives the agreed upon key from the 754 shared secret Z established through the ECDH algorithm, per Section 755 6.2.2.2 of [NIST.800-56A]. 757 Key derivation is performed using the Concat KDF, as defined in 758 Section 5.8.1 of [NIST.800-56A], where the Digest Method is SHA-256. 759 The Concat KDF parameters are set as follows: 761 Z 762 This is set to the representation of the shared secret Z as an 763 octet sequence. 765 keydatalen 766 This is set to the number of bits in the desired output key. For 767 "ECDH-ES", this is length of the key used by the "enc" algorithm. 768 For "ECDH-ES+A128KW", "ECDH-ES+A192KW", and "ECDH-ES+A256KW", this 769 is 128, 192, and 256, respectively. 771 AlgorithmID 772 The AlgorithmID value is of the form Datalen || Data, where Data 773 is a variable-length string of zero or more octets, and Datalen is 774 a fixed-length, big endian 32 bit counter that indicates the 775 length (in octets) of Data. In the Direct Key Agreement case, 776 Data is set to the octets of the UTF-8 representation of the "enc" 777 Header Parameter value. In the Key Agreement with Key Wrapping 778 case, Data is set to the octets of the UTF-8 representation of the 779 "alg" Header Parameter value. 781 PartyUInfo 782 The PartyUInfo value is of the form Datalen || Data, where Data is 783 a variable-length string of zero or more octets, and Datalen is a 784 fixed-length, big endian 32 bit counter that indicates the length 785 (in octets) of Data. If an "apu" (agreement PartyUInfo) Header 786 Parameter is present, Data is set to the result of base64url 787 decoding the "apu" value and Datalen is set to the number of 788 octets in Data. Otherwise, Datalen is set to 0 and Data is set to 789 the empty octet sequence. 791 PartyVInfo 792 The PartyVInfo value is of the form Datalen || Data, where Data is 793 a variable-length string of zero or more octets, and Datalen is a 794 fixed-length, big endian 32 bit counter that indicates the length 795 (in octets) of Data. If an "apv" (agreement PartyVInfo) Header 796 Parameter is present, Data is set to the result of base64url 797 decoding the "apv" value and Datalen is set to the number of 798 octets in Data. Otherwise, Datalen is set to 0 and Data is set to 799 the empty octet sequence. 801 SuppPubInfo 802 This is set to the keydatalen represented as a 32 bit big endian 803 integer. 805 SuppPrivInfo 806 This is set to the empty octet sequence. 808 Applications need to specify how the "apu" and "apv" parameters are 809 used for that application. The "apu" and "apv" values MUST be 810 distinct, when used. Applications wishing to conform to 811 [NIST.800-56A] need to provide values that meet the requirements of 812 that document, e.g., by using values that identify the producer and 813 recipient. Alternatively, applications MAY conduct key derivation in 814 a manner similar to The Diffie-Hellman Key Agreement Method 815 [RFC2631]: In that case, the "apu" field MAY either be omitted or 816 represent a random 512-bit value (analogous to PartyAInfo in 817 Ephemeral-Static mode in RFC 2631) and the "apv" field SHOULD NOT be 818 present. 820 See Appendix C for an example key agreement computation using this 821 method. 823 4.7. Key Encryption with AES GCM 825 This section defines the specifics of encrypting a JWE Content 826 Encryption Key (CEK) with Advanced Encryption Standard (AES) in 827 Galois/Counter Mode (GCM) [AES, NIST.800-38D]. 829 Use of an Initialization Vector of size 96 bits is REQUIRED with this 830 algorithm. The Initialization Vector is represented in base64url 831 encoded form as the "iv" (initialization vector) Header Parameter 832 value. 834 The Additional Authenticated Data value used is the empty octet 835 string. 837 The requested size of the Authentication Tag output MUST be 128 bits, 838 regardless of the key size. 840 The JWE Encrypted Key value is the Ciphertext output. 842 The Authentication Tag output is represented in base64url encoded 843 form as the "tag" (authentication tag) Header Parameter value. 845 The following "alg" (algorithm) Header Parameter values are used to 846 indicate that the JWE Encrypted Key is the result of encrypting the 847 CEK using the corresponding algorithm and key size: 849 +-----------------+---------------------------------------------+ 850 | alg Param Value | Key Management Algorithm | 851 +-----------------+---------------------------------------------+ 852 | A128GCMKW | Key wrapping with AES GCM using 128 bit key | 853 | A192GCMKW | Key wrapping with AES GCM using 192 bit key | 854 | A256GCMKW | Key wrapping with AES GCM using 256 bit key | 855 +-----------------+---------------------------------------------+ 857 4.7.1. Header Parameters Used for AES GCM Key Encryption 859 The following Header Parameters are used for AES GCM key encryption. 861 4.7.1.1. "iv" (Initialization Vector) Header Parameter 863 The "iv" (initialization vector) Header Parameter value is the 864 base64url encoded representation of the 96 bit Initialization Vector 865 value used for the key encryption operation. This Header Parameter 866 MUST be present and MUST be understood and processed by 867 implementations when these algorithms are used. 869 4.7.1.2. "tag" (Authentication Tag) Header Parameter 871 The "tag" (authentication tag) Header Parameter value is the 872 base64url encoded representation of the 128 bit Authentication Tag 873 value resulting from the key encryption operation. This Header 874 Parameter MUST be present and MUST be understood and processed by 875 implementations when these algorithms are used. 877 4.8. Key Encryption with PBES2 879 This section defines the specifics of performing password-based 880 encryption of a JWE CEK, by first deriving a key encryption key from 881 a user-supplied password using PBES2 schemes as specified in Section 882 6.2 of [RFC2898], then by encrypting the JWE CEK using the derived 883 key. 885 These algorithms use HMAC SHA-2 algorithms as the Pseudo-Random 886 Function (PRF) for the PBKDF2 key derivation and AES Key Wrap 887 [RFC3394] for the encryption scheme. The PBES2 password input is an 888 octet sequence; if the password to be used is represented as a text 889 string rather than an octet sequence, the UTF-8 encoding of the text 890 string MUST be used as the octet sequence. The salt parameter MUST 891 be computed from the "p2s" (PBES2 salt input) Header Parameter value 892 and the "alg" (algorithm) Header Parameter value as specified in the 893 "p2s" definition below. The iteration count parameter MUST be 894 provided as the "p2c" Header Parameter value. The algorithms 895 respectively use HMAC SHA-256, HMAC SHA-384, and HMAC SHA-512 as the 896 PRF and use 128, 192, and 256 bit AES Key Wrap keys. Their derived- 897 key lengths respectively are 16, 24, and 32 octets. 899 The following "alg" (algorithm) Header Parameter values are used to 900 indicate that the JWE Encrypted Key is the result of encrypting the 901 CEK using the result of the corresponding password-based encryption 902 algorithm as the key encryption key for the corresponding key 903 wrapping algorithm: 905 +--------------------+----------------------------------------------+ 906 | alg Param Value | Key Management Algorithm | 907 +--------------------+----------------------------------------------+ 908 | PBES2-HS256+A128KW | PBES2 with HMAC SHA-256 and "A128KW" | 909 | | wrapping | 910 | PBES2-HS384+A192KW | PBES2 with HMAC SHA-384 and "A192KW" | 911 | | wrapping | 912 | PBES2-HS512+A256KW | PBES2 with HMAC SHA-512 and "A256KW" | 913 | | wrapping | 914 +--------------------+----------------------------------------------+ 916 See Appendix C of JSON Web Key (JWK) [JWK] for an example key 917 encryption computation using "PBES2-HS256+A128KW". 919 4.8.1. Header Parameters Used for PBES2 Key Encryption 921 The following Header Parameters are used for Key Encryption with 922 PBES2. 924 4.8.1.1. "p2s" (PBES2 salt input) Parameter 926 The "p2s" (PBES2 salt input) Header Parameter encodes a Salt Input 927 value, which is used as part of the PBKDF2 salt value. The "p2s" 928 value is BASE64URL(Salt Input). This Header Parameter MUST be 929 present and MUST be understood and processed by implementations when 930 these algorithms are used. 932 The salt expands the possible keys that can be derived from a given 933 password. A Salt Input value containing 8 or more octets MUST be 934 used. A new Salt Input value MUST be generated randomly for every 935 encryption operation; see RFC 4086 [RFC4086] for considerations on 936 generating random values. The salt value used is (UTF8(Alg) || 0x00 937 || Salt Input), where Alg is the "alg" Header Parameter value. 939 4.8.1.2. "p2c" (PBES2 count) Parameter 941 The "p2c" (PBES2 count) Header Parameter contains the PBKDF2 942 iteration count, represented as a positive JSON integer. This Header 943 Parameter MUST be present and MUST be understood and processed by 944 implementations when these algorithms are used. 946 The iteration count adds computational expense, ideally compounded by 947 the possible range of keys introduced by the salt. A minimum 948 iteration count of 1000 is RECOMMENDED. 950 5. Cryptographic Algorithms for Content Encryption 952 JWE uses cryptographic algorithms to encrypt and integrity protect 953 the Plaintext and to also integrity protect additional authenticated 954 data. 956 5.1. "enc" (Encryption Algorithm) Header Parameter Values for JWE 958 The table below is the set of "enc" (encryption algorithm) Header 959 Parameter values that are defined by this specification for use with 960 JWE. 962 +---------------+----------------------------------+----------------+ 963 | enc Param | Content Encryption Algorithm | Implementation | 964 | Value | | Requirements | 965 +---------------+----------------------------------+----------------+ 966 | A128CBC-HS256 | AES_128_CBC_HMAC_SHA_256 | Required | 967 | | authenticated encryption | | 968 | | algorithm, as defined in | | 969 | | Section 5.2.3 | | 970 | A192CBC-HS384 | AES_192_CBC_HMAC_SHA_384 | Optional | 971 | | authenticated encryption | | 972 | | algorithm, as defined in | | 973 | | Section 5.2.4 | | 974 | A256CBC-HS512 | AES_256_CBC_HMAC_SHA_512 | Required | 975 | | authenticated encryption | | 976 | | algorithm, as defined in | | 977 | | Section 5.2.5 | | 978 | A128GCM | AES GCM using 128 bit key | Recommended | 979 | A192GCM | AES GCM using 192 bit key | Optional | 980 | A256GCM | AES GCM using 256 bit key | Recommended | 981 +---------------+----------------------------------+----------------+ 983 All also use a JWE Initialization Vector value and produce JWE 984 Ciphertext and JWE Authentication Tag values. 986 See Appendix A.3 for a table cross-referencing the JWE "enc" 987 (encryption algorithm) values defined in this specification with the 988 equivalent identifiers used by other standards and software packages. 990 5.2. AES_CBC_HMAC_SHA2 Algorithms 992 This section defines a family of authenticated encryption algorithms 993 built using a composition of Advanced Encryption Standard (AES) [AES] 994 in Cipher Block Chaining (CBC) mode [NIST.800-38A] with PKCS #7 995 padding [RFC5652], Section 6.3 operations and HMAC [RFC2104, SHS] 996 operations. This algorithm family is called AES_CBC_HMAC_SHA2. It 997 also defines three instances of this family, the first using 128 bit 998 CBC keys and HMAC SHA-256, the second using 192 bit CBC keys and HMAC 999 SHA-384, and the third using 256 bit CBC keys and HMAC SHA-512. Test 1000 cases for these algorithms can be found in Appendix B. 1002 These algorithms are based upon Authenticated Encryption with AES-CBC 1003 and HMAC-SHA [I-D.mcgrew-aead-aes-cbc-hmac-sha2], performing the same 1004 cryptographic computations, but with the Initialization Vector and 1005 Authentication Tag values remaining separate, rather than being 1006 concatenated with the Ciphertext value in the output representation. 1007 This option is discussed in Appendix B of that specification. This 1008 algorithm family is a generalization of the algorithm family in 1009 [I-D.mcgrew-aead-aes-cbc-hmac-sha2], and can be used to implement 1010 those algorithms. 1012 5.2.1. Conventions Used in Defining AES_CBC_HMAC_SHA2 1014 We use the following notational conventions. 1016 CBC-PKCS5-ENC(X, P) denotes the AES CBC encryption of P using PKCS 1017 #7 padding using the cipher with the key X. 1019 MAC(Y, M) denotes the application of the Message Authentication 1020 Code (MAC) to the message M, using the key Y. 1022 5.2.2. Generic AES_CBC_HMAC_SHA2 Algorithm 1024 This section defines AES_CBC_HMAC_SHA2 in a manner that is 1025 independent of the AES CBC key size or hash function to be used. 1026 Section 5.2.2.1 and Section 5.2.2.2 define the generic encryption and 1027 decryption algorithms. Sections 5.2.3 through 5.2.5 define instances 1028 of AES_CBC_HMAC_SHA2 that specify those details. 1030 5.2.2.1. AES_CBC_HMAC_SHA2 Encryption 1032 The authenticated encryption algorithm takes as input four octet 1033 strings: a secret key K, a plaintext P, additional authenticated data 1034 A, and an initialization vector IV. The authenticated ciphertext 1035 value E and the authentication tag value T are provided as outputs. 1036 The data in the plaintext are encrypted and authenticated, and the 1037 additional authenticated data are authenticated, but not encrypted. 1039 The encryption process is as follows, or uses an equivalent set of 1040 steps: 1042 1. The secondary keys MAC_KEY and ENC_KEY are generated from the 1043 input key K as follows. Each of these two keys is an octet 1044 string. 1046 MAC_KEY consists of the initial MAC_KEY_LEN octets of K, in 1047 order. 1049 ENC_KEY consists of the final ENC_KEY_LEN octets of K, in 1050 order. 1052 The number of octets in the input key K MUST be the sum of 1053 MAC_KEY_LEN and ENC_KEY_LEN. The values of these parameters are 1054 specified by the Authenticated Encryption algorithms in Sections 1055 5.2.3 through 5.2.5. Note that the MAC key comes before the 1056 encryption key in the input key K; this is in the opposite order 1057 of the algorithm names in the identifier "AES_CBC_HMAC_SHA2". 1059 2. The Initialization Vector (IV) used is a 128 bit value generated 1060 randomly or pseudorandomly for use in the cipher. 1062 3. The plaintext is CBC encrypted using PKCS #7 padding using 1063 ENC_KEY as the key, and the IV. We denote the ciphertext output 1064 from this step as E. 1066 4. The octet string AL is equal to the number of bits in the 1067 additional authenticated data A expressed as a 64-bit unsigned 1068 big endian integer. 1070 5. A message authentication tag T is computed by applying HMAC 1071 [RFC2104] to the following data, in order: 1073 the additional authenticated data A, 1075 the initialization vector IV, 1077 the ciphertext E computed in the previous step, and 1079 the octet string AL defined above. 1081 The string MAC_KEY is used as the MAC key. We denote the output 1082 of the MAC computed in this step as M. The first T_LEN bits of M 1083 are used as T. 1085 6. The Ciphertext E and the Authentication Tag T are returned as the 1086 outputs of the authenticated encryption. 1088 The encryption process can be illustrated as follows. Here K, P, A, 1089 IV, and E denote the key, plaintext, additional authenticated data, 1090 initialization vector, and ciphertext, respectively. 1092 MAC_KEY = initial MAC_KEY_LEN octets of K, 1094 ENC_KEY = final ENC_KEY_LEN octets of K, 1096 E = CBC-PKCS5-ENC(ENC_KEY, P), 1098 M = MAC(MAC_KEY, A || IV || E || AL), 1100 T = initial T_LEN octets of M. 1102 5.2.2.2. AES_CBC_HMAC_SHA2 Decryption 1104 The authenticated decryption operation has five inputs: K, A, IV, E, 1105 and T as defined above. It has only a single output, either a 1106 plaintext value P or a special symbol FAIL that indicates that the 1107 inputs are not authentic. The authenticated decryption algorithm is 1108 as follows, or uses an equivalent set of steps: 1110 1. The secondary keys MAC_KEY and ENC_KEY are generated from the 1111 input key K as in Step 1 of Section 5.2.2.1. 1113 2. The integrity and authenticity of A and E are checked by 1114 computing an HMAC with the inputs as in Step 5 of 1115 Section 5.2.2.1. The value T, from the previous step, is 1116 compared to the first MAC_KEY length bits of the HMAC output. If 1117 those values are identical, then A and E are considered valid, 1118 and processing is continued. Otherwise, all of the data used in 1119 the MAC validation are discarded, and the Authenticated 1120 Encryption decryption operation returns an indication that it 1121 failed, and the operation halts. (But see Section 11.5 of [JWE] 1122 for security considerations on thwarting timing attacks.) 1124 3. The value E is decrypted and the PKCS #7 padding is checked and 1125 removed. The value IV is used as the initialization vector. The 1126 value ENC_KEY is used as the decryption key. 1128 4. The plaintext value is returned. 1130 5.2.3. AES_128_CBC_HMAC_SHA_256 1132 This algorithm is a concrete instantiation of the generic 1133 AES_CBC_HMAC_SHA2 algorithm above. It uses the HMAC message 1134 authentication code [RFC2104] with the SHA-256 hash function [SHS] to 1135 provide message authentication, with the HMAC output truncated to 128 1136 bits, corresponding to the HMAC-SHA-256-128 algorithm defined in 1137 [RFC4868]. For encryption, it uses AES in the Cipher Block Chaining 1138 (CBC) mode of operation as defined in Section 6.2 of [NIST.800-38A], 1139 with PKCS #7 padding and a 128 bit initialization vector (IV) value. 1141 The AES_CBC_HMAC_SHA2 parameters specific to AES_128_CBC_HMAC_SHA_256 1142 are: 1144 The input key K is 32 octets long. 1146 ENC_KEY_LEN is 16 octets. 1148 MAC_KEY_LEN is 16 octets. 1150 The SHA-256 hash algorithm is used for the HMAC. 1152 The HMAC-SHA-256 output is truncated to T_LEN=16 octets, by 1153 stripping off the final 16 octets. 1155 5.2.4. AES_192_CBC_HMAC_SHA_384 1157 AES_192_CBC_HMAC_SHA_384 is based on AES_128_CBC_HMAC_SHA_256, but 1158 with the following differences: 1160 The input key K is 48 octets long instead of 32. 1162 ENC_KEY_LEN is 24 octets instead of 16. 1164 MAC_KEY_LEN is 24 octets instead of 16. 1166 SHA-384 is used for the HMAC instead of SHA-256. 1168 The HMAC SHA-384 value is truncated to T_LEN=24 octets instead of 1169 16. 1171 5.2.5. AES_256_CBC_HMAC_SHA_512 1173 AES_256_CBC_HMAC_SHA_512 is based on AES_128_CBC_HMAC_SHA_256, but 1174 with the following differences: 1176 The input key K is 64 octets long instead of 32. 1178 ENC_KEY_LEN is 32 octets instead of 16. 1180 MAC_KEY_LEN is 32 octets instead of 16. 1182 SHA-512 is used for the HMAC instead of SHA-256. 1184 The HMAC SHA-512 value is truncated to T_LEN=32 octets instead of 1185 16. 1187 5.2.6. Content Encryption with AES_CBC_HMAC_SHA2 1189 This section defines the specifics of performing authenticated 1190 encryption with the AES_CBC_HMAC_SHA2 algorithms. 1192 The CEK is used as the secret key K. 1194 The following "enc" (encryption algorithm) Header Parameter values 1195 are used to indicate that the JWE Ciphertext and JWE Authentication 1196 Tag values have been computed using the corresponding algorithm: 1198 +---------------+---------------------------------------------------+ 1199 | enc Param | Content Encryption Algorithm | 1200 | Value | | 1201 +---------------+---------------------------------------------------+ 1202 | A128CBC-HS256 | AES_128_CBC_HMAC_SHA_256 authenticated encryption | 1203 | | algorithm, as defined in Section 5.2.3 | 1204 | A192CBC-HS384 | AES_192_CBC_HMAC_SHA_384 authenticated encryption | 1205 | | algorithm, as defined in Section 5.2.4 | 1206 | A256CBC-HS512 | AES_256_CBC_HMAC_SHA_512 authenticated encryption | 1207 | | algorithm, as defined in Section 5.2.5 | 1208 +---------------+---------------------------------------------------+ 1210 5.3. Content Encryption with AES GCM 1212 This section defines the specifics of performing authenticated 1213 encryption with Advanced Encryption Standard (AES) in Galois/Counter 1214 Mode (GCM) [AES, NIST.800-38D]. 1216 The CEK is used as the encryption key. 1218 Use of an initialization vector of size 96 bits is REQUIRED with this 1219 algorithm. 1221 The requested size of the Authentication Tag output MUST be 128 bits, 1222 regardless of the key size. 1224 The following "enc" (encryption algorithm) Header Parameter values 1225 are used to indicate that the JWE Ciphertext and JWE Authentication 1226 Tag values have been computed using the corresponding algorithm and 1227 key size: 1229 +-----------------+------------------------------+ 1230 | enc Param Value | Content Encryption Algorithm | 1231 +-----------------+------------------------------+ 1232 | A128GCM | AES GCM using 128 bit key | 1233 | A192GCM | AES GCM using 192 bit key | 1234 | A256GCM | AES GCM using 256 bit key | 1235 +-----------------+------------------------------+ 1237 An example using this algorithm is shown in Appendix A.1 of [JWE]. 1239 6. Cryptographic Algorithms for Keys 1241 A JSON Web Key (JWK) [JWK] is a JSON data structure that represents a 1242 cryptographic key. These keys can be either asymmetric or symmetric. 1243 They can hold both public and private information about the key. 1244 This section defines the parameters for keys using the algorithms 1245 specified by this document. 1247 6.1. "kty" (Key Type) Parameter Values 1249 The table below is the set of "kty" (key type) parameter values that 1250 are defined by this specification for use in JWKs. 1252 +-------------+------------------------------------+----------------+ 1253 | kty Param | Key Type | Implementation | 1254 | Value | | Requirements | 1255 +-------------+------------------------------------+----------------+ 1256 | EC | Elliptic Curve [DSS] | Recommended+ | 1257 | RSA | RSA [RFC3447] | Required | 1258 | oct | Octet sequence (used to represent | Required | 1259 | | symmetric keys) | | 1260 +-------------+------------------------------------+----------------+ 1262 The use of "+" in the Implementation Requirements indicates that the 1263 requirement strength is likely to be increased in a future version of 1264 the specification. 1266 6.2. Parameters for Elliptic Curve Keys 1268 JWKs can represent Elliptic Curve [DSS] keys. In this case, the 1269 "kty" member value is "EC". 1271 6.2.1. Parameters for Elliptic Curve Public Keys 1273 An elliptic curve public key is represented by a pair of coordinates 1274 drawn from a finite field, which together define a point on an 1275 elliptic curve. The following members MUST be present for all 1276 elliptic curve public keys: 1278 o "crv" 1279 o "x" 1281 The following member MUST also be present for elliptic curve public 1282 keys for the three curves defined in the following section: 1284 o "y" 1286 6.2.1.1. "crv" (Curve) Parameter 1288 The "crv" (curve) member identifies the cryptographic curve used with 1289 the key. Curve values from [DSS] used by this specification are: 1291 o "P-256" 1292 o "P-384" 1293 o "P-521" 1295 These values are registered in the IANA JSON Web Key Elliptic Curve 1296 registry defined in Section 7.6. Additional "crv" values can be 1297 registered by other specifications. Specifications registering 1298 additional curves must define what parameters are used to represent 1299 keys for the curves registered. The "crv" value is a case-sensitive 1300 string. 1302 SEC1 [SEC1] point compression is not supported for any of these three 1303 curves. 1305 6.2.1.2. "x" (X Coordinate) Parameter 1307 The "x" (x coordinate) member contains the x coordinate for the 1308 elliptic curve point. It is represented as the base64url encoding of 1309 the octet string representation of the coordinate, as defined in 1310 Section 2.3.5 of SEC1 [SEC1]. The length of this octet string MUST 1311 be the full size of a coordinate for the curve specified in the "crv" 1312 parameter. For example, if the value of "crv" is "P-521", the octet 1313 string must be 66 octets long. 1315 6.2.1.3. "y" (Y Coordinate) Parameter 1317 The "y" (y coordinate) member contains the y coordinate for the 1318 elliptic curve point. It is represented as the base64url encoding of 1319 the octet string representation of the coordinate, as defined in 1320 Section 2.3.5 of SEC1 [SEC1]. The length of this octet string MUST 1321 be the full size of a coordinate for the curve specified in the "crv" 1322 parameter. For example, if the value of "crv" is "P-521", the octet 1323 string must be 66 octets long. 1325 6.2.2. Parameters for Elliptic Curve Private Keys 1327 In addition to the members used to represent Elliptic Curve public 1328 keys, the following member MUST be present to represent Elliptic 1329 Curve private keys. 1331 6.2.2.1. "d" (ECC Private Key) Parameter 1333 The "d" (ECC private key) member contains the Elliptic Curve private 1334 key value. It is represented as the base64url encoding of the octet 1335 string representation of the private key value, as defined in Section 1336 2.3.7 of SEC1 [SEC1]. The length of this octet string MUST be 1337 ceiling(log-base-2(n)/8) octets (where n is the order of the curve). 1339 6.3. Parameters for RSA Keys 1341 JWKs can represent RSA [RFC3447] keys. In this case, the "kty" 1342 member value is "RSA". 1344 6.3.1. Parameters for RSA Public Keys 1346 The following members MUST be present for RSA public keys. 1348 6.3.1.1. "n" (Modulus) Parameter 1350 The "n" (modulus) member contains the modulus value for the RSA 1351 public key. It is represented as a Base64urlUInt encoded value. 1353 Note that implementers have found that some cryptographic libraries 1354 prefix an extra zero-valued octet to the modulus representations they 1355 return, for instance, returning 257 octets for a 2048 bit key, rather 1356 than 256. Implementations using such libraries will need to take 1357 care to omit the extra octet from the base64url encoded 1358 representation. 1360 6.3.1.2. "e" (Exponent) Parameter 1362 The "e" (exponent) member contains the exponent value for the RSA 1363 public key. It is represented as a Base64urlUInt encoded value. 1365 For instance, when representing the value 65537, the octet sequence 1366 to be base64url encoded MUST consist of the three octets [1, 0, 1]; 1367 the resulting representation for this value is "AQAB". 1369 6.3.2. Parameters for RSA Private Keys 1371 In addition to the members used to represent RSA public keys, the 1372 following members are used to represent RSA private keys. The 1373 parameter "d" is REQUIRED for RSA private keys. The others enable 1374 optimizations and SHOULD be included by producers of JWKs 1375 representing RSA private keys. If the producer includes any of the 1376 other private key parameters, then all of the others MUST be present, 1377 with the exception of "oth", which MUST only be present when more 1378 than two prime factors were used. 1380 6.3.2.1. "d" (Private Exponent) Parameter 1382 The "d" (private exponent) member contains the private exponent value 1383 for the RSA private key. It is represented as a Base64urlUInt 1384 encoded value. 1386 6.3.2.2. "p" (First Prime Factor) Parameter 1388 The "p" (first prime factor) member contains the first prime factor. 1389 It is represented as a Base64urlUInt encoded value. 1391 6.3.2.3. "q" (Second Prime Factor) Parameter 1393 The "q" (second prime factor) member contains the second prime 1394 factor. It is represented as a Base64urlUInt encoded value. 1396 6.3.2.4. "dp" (First Factor CRT Exponent) Parameter 1398 The "dp" (first factor CRT exponent) member contains the Chinese 1399 Remainder Theorem (CRT) exponent of the first factor. It is 1400 represented as a Base64urlUInt encoded value. 1402 6.3.2.5. "dq" (Second Factor CRT Exponent) Parameter 1404 The "dq" (second factor CRT exponent) member contains the Chinese 1405 Remainder Theorem (CRT) exponent of the second factor. It is 1406 represented as a Base64urlUInt encoded value. 1408 6.3.2.6. "qi" (First CRT Coefficient) Parameter 1410 The "qi" (first CRT coefficient) member contains the Chinese 1411 Remainder Theorem (CRT) coefficient of the second factor. It is 1412 represented as a Base64urlUInt encoded value. 1414 6.3.2.7. "oth" (Other Primes Info) Parameter 1416 The "oth" (other primes info) member contains an array of information 1417 about any third and subsequent primes, should they exist. When only 1418 two primes have been used (the normal case), this parameter MUST be 1419 omitted. When three or more primes have been used, the number of 1420 array elements MUST be the number of primes used minus two. For more 1421 information on this case, see the description of the OtherPrimeInfo 1422 parameters in Section A.1.2 of RFC 3447 [RFC3447], upon which the 1423 following parameters are modelled. Each array element MUST be an 1424 object with the following members: 1426 6.3.2.7.1. "r" (Prime Factor) 1428 The "r" (prime factor) parameter within an "oth" array member 1429 represents the value of a subsequent prime factor. It is represented 1430 as a Base64urlUInt encoded value. 1432 6.3.2.7.2. "d" (Factor CRT Exponent) 1434 The "d" (Factor CRT Exponent) parameter within an "oth" array member 1435 represents the CRT exponent of the corresponding prime factor. It is 1436 represented as a Base64urlUInt encoded value. 1438 6.3.2.7.3. "t" (Factor CRT Coefficient) 1440 The "t" (factor CRT coefficient) parameter within an "oth" array 1441 member represents the CRT coefficient of the corresponding prime 1442 factor. It is represented as a Base64urlUInt encoded value. 1444 6.4. Parameters for Symmetric Keys 1446 When the JWK "kty" member value is "oct" (octet sequence), the member 1447 "k" is used to represent a symmetric key (or another key whose value 1448 is a single octet sequence). An "alg" member SHOULD also be present 1449 to identify the algorithm intended to be used with the key, unless 1450 the application uses another means or convention to determine the 1451 algorithm used. 1453 6.4.1. "k" (Key Value) Parameter 1455 The "k" (key value) member contains the value of the symmetric (or 1456 other single-valued) key. It is represented as the base64url 1457 encoding of the octet sequence containing the key value. 1459 7. IANA Considerations 1461 The following registration procedure is used for all the registries 1462 established by this specification. 1464 Values are registered on a Specification Required [RFC5226] basis 1465 after a three-week review period on the [TBD]@ietf.org mailing list, 1466 on the advice of one or more Designated Experts. However, to allow 1467 for the allocation of values prior to publication, the Designated 1468 Expert(s) may approve registration once they are satisfied that such 1469 a specification will be published. 1471 Registration requests must be sent to the [TBD]@ietf.org mailing list 1472 for review and comment, with an appropriate subject (e.g., "Request 1473 for access token type: example"). [[ Note to the RFC Editor: The name 1474 of the mailing list should be determined in consultation with the 1475 IESG and IANA. Suggested name: jose-reg-review. ]] 1477 Within the review period, the Designated Expert(s) will either 1478 approve or deny the registration request, communicating this decision 1479 to the review list and IANA. Denials should include an explanation 1480 and, if applicable, suggestions as to how to make the request 1481 successful. Registration requests that are undetermined for a period 1482 longer than 21 days can be brought to the IESG's attention (using the 1483 iesg@ietf.org mailing list) for resolution. 1485 Criteria that should be applied by the Designated Expert(s) includes 1486 determining whether the proposed registration duplicates existing 1487 functionality, determining whether it is likely to be of general 1488 applicability or whether it is useful only for a single application, 1489 and whether the registration description is clear. 1491 IANA must only accept registry updates from the Designated Expert(s) 1492 and should direct all requests for registration to the review mailing 1493 list. 1495 It is suggested that multiple Designated Experts be appointed who are 1496 able to represent the perspectives of different applications using 1497 this specification, in order to enable broadly-informed review of 1498 registration decisions. In cases where a registration decision could 1499 be perceived as creating a conflict of interest for a particular 1500 Expert, that Expert should defer to the judgment of the other 1501 Expert(s). 1503 [[ Note to the RFC Editor and IANA: Pearl Liang of ICANN had 1504 requested that the draft supply the following proposed registry 1505 description information. It is to be used for all registries 1506 established by this specification. 1508 o Protocol Category: JSON Object Signing and Encryption (JOSE) 1510 o Registry Location: http://www.iana.org/assignments/jose 1512 o Webpage Title: (same as the protocol category) 1514 o Registry Name: (same as the section title, but excluding the word 1515 "Registry", for example "JSON Web Signature and Encryption 1516 Algorithms") 1518 ]] 1520 7.1. JSON Web Signature and Encryption Algorithms Registry 1522 This specification establishes the IANA JSON Web Signature and 1523 Encryption Algorithms registry for values of the JWS and JWE "alg" 1524 (algorithm) and "enc" (encryption algorithm) Header Parameters. The 1525 registry records the algorithm name, the algorithm usage locations, 1526 implementation requirements, and a reference to the specification 1527 that defines it. The same algorithm name can be registered multiple 1528 times, provided that the sets of usage locations are disjoint. 1530 It is suggested that when multiple variations of algorithms are being 1531 registered that use keys of different lengths and the key lengths for 1532 each need to be fixed (for instance, because they will be created by 1533 key derivation functions), that the length of the key be included in 1534 the algorithm name. This allows readers of the JSON text to more 1535 easily make security decisions. 1537 The Designated Expert(s) should perform reasonable due diligence that 1538 algorithms being registered are either currently considered 1539 cryptographically credible or are being registered as Deprecated or 1540 Prohibited. 1542 The implementation requirements of an algorithm may be changed over 1543 time as the cryptographic landscape evolves, for instance, to change 1544 the status of an algorithm to Deprecated, or to change the status of 1545 an algorithm from Optional to Recommended+ or Required. Changes of 1546 implementation requirements are only permitted on a Specification 1547 Required basis after review by the Designated Experts(s), with the 1548 new specification defining the revised implementation requirements 1549 level. 1551 7.1.1. Registration Template 1553 Algorithm Name: 1554 The name requested (e.g., "HS256"). This name is case-sensitive. 1555 Names may not match other registered names in a case-insensitive 1556 manner unless the Designated Expert(s) state that there is a 1557 compelling reason to allow an exception in this particular case. 1559 Algorithm Description: 1560 Brief description of the Algorithm (e.g., "HMAC using SHA-256"). 1562 Algorithm Usage Location(s): 1563 The algorithm usage location. This must be one or more of the 1564 values "alg" or "enc" if the algorithm is to be used with JWS or 1565 JWE. The value "JWK" is used if the algorithm identifier will be 1566 used as a JWK "alg" member value, but will not be used with JWS or 1567 JWE; this could be the case, for instance, for non-authenticated 1568 encryption algorithms. Other values may be used with the approval 1569 of a Designated Expert. 1571 JOSE Implementation Requirements: 1572 The algorithm implementation requirements for JWS and JWE, which 1573 must be one the words Required, Recommended, Optional, Deprecated, 1574 or Prohibited. Optionally, the word can be followed by a "+" or 1575 "-". The use of "+" indicates that the requirement strength is 1576 likely to be increased in a future version of the specification. 1577 The use of "-" indicates that the requirement strength is likely 1578 to be decreased in a future version of the specification. Any 1579 identifiers registered for non-authenticated encryption algorithms 1580 or other algorithms that are otherwise unsuitable for direct use 1581 as JWS or JWE algorithms must be registered as "Prohibited". 1583 Change Controller: 1584 For Standards Track RFCs, state "IESG". For others, give the name 1585 of the responsible party. Other details (e.g., postal address, 1586 email address, home page URI) may also be included. 1588 Specification Document(s): 1589 Reference to the document(s) that specify the parameter, 1590 preferably including URI(s) that can be used to retrieve copies of 1591 the document(s). An indication of the relevant sections may also 1592 be included but is not required. 1594 7.1.2. Initial Registry Contents 1596 o Algorithm Name: "HS256" 1597 o Algorithm Description: HMAC using SHA-256 1598 o Algorithm Usage Location(s): "alg" 1599 o JOSE Implementation Requirements: Required 1600 o Change Controller: IESG 1601 o Specification Document(s): Section 3.1 of [[ this document ]] 1603 o Algorithm Name: "HS384" 1604 o Algorithm Description: HMAC using SHA-384 1605 o Algorithm Usage Location(s): "alg" 1606 o JOSE Implementation Requirements: Optional 1607 o Change Controller: IESG 1608 o Specification Document(s): Section 3.1 of [[ this document ]] 1610 o Algorithm Name: "HS512" 1611 o Algorithm Description: HMAC using SHA-512 1612 o Algorithm Usage Location(s): "alg" 1613 o JOSE Implementation Requirements: Optional 1614 o Change Controller: IESG 1615 o Specification Document(s): Section 3.1 of [[ this document ]] 1617 o Algorithm Name: "RS256" 1618 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-256 1619 o Algorithm Usage Location(s): "alg" 1620 o JOSE Implementation Requirements: Recommended 1621 o Change Controller: IESG 1622 o Specification Document(s): Section 3.1 of [[ this document ]] 1624 o Algorithm Name: "RS384" 1625 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-384 1626 o Algorithm Usage Location(s): "alg" 1627 o JOSE Implementation Requirements: Optional 1628 o Change Controller: IESG 1629 o Specification Document(s): Section 3.1 of [[ this document ]] 1631 o Algorithm Name: "RS512" 1632 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-512 1633 o Algorithm Usage Location(s): "alg" 1634 o JOSE Implementation Requirements: Optional 1635 o Change Controller: IESG 1636 o Specification Document(s): Section 3.1 of [[ this document ]] 1638 o Algorithm Name: "ES256" 1639 o Algorithm Description: ECDSA using P-256 and SHA-256 1640 o Algorithm Usage Location(s): "alg" 1641 o JOSE Implementation Requirements: Recommended+ 1642 o Change Controller: IESG 1643 o Specification Document(s): Section 3.1 of [[ this document ]] 1645 o Algorithm Name: "ES384" 1646 o Algorithm Description: ECDSA using P-384 and SHA-384 1647 o Algorithm Usage Location(s): "alg" 1648 o JOSE Implementation Requirements: Optional 1649 o Change Controller: IESG 1650 o Specification Document(s): Section 3.1 of [[ this document ]] 1652 o Algorithm Name: "ES512" 1653 o Algorithm Description: ECDSA using P-521 and SHA-512 1654 o Algorithm Usage Location(s): "alg" 1655 o JOSE Implementation Requirements: Optional 1656 o Change Controller: IESG 1657 o Specification Document(s): Section 3.1 of [[ this document ]] 1659 o Algorithm Name: "PS256" 1660 o Algorithm Description: RSASSA-PSS using SHA-256 and MGF1 with SHA- 1661 256 1662 o Algorithm Usage Location(s): "alg" 1663 o JOSE Implementation Requirements: Optional 1664 o Change Controller: IESG 1665 o Specification Document(s): Section 3.1 of [[ this document ]] 1666 o Algorithm Name: "PS384" 1667 o Algorithm Description: RSASSA-PSS using SHA-384 and MGF1 with SHA- 1668 384 1669 o Algorithm Usage Location(s): "alg" 1670 o JOSE Implementation Requirements: Optional 1671 o Change Controller: IESG 1672 o Specification Document(s): Section 3.1 of [[ this document ]] 1674 o Algorithm Name: "PS512" 1675 o Algorithm Description: RSASSA-PSS using SHA-512 and MGF1 with SHA- 1676 512 1677 o Algorithm Usage Location(s): "alg" 1678 o JOSE Implementation Requirements: Optional 1679 o Change Controller: IESG 1680 o Specification Document(s): Section 3.1 of [[ this document ]] 1682 o Algorithm Name: "none" 1683 o Algorithm Description: No digital signature or MAC performed 1684 o Algorithm Usage Location(s): "alg" 1685 o JOSE Implementation Requirements: Optional 1686 o Change Controller: IESG 1687 o Specification Document(s): Section 3.1 of [[ this document ]] 1689 o Algorithm Name: "RSA1_5" 1690 o Algorithm Description: RSAES-PKCS1-V1_5 1691 o Algorithm Usage Location(s): "alg" 1692 o JOSE Implementation Requirements: Recommended- 1693 o Change Controller: IESG 1694 o Specification Document(s): Section 4.1 of [[ this document ]] 1696 o Algorithm Name: "RSA-OAEP" 1697 o Algorithm Description: RSAES OAEP using default parameters 1698 o Algorithm Usage Location(s): "alg" 1699 o JOSE Implementation Requirements: Recommended+ 1700 o Change Controller: IESG 1701 o Specification Document(s): Section 4.1 of [[ this document ]] 1703 o Algorithm Name: "RSA-OAEP-256" 1704 o Algorithm Description: RSAES OAEP using SHA-256 and MGF1 with SHA- 1705 256 1706 o Algorithm Usage Location(s): "alg" 1707 o JOSE Implementation Requirements: Optional 1708 o Change Controller: IESG 1709 o Specification Document(s): Section 4.1 of [[ this document ]] 1711 o Algorithm Name: "A128KW" 1712 o Algorithm Description: AES Key Wrap using 128 bit key 1713 o Algorithm Usage Location(s): "alg" 1714 o JOSE Implementation Requirements: Recommended 1715 o Change Controller: IESG 1716 o Specification Document(s): Section 4.1 of [[ this document ]] 1718 o Algorithm Name: "A192KW" 1719 o Algorithm Description: AES Key Wrap using 192 bit key 1720 o Algorithm Usage Location(s): "alg" 1721 o JOSE Implementation Requirements: Optional 1722 o Change Controller: IESG 1723 o Specification Document(s): Section 4.1 of [[ this document ]] 1725 o Algorithm Name: "A256KW" 1726 o Algorithm Description: AES Key Wrap using 256 bit key 1727 o Algorithm Usage Location(s): "alg" 1728 o JOSE Implementation Requirements: Recommended 1729 o Change Controller: IESG 1730 o Specification Document(s): Section 4.1 of [[ this document ]] 1732 o Algorithm Name: "dir" 1733 o Algorithm Description: Direct use of a shared symmetric key 1734 o Algorithm Usage Location(s): "alg" 1735 o JOSE Implementation Requirements: Recommended 1736 o Change Controller: IESG 1737 o Specification Document(s): Section 4.1 of [[ this document ]] 1739 o Algorithm Name: "ECDH-ES" 1740 o Algorithm Description: ECDH-ES using Concat KDF 1741 o Algorithm Usage Location(s): "alg" 1742 o JOSE Implementation Requirements: Recommended+ 1743 o Change Controller: IESG 1744 o Specification Document(s): Section 4.1 of [[ this document ]] 1746 o Algorithm Name: "ECDH-ES+A128KW" 1747 o Algorithm Description: ECDH-ES using Concat KDF and "A128KW" 1748 wrapping 1749 o Algorithm Usage Location(s): "alg" 1750 o JOSE Implementation Requirements: Recommended 1751 o Change Controller: IESG 1752 o Specification Document(s): Section 4.1 of [[ this document ]] 1754 o Algorithm Name: "ECDH-ES+A192KW" 1755 o Algorithm Description: ECDH-ES using Concat KDF and "A192KW" 1756 wrapping 1757 o Algorithm Usage Location(s): "alg" 1758 o JOSE Implementation Requirements: Optional 1759 o Change Controller: IESG 1760 o Specification Document(s): Section 4.1 of [[ this document ]] 1762 o Algorithm Name: "ECDH-ES+A256KW" 1763 o Algorithm Description: ECDH-ES using Concat KDF and "A256KW" 1764 wrapping 1765 o Algorithm Usage Location(s): "alg" 1766 o JOSE Implementation Requirements: Recommended 1767 o Change Controller: IESG 1768 o Specification Document(s): Section 4.1 of [[ this document ]] 1770 o Algorithm Name: "A128GCMKW" 1771 o Algorithm Description: Key wrapping with AES GCM using 128 bit key 1772 o Algorithm Usage Location(s): "alg" 1773 o JOSE Implementation Requirements: Optional 1774 o Change Controller: IESG 1775 o Specification Document(s): Section 4.7 of [[ this document ]] 1777 o Algorithm Name: "A192GCMKW" 1778 o Algorithm Description: Key wrapping with AES GCM using 192 bit key 1779 o Algorithm Usage Location(s): "alg" 1780 o JOSE Implementation Requirements: Optional 1781 o Change Controller: IESG 1782 o Specification Document(s): Section 4.7 of [[ this document ]] 1784 o Algorithm Name: "A256GCMKW" 1785 o Algorithm Description: Key wrapping with AES GCM using 256 bit key 1786 o Algorithm Usage Location(s): "alg" 1787 o JOSE Implementation Requirements: Optional 1788 o Change Controller: IESG 1789 o Specification Document(s): Section 4.7 of [[ this document ]] 1791 o Algorithm Name: "PBES2-HS256+A128KW" 1792 o Algorithm Description: PBES2 with HMAC SHA-256 and "A128KW" 1793 wrapping 1794 o Algorithm Usage Location(s): "alg" 1795 o JOSE Implementation Requirements: Optional 1796 o Change Controller: IESG 1797 o Specification Document(s): Section 4.8 of [[ this document ]] 1799 o Algorithm Name: "PBES2-HS384+A192KW" 1800 o Algorithm Description: PBES2 with HMAC SHA-384 and "A192KW" 1801 wrapping 1802 o Algorithm Usage Location(s): "alg" 1803 o JOSE Implementation Requirements: Optional 1804 o Change Controller: IESG 1805 o Specification Document(s): Section 4.8 of [[ this document ]] 1807 o Algorithm Name: "PBES2-HS512+A256KW" 1808 o Algorithm Description: PBES2 with HMAC SHA-512 and "A256KW" 1809 wrapping 1810 o Algorithm Usage Location(s): "alg" 1811 o JOSE Implementation Requirements: Optional 1812 o Change Controller: IESG 1813 o Specification Document(s): Section 4.8 of [[ this document ]] 1815 o Algorithm Name: "A128CBC-HS256" 1816 o Algorithm Description: AES_128_CBC_HMAC_SHA_256 authenticated 1817 encryption algorithm 1818 o Algorithm Usage Location(s): "enc" 1819 o JOSE Implementation Requirements: Required 1820 o Change Controller: IESG 1821 o Specification Document(s): Section 5.1 of [[ this document ]] 1823 o Algorithm Name: "A192CBC-HS384" 1824 o Algorithm Description: AES_192_CBC_HMAC_SHA_384 authenticated 1825 encryption algorithm 1826 o Algorithm Usage Location(s): "enc" 1827 o JOSE Implementation Requirements: Optional 1828 o Change Controller: IESG 1829 o Specification Document(s): Section 5.1 of [[ this document ]] 1831 o Algorithm Name: "A256CBC-HS512" 1832 o Algorithm Description: AES_256_CBC_HMAC_SHA_512 authenticated 1833 encryption algorithm 1834 o Algorithm Usage Location(s): "enc" 1835 o JOSE Implementation Requirements: Required 1836 o Change Controller: IESG 1837 o Specification Document(s): Section 5.1 of [[ this document ]] 1839 o Algorithm Name: "A128GCM" 1840 o Algorithm Description: AES GCM using 128 bit key 1841 o Algorithm Usage Location(s): "enc" 1842 o JOSE Implementation Requirements: Recommended 1843 o Change Controller: IESG 1844 o Specification Document(s): Section 5.1 of [[ this document ]] 1846 o Algorithm Name: "A192GCM" 1847 o Algorithm Description: AES GCM using 192 bit key 1848 o Algorithm Usage Location(s): "enc" 1849 o JOSE Implementation Requirements: Optional 1850 o Change Controller: IESG 1851 o Specification Document(s): Section 5.1 of [[ this document ]] 1853 o Algorithm Name: "A256GCM" 1854 o Algorithm Description: AES GCM using 256 bit key 1855 o Algorithm Usage Location(s): "enc" 1856 o JOSE Implementation Requirements: Recommended 1857 o Change Controller: IESG 1858 o Specification Document(s): Section 5.1 of [[ this document ]] 1860 7.2. Header Parameter Names Registration 1862 This specification registers the Header Parameter names defined in 1863 Section 4.6.1, Section 4.7.1, and Section 4.8.1 in the IANA JSON Web 1864 Signature and Encryption Header Parameters registry defined in [JWS]. 1866 7.2.1. Registry Contents 1868 o Header Parameter Name: "epk" 1869 o Header Parameter Description: Ephemeral Public Key 1870 o Header Parameter Usage Location(s): JWE 1871 o Change Controller: IESG 1872 o Specification Document(s): Section 4.6.1.1 of [[ this document ]] 1874 o Header Parameter Name: "apu" 1875 o Header Parameter Description: Agreement PartyUInfo 1876 o Header Parameter Usage Location(s): JWE 1877 o Change Controller: IESG 1878 o Specification Document(s): Section 4.6.1.2 of [[ this document ]] 1880 o Header Parameter Name: "apv" 1881 o Header Parameter Description: Agreement PartyVInfo 1882 o Header Parameter Usage Location(s): JWE 1883 o Change Controller: IESG 1884 o Specification Document(s): Section 4.6.1.3 of [[ this document ]] 1886 o Header Parameter Name: "iv" 1887 o Header Parameter Description: Initialization Vector 1888 o Header Parameter Usage Location(s): JWE 1889 o Change Controller: IESG 1890 o Specification Document(s): Section 4.7.1.1 of [[ this document ]] 1892 o Header Parameter Name: "tag" 1893 o Header Parameter Description: Authentication Tag 1894 o Header Parameter Usage Location(s): JWE 1895 o Change Controller: IESG 1896 o Specification Document(s): Section 4.7.1.2 of [[ this document ]] 1898 o Header Parameter Name: "p2s" 1899 o Header Parameter Description: PBES2 salt 1900 o Header Parameter Usage Location(s): JWE 1901 o Change Controller: IESG 1902 o Specification Document(s): Section 4.8.1.1 of [[ this document ]] 1904 o Header Parameter Name: "p2c" 1905 o Header Parameter Description: PBES2 count 1906 o Header Parameter Usage Location(s): JWE 1907 o Change Controller: IESG 1908 o Specification Document(s): Section 4.8.1.2 of [[ this document ]] 1910 7.3. JSON Web Encryption Compression Algorithms Registry 1912 This specification establishes the IANA JSON Web Encryption 1913 Compression Algorithms registry for JWE "zip" member values. The 1914 registry records the compression algorithm value and a reference to 1915 the specification that defines it. 1917 7.3.1. Registration Template 1919 Compression Algorithm Value: 1920 The name requested (e.g., "DEF"). Because a core goal of this 1921 specification is for the resulting representations to be compact, 1922 it is RECOMMENDED that the name be short -- not to exceed 8 1923 characters without a compelling reason to do so. This name is 1924 case-sensitive. Names may not match other registered names in a 1925 case-insensitive manner unless the Designated Expert(s) state that 1926 there is a compelling reason to allow an exception in this 1927 particular case. 1929 Compression Algorithm Description: 1930 Brief description of the compression algorithm (e.g., "DEFLATE"). 1932 Change Controller: 1933 For Standards Track RFCs, state "IESG". For others, give the name 1934 of the responsible party. Other details (e.g., postal address, 1935 email address, home page URI) may also be included. 1937 Specification Document(s): 1938 Reference to the document(s) that specify the parameter, 1939 preferably including URI(s) that can be used to retrieve copies of 1940 the document(s). An indication of the relevant sections may also 1941 be included but is not required. 1943 7.3.2. Initial Registry Contents 1945 o Compression Algorithm Value: "DEF" 1946 o Compression Algorithm Description: DEFLATE 1947 o Change Controller: IESG 1948 o Specification Document(s): JSON Web Encryption (JWE) [JWE] 1950 7.4. JSON Web Key Types Registry 1952 This specification establishes the IANA JSON Web Key Types registry 1953 for values of the JWK "kty" (key type) parameter. The registry 1954 records the "kty" value, implementation requirements, and a reference 1955 to the specification that defines it. 1957 The implementation requirements of a key type may be changed over 1958 time as the cryptographic landscape evolves, for instance, to change 1959 the status of a key type to Deprecated, or to change the status of a 1960 key type from Optional to Recommended+ or Required. Changes of 1961 implementation requirements are only permitted on a Specification 1962 Required basis after review by the Designated Experts(s), with the 1963 new specification defining the revised implementation requirements 1964 level. 1966 7.4.1. Registration Template 1968 "kty" Parameter Value: 1969 The name requested (e.g., "EC"). Because a core goal of this 1970 specification is for the resulting representations to be compact, 1971 it is RECOMMENDED that the name be short -- not to exceed 8 1972 characters without a compelling reason to do so. This name is 1973 case-sensitive. Names may not match other registered names in a 1974 case-insensitive manner unless the Designated Expert(s) state that 1975 there is a compelling reason to allow an exception in this 1976 particular case. 1978 Key Type Description: 1979 Brief description of the Key Type (e.g., "Elliptic Curve"). 1981 Change Controller: 1982 For Standards Track RFCs, state "IESG". For others, give the name 1983 of the responsible party. Other details (e.g., postal address, 1984 email address, home page URI) may also be included. 1986 JOSE Implementation Requirements: 1987 The key type implementation requirements for JWS and JWE, which 1988 must be one the words Required, Recommended, Optional, Deprecated, 1989 or Prohibited. Optionally, the word can be followed by a "+" or 1990 "-". The use of "+" indicates that the requirement strength is 1991 likely to be increased in a future version of the specification. 1992 The use of "-" indicates that the requirement strength is likely 1993 to be decreased in a future version of the specification. 1995 Specification Document(s): 1996 Reference to the document(s) that specify the parameter, 1997 preferably including URI(s) that can be used to retrieve copies of 1998 the document(s). An indication of the relevant sections may also 1999 be included but is not required. 2001 7.4.2. Initial Registry Contents 2003 This specification registers the values defined in Section 6.1. 2005 o "kty" Parameter Value: "EC" 2006 o Key Type Description: Elliptic Curve 2007 o JOSE Implementation Requirements: Recommended+ 2008 o Change Controller: IESG 2009 o Specification Document(s): Section 6.2 of [[ this document ]] 2011 o "kty" Parameter Value: "RSA" 2012 o Key Type Description: RSA 2013 o JOSE Implementation Requirements: Required 2014 o Change Controller: IESG 2015 o Specification Document(s): Section 6.3 of [[ this document ]] 2017 o "kty" Parameter Value: "oct" 2018 o Key Type Description: Octet sequence 2019 o JOSE Implementation Requirements: Required 2020 o Change Controller: IESG 2021 o Specification Document(s): Section 6.4 of [[ this document ]] 2023 7.5. JSON Web Key Parameters Registration 2025 This specification registers the parameter names defined in Sections 2026 6.2, 6.3, and 6.4 in the IANA JSON Web Key Parameters registry 2027 defined in [JWK]. 2029 7.5.1. Registry Contents 2031 o Parameter Name: "crv" 2032 o Parameter Description: Curve 2033 o Used with "kty" Value(s): "EC" 2034 o Parameter Information Class: Public 2035 o Change Controller: IESG 2036 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2037 o Parameter Name: "x" 2038 o Parameter Description: X Coordinate 2039 o Used with "kty" Value(s): "EC" 2040 o Parameter Information Class: Public 2041 o Change Controller: IESG 2042 o Specification Document(s): Section 6.2.1.2 of [[ this document ]] 2044 o Parameter Name: "y" 2045 o Parameter Description: Y Coordinate 2046 o Used with "kty" Value(s): "EC" 2047 o Parameter Information Class: Public 2048 o Change Controller: IESG 2049 o Specification Document(s): Section 6.2.1.3 of [[ this document ]] 2051 o Parameter Name: "d" 2052 o Parameter Description: ECC Private Key 2053 o Used with "kty" Value(s): "EC" 2054 o Parameter Information Class: Private 2055 o Change Controller: IESG 2056 o Specification Document(s): Section 6.2.2.1 of [[ this document ]] 2058 o Parameter Name: "n" 2059 o Parameter Description: Modulus 2060 o Used with "kty" Value(s): "RSA" 2061 o Parameter Information Class: Public 2062 o Change Controller: IESG 2063 o Specification Document(s): Section 6.3.1.1 of [[ this document ]] 2065 o Parameter Name: "e" 2066 o Parameter Description: Exponent 2067 o Used with "kty" Value(s): "RSA" 2068 o Parameter Information Class: Public 2069 o Change Controller: IESG 2070 o Specification Document(s): Section 6.3.1.2 of [[ this document ]] 2072 o Parameter Name: "d" 2073 o Parameter Description: Private Exponent 2074 o Used with "kty" Value(s): "RSA" 2075 o Parameter Information Class: Private 2076 o Change Controller: IESG 2077 o Specification Document(s): Section 6.3.2.1 of [[ this document ]] 2079 o Parameter Name: "p" 2080 o Parameter Description: First Prime Factor 2081 o Used with "kty" Value(s): "RSA" 2082 o Parameter Information Class: Private 2083 o Change Controller: IESG 2084 o Specification Document(s): Section 6.3.2.2 of [[ this document ]] 2086 o Parameter Name: "q" 2087 o Parameter Description: Second Prime Factor 2088 o Used with "kty" Value(s): "RSA" 2089 o Parameter Information Class: Private 2090 o Change Controller: IESG 2091 o Specification Document(s): Section 6.3.2.3 of [[ this document ]] 2093 o Parameter Name: "dp" 2094 o Parameter Description: First Factor CRT Exponent 2095 o Used with "kty" Value(s): "RSA" 2096 o Parameter Information Class: Private 2097 o Change Controller: IESG 2098 o Specification Document(s): Section 6.3.2.4 of [[ this document ]] 2100 o Parameter Name: "dq" 2101 o Parameter Description: Second Factor CRT Exponent 2102 o Used with "kty" Value(s): "RSA" 2103 o Parameter Information Class: Private 2104 o Change Controller: IESG 2105 o Specification Document(s): Section 6.3.2.5 of [[ this document ]] 2107 o Parameter Name: "qi" 2108 o Parameter Description: First CRT Coefficient 2109 o Used with "kty" Value(s): "RSA" 2110 o Parameter Information Class: Private 2111 o Change Controller: IESG 2112 o Specification Document(s): Section 6.3.2.6 of [[ this document ]] 2114 o Parameter Name: "oth" 2115 o Parameter Description: Other Primes Info 2116 o Used with "kty" Value(s): "RSA" 2117 o Parameter Information Class: Private 2118 o Change Controller: IESG 2119 o Specification Document(s): Section 6.3.2.7 of [[ this document ]] 2121 o Parameter Name: "k" 2122 o Parameter Description: Key Value 2123 o Used with "kty" Value(s): "oct" 2124 o Parameter Information Class: Private 2125 o Change Controller: IESG 2126 o Specification Document(s): Section 6.4.1 of [[ this document ]] 2128 7.6. JSON Web Key Elliptic Curve Registry 2130 This specification establishes the IANA JSON Web Key Elliptic Curve 2131 registry for JWK "crv" member values. The registry records the curve 2132 name, implementation requirements, and a reference to the 2133 specification that defines it. This specification registers the 2134 parameter names defined in Section 6.2.1.1. 2136 The implementation requirements of a curve may be changed over time 2137 as the cryptographic landscape evolves, for instance, to change the 2138 status of a curve to Deprecated, or to change the status of a curve 2139 from Optional to Recommended+ or Required. Changes of implementation 2140 requirements are only permitted on a Specification Required basis 2141 after review by the Designated Experts(s), with the new specification 2142 defining the revised implementation requirements level. 2144 7.6.1. Registration Template 2146 Curve Name: 2147 The name requested (e.g., "P-256"). Because a core goal of this 2148 specification is for the resulting representations to be compact, 2149 it is RECOMMENDED that the name be short -- not to exceed 8 2150 characters without a compelling reason to do so. This name is 2151 case-sensitive. Names may not match other registered names in a 2152 case-insensitive manner unless the Designated Expert(s) state that 2153 there is a compelling reason to allow an exception in this 2154 particular case. 2156 Curve Description: 2157 Brief description of the curve (e.g., "P-256 curve"). 2159 JOSE Implementation Requirements: 2160 The curve implementation requirements for JWS and JWE, which must 2161 be one the words Required, Recommended, Optional, Deprecated, or 2162 Prohibited. Optionally, the word can be followed by a "+" or "-". 2163 The use of "+" indicates that the requirement strength is likely 2164 to be increased in a future version of the specification. The use 2165 of "-" indicates that the requirement strength is likely to be 2166 decreased in a future version of the specification. 2168 Change Controller: 2169 For Standards Track RFCs, state "IESG". For others, give the name 2170 of the responsible party. Other details (e.g., postal address, 2171 email address, home page URI) may also be included. 2173 Specification Document(s): 2174 Reference to the document(s) that specify the parameter, 2175 preferably including URI(s) that can be used to retrieve copies of 2176 the document(s). An indication of the relevant sections may also 2177 be included but is not required. 2179 7.6.2. Initial Registry Contents 2181 o Curve Name: "P-256" 2182 o Curve Description: P-256 curve 2183 o JOSE Implementation Requirements: Recommended+ 2184 o Change Controller: IESG 2185 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2187 o Curve Name: "P-384" 2188 o Curve Description: P-384 curve 2189 o JOSE Implementation Requirements: Optional 2190 o Change Controller: IESG 2191 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2193 o Curve Name: "P-521" 2194 o Curve Description: P-521 curve 2195 o JOSE Implementation Requirements: Optional 2196 o Change Controller: IESG 2197 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2199 8. Security Considerations 2201 All of the security issues that are pertinent to any cryptographic 2202 application must be addressed by JWS/JWE/JWK agents. Among these 2203 issues are protecting the user's asymmetric private and symmetric 2204 secret keys and employing countermeasures to various attacks. 2206 The security considerations in [AES], [DSS], [JWE], [JWK], [JWS], 2207 [NIST.800-38D], [NIST.800-56A], [NIST.800-107], [RFC2104], [RFC3394], 2208 [RFC3447], [RFC5116], [RFC6090], and [SHS] apply to this 2209 specification. 2211 8.1. Cryptographic Agility 2213 Implementers should be aware that cryptographic algorithms become 2214 weaker with time. As new cryptanalysis techniques are developed and 2215 computing performance improves, the work factor to break a particular 2216 cryptographic algorithm will be reduced. Therefore, implementers and 2217 deployments must be prepared for the set of algorithms that are 2218 supported and used to change over time. Thus, cryptographic 2219 algorithm implementations should be modular, allowing new algorithms 2220 to be readily inserted. 2222 8.2. Key Lifetimes 2224 Many algorithms have associated security considerations related to 2225 key lifetimes and/or the number of times that a key may be used. 2226 Those security considerations continue to apply when using those 2227 algorithms with JOSE data structures. See NIST SP 800-57 2228 [NIST.800-57] for specific guidance on key lifetimes. 2230 8.3. RSAES-PKCS1-v1_5 Security Considerations 2232 While Section 8 of RFC 3447 [RFC3447] explicitly calls for people not 2233 to adopt RSASSA-PKCS-v1_5 for new applications and instead requests 2234 that people transition to RSASSA-PSS, this specification does include 2235 RSASSA-PKCS-v1_5, for interoperability reasons, because it is 2236 commonly implemented. 2238 Keys used with RSAES-PKCS1-v1_5 must follow the constraints in 2239 Section 7.2 of RFC 3447. Also, keys with a low public key exponent 2240 value, as described in Section 3 of Twenty years of attacks on the 2241 RSA cryptosystem [Boneh99], must not be used. 2243 8.4. AES GCM Security Considerations 2245 Keys used with AES GCM must follow the constraints in Section 8.3 of 2246 [NIST.800-38D], which states: "The total number of invocations of the 2247 authenticated encryption function shall not exceed 2^32, including 2248 all IV lengths and all instances of the authenticated encryption 2249 function with the given key". In accordance with this rule, AES GCM 2250 MUST NOT be used with the same key value more than 2^32 times. 2252 An Initialization Vector value MUST NOT ever be used multiple times 2253 with the same AES GCM key. One way to prevent this is to store a 2254 counter with the key and increment it with every use. The counter 2255 can also be used to prevent exceeding the 2^32 limit above. 2257 This security consideration does not apply to the composite AES-CBC 2258 HMAC SHA-2 or AES Key Wrap algorithms. 2260 8.5. Unsecured JWS Security Considerations 2262 Unsecured JWSs (JWSs that use the "alg" value "none") provide no 2263 integrity protection. Thus, they must only be used in contexts in 2264 which the payload is secured by means other than a digital signature 2265 or MAC value, or need not be secured. 2267 Implementations that support Unsecured JWS objects MUST NOT accept 2268 such objects as valid unless the application specifies that it is 2269 acceptable for a specific object to not be integrity-protected. 2270 Implementations MUST NOT accept Unsecured JWS objects by default. 2271 For example, the "verify" method of a hypothetical JWS software 2272 library might have a Boolean "acceptUnsigned" parameter that 2273 indicates "none" is an acceptable "alg" value. As another example, 2274 the "verify" method might take a list of algorithms that are 2275 acceptable to the application as a parameter and would reject 2276 Unsecured JWS values if "none" is not in that list. 2278 In order to mitigate downgrade attacks, applications MUST NOT signal 2279 acceptance of Unsecured JWS objects at a global level, and SHOULD 2280 signal acceptance on a per-object basis. For example, suppose an 2281 application accepts JWS objects over two channels, (1) HTTP and (2) 2282 HTTPS with client authentication. It requires a JWS signature on 2283 objects received over HTTP, but accepts Unsecured JWS objects over 2284 HTTPS. If the application were to globally indicate that "none" is 2285 acceptable, then an attacker could provide it with an unsigned object 2286 over HTTP and still have that object successfully validate. Instead, 2287 the application needs to indicate acceptance of "none" for each 2288 object received over HTTPS (e.g., by setting "acceptUnsigned" to 2289 "true" for the first hypothetical JWS software library above), but 2290 not for each object received over HTTP. 2292 8.6. Denial of Service Attacks 2294 Receiving agents that validate signatures and sending agents that 2295 encrypt messages need to be cautious of cryptographic processing 2296 usage when validating signatures and encrypting messages using keys 2297 larger than those mandated in this specification. An attacker could 2298 supply content using keys that would result in excessive 2299 cryptographic processing, for example, keys larger than those 2300 mandated in this specification. Implementations should set and 2301 enforce upper limits on the key sizes they accept. Section 5.6.1 2302 (Comparable Algorithm Strengths) of NIST SP 800-57 [NIST.800-57] 2303 contains statements on largest approved key sizes that may be 2304 applicable. 2306 8.7. Reusing Key Material when Encrypting Keys 2308 It is NOT RECOMMENDED to reuse the same entire set of key material 2309 (Key Encryption Key, Content Encryption Key, Initialization Vector, 2310 etc.) to encrypt multiple JWK or JWK Set objects, or to encrypt the 2311 same JWK or JWK Set object multiple times. One suggestion for 2312 preventing re-use is to always generate at least one new piece of key 2313 material for each encryption operation (e.g., a new Content 2314 Encryption Key, a new Initialization Vector, and/or a new PBES2 2315 Salt), based on the considerations noted in this document as well as 2316 from RFC 4086 [RFC4086]. 2318 8.8. Password Considerations 2320 Passwords are vulnerable to a number of attacks. To help mitigate 2321 some of these limitations, this document applies principles from RFC 2322 2898 [RFC2898] to derive cryptographic keys from user-supplied 2323 passwords. 2325 However, the strength of the password still has a significant impact. 2326 A high-entropy password has greater resistance to dictionary attacks. 2327 [NIST.800-63-1] contains guidelines for estimating password entropy, 2328 which can help applications and users generate stronger passwords. 2330 An ideal password is one that is as large as (or larger than) the 2331 derived key length. However, passwords larger than a certain 2332 algorithm-specific size are first hashed, which reduces an attacker's 2333 effective search space to the length of the hash algorithm. It is 2334 RECOMMENDED that a password used for "PBES2-HS256+A128KW" be no 2335 shorter than 16 octets and no longer than 128 octets and a password 2336 used for "PBES2-HS512+A256KW" be no shorter than 32 octets and no 2337 longer than 128 octets long. 2339 Still, care needs to be taken in where and how password-based 2340 encryption is used. These algorithms can still be susceptible to 2341 dictionary-based attacks if the iteration count is too small; this is 2342 of particular concern if these algorithms are used to protect data 2343 that an attacker can have indefinite number of attempts to circumvent 2344 the protection, such as protected data stored on a file system. 2346 8.9. Key Entropy and Random Values 2348 See Section 10.1 of [JWS] for security considerations on key entropy 2349 and random values. 2351 8.10. Differences between Digital Signatures and MACs 2353 See Section 10.5 of [JWS] for security considerations on differences 2354 between digital signatures and MACs. 2356 8.11. Using Matching Algorithm Strengths 2358 See Section 11.3 of [JWE] for security considerations on using 2359 matching algorithm strengths. 2361 8.12. Adaptive Chosen-Ciphertext Attacks 2363 See Section 11.4 of [JWE] for security considerations on adaptive 2364 chosen-ciphertext attacks. 2366 8.13. Timing Attacks 2368 See Section 10.9 of [JWS] and Section 11.5 of [JWE] for security 2369 considerations on timing attacks. 2371 8.14. RSA Private Key Representations and Blinding 2373 See Section 9.3 of [JWK] for security considerations on RSA private 2374 key representations and blinding. 2376 9. Internationalization Considerations 2378 Passwords obtained from users are likely to require preparation and 2379 normalization to account for differences of octet sequences generated 2380 by different input devices, locales, etc. It is RECOMMENDED that 2381 applications to perform the steps outlined in 2382 [I-D.ietf-precis-saslprepbis] to prepare a password supplied directly 2383 by a user before performing key derivation and encryption. 2385 10. References 2387 10.1. Normative References 2389 [AES] National Institute of Standards and Technology (NIST), 2390 "Advanced Encryption Standard (AES)", FIPS PUB 197, 2391 November 2001. 2393 [Boneh99] "Twenty years of attacks on the RSA cryptosystem", Notices 2394 of the American Mathematical Society (AMS), Vol. 46, No. 2395 2, pp. 203-213 http://crypto.stanford.edu/~dabo/pubs/ 2396 papers/RSA-survey.pdf, 1999. 2398 [DSS] National Institute of Standards and Technology, "Digital 2399 Signature Standard (DSS)", FIPS PUB 186-4, July 2013. 2401 [JWE] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", 2402 draft-ietf-jose-json-web-encryption (work in progress), 2403 October 2014. 2405 [JWK] Jones, M., "JSON Web Key (JWK)", 2406 draft-ietf-jose-json-web-key (work in progress), 2407 October 2014. 2409 [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 2410 Signature (JWS)", draft-ietf-jose-json-web-signature (work 2411 in progress), October 2014. 2413 [NIST.800-38A] 2414 National Institute of Standards and Technology (NIST), 2415 "Recommendation for Block Cipher Modes of Operation", 2416 NIST PUB 800-38A, December 2001. 2418 [NIST.800-38D] 2419 National Institute of Standards and Technology (NIST), 2420 "Recommendation for Block Cipher Modes of Operation: 2421 Galois/Counter Mode (GCM) and GMAC", NIST PUB 800-38D, 2422 December 2001. 2424 [NIST.800-56A] 2425 National Institute of Standards and Technology (NIST), 2426 "Recommendation for Pair-Wise Key Establishment Schemes 2427 Using Discrete Logarithm Cryptography", NIST Special 2428 Publication 800-56A, Revision 2, May 2013. 2430 [NIST.800-57] 2431 National Institute of Standards and Technology (NIST), 2432 "Recommendation for Key Management - Part 1: General 2433 (Revision 3)", NIST Special Publication 800-57, Part 1, 2434 Revision 3, July 2012. 2436 [RFC20] Cerf, V., "ASCII format for Network Interchange", RFC 20, 2437 October 1969. 2439 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 2440 Hashing for Message Authentication", RFC 2104, 2441 February 1997. 2443 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2444 Requirement Levels", BCP 14, RFC 2119, March 1997. 2446 [RFC2898] Kaliski, B., "PKCS #5: Password-Based Cryptography 2447 Specification Version 2.0", RFC 2898, September 2000. 2449 [RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard 2450 (AES) Key Wrap Algorithm", RFC 3394, September 2002. 2452 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 2453 Standards (PKCS) #1: RSA Cryptography Specifications 2454 Version 2.1", RFC 3447, February 2003. 2456 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2457 10646", STD 63, RFC 3629, November 2003. 2459 [RFC4868] Kelly, S. and S. Frankel, "Using HMAC-SHA-256, HMAC-SHA- 2460 384, and HMAC-SHA-512 with IPsec", RFC 4868, May 2007. 2462 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2463 RFC 4949, August 2007. 2465 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 2466 RFC 5652, September 2009. 2468 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 2469 Curve Cryptography Algorithms", RFC 6090, February 2011. 2471 [RFC7159] Bray, T., "The JavaScript Object Notation (JSON) Data 2472 Interchange Format", RFC 7159, March 2014. 2474 [SEC1] Standards for Efficient Cryptography Group, "SEC 1: 2475 Elliptic Curve Cryptography", Version 2.0, May 2009. 2477 [SHS] National Institute of Standards and Technology, "Secure 2478 Hash Standard (SHS)", FIPS PUB 180-4, March 2012. 2480 [USASCII] American National Standards Institute, "Coded Character 2481 Set -- 7-bit American Standard Code for Information 2482 Interchange", ANSI X3.4, 1986. 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 and 2491 Comparison of Internationalized Strings Representing 2492 Usernames and Passwords", draft-ietf-precis-saslprepbis-08 2493 (work in progress), October 2014. 2495 [I-D.mcgrew-aead-aes-cbc-hmac-sha2] 2496 McGrew, D., Foley, J., and K. Paterson, "Authenticated 2497 Encryption with AES-CBC and HMAC-SHA", 2498 draft-mcgrew-aead-aes-cbc-hmac-sha2-05 (work in progress), 2499 July 2014. 2501 [I-D.miller-jose-jwe-protected-jwk] 2502 Miller, M., "Using JavaScript Object Notation (JSON) Web 2503 Encryption (JWE) for Protecting JSON Web Key (JWK) 2504 Objects", draft-miller-jose-jwe-protected-jwk-02 (work in 2505 progress), June 2013. 2507 [I-D.rescorla-jsms] 2508 Rescorla, E. and J. Hildebrand, "JavaScript Message 2509 Security Format", draft-rescorla-jsms-00 (work in 2510 progress), March 2011. 2512 [JCA] Oracle, "Java Cryptography Architecture (JCA) Reference 2513 Guide", 2014. 2515 [JSE] Bradley, J. and N. Sakimura (editor), "JSON Simple 2516 Encryption", September 2010. 2518 [JSS] Bradley, J. and N. Sakimura (editor), "JSON Simple Sign", 2519 September 2010. 2521 [MagicSignatures] 2522 Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic 2523 Signatures", January 2011. 2525 [NIST.800-107] 2526 National Institute of Standards and Technology (NIST), 2527 "Recommendation for Applications Using Approved Hash 2528 Algorithms", NIST Special Publication 800-107, Revision 1, 2529 August 2012. 2531 [NIST.800-63-1] 2532 National Institute of Standards and Technology (NIST), 2533 "Electronic Authentication Guideline", NIST Special 2534 Publication 800-63-1, December 2011. 2536 [RFC2631] Rescorla, E., "Diffie-Hellman Key Agreement Method", 2537 RFC 2631, June 1999. 2539 [RFC3275] Eastlake, D., Reagle, J., and D. Solo, "(Extensible Markup 2540 Language) XML-Signature Syntax and Processing", RFC 3275, 2541 March 2002. 2543 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 2544 Requirements for Security", BCP 106, RFC 4086, June 2005. 2546 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 2547 Encryption", RFC 5116, January 2008. 2549 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2550 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2551 May 2008. 2553 [W3C.NOTE-xmldsig-core2-20130411] 2554 Eastlake, D., Reagle, J., Solo, D., Hirsch, F., Roessler, 2555 T., Yiu, K., Datta, P., and S. Cantor, "XML Signature 2556 Syntax and Processing Version 2.0", World Wide Web 2557 Consortium Note NOTE-xmldsig-core2-20130411, April 2013, 2558 . 2560 [W3C.REC-xmlenc-core-20021210] 2561 Eastlake, D. and J. Reagle, "XML Encryption Syntax and 2562 Processing", World Wide Web Consortium Recommendation REC- 2563 xmlenc-core-20021210, December 2002, 2564 . 2566 [W3C.REC-xmlenc-core1-20130411] 2567 Eastlake, D., Reagle, J., Hirsch, F., and T. Roessler, 2568 "XML Encryption Syntax and Processing Version 1.1", World 2569 Wide Web Consortium Recommendation REC-xmlenc-core1- 2570 20130411, April 2013, 2571 . 2573 Appendix A. Algorithm Identifier Cross-Reference 2575 This appendix contains tables cross-referencing the cryptographic 2576 algorithm identifier values defined in this specification with the 2577 equivalent identifiers used by other standards and software packages. 2578 See XML DSIG [RFC3275], XML DSIG 2.0 2579 [W3C.NOTE-xmldsig-core2-20130411], XML Encryption 2580 [W3C.REC-xmlenc-core-20021210], XML Encryption 1.1 2581 [W3C.REC-xmlenc-core1-20130411], and Java Cryptography Architecture 2582 [JCA] for more information about the names defined by those 2583 documents. 2585 A.1. Digital Signature/MAC Algorithm Identifier Cross-Reference 2587 This section contains a table cross-referencing the JWS digital 2588 signature and MAC "alg" (algorithm) values defined in this 2589 specification with the equivalent identifiers used by other standards 2590 and software packages. 2592 +-------+------------------------------+-------------+--------------+ 2593 | JWS | XML DSIG | JCA | OID | 2594 +-------+------------------------------+-------------+--------------+ 2595 | HS256 | http://www.w3.org/2001/04/xm | HmacSHA256 | 1.2.840.1135 | 2596 | | ldsig-more#hmac-sha256 | | 49.2.9 | 2597 | HS384 | http://www.w3.org/2001/04/xm | HmacSHA384 | 1.2.840.1135 | 2598 | | ldsig-more#hmac-sha384 | | 49.2.10 | 2599 | HS512 | http://www.w3.org/2001/04/xm | HmacSHA512 | 1.2.840.1135 | 2600 | | ldsig-more#hmac-sha512 | | 49.2.11 | 2601 | RS256 | http://www.w3.org/2001/04/xm | SHA256withR | 1.2.840.1135 | 2602 | | ldsig-more#rsa-sha256 | SA | 49.1.1.11 | 2603 | RS384 | http://www.w3.org/2001/04/xm | SHA384withR | 1.2.840.1135 | 2604 | | ldsig-more#rsa-sha384 | SA | 49.1.1.12 | 2605 | RS512 | http://www.w3.org/2001/04/xm | SHA512withR | 1.2.840.1135 | 2606 | | ldsig-more#rsa-sha512 | SA | 49.1.1.13 | 2607 | ES256 | http://www.w3.org/2001/04/xm | SHA256withE | 1.2.840.1004 | 2608 | | ldsig-more#ecdsa-sha256 | CDSA | 5.4.3.2 | 2609 | ES384 | http://www.w3.org/2001/04/xm | SHA384withE | 1.2.840.1004 | 2610 | | ldsig-more#ecdsa-sha384 | CDSA | 5.4.3.3 | 2611 | ES512 | http://www.w3.org/2001/04/xm | SHA512withE | 1.2.840.1004 | 2612 | | ldsig-more#ecdsa-sha512 | CDSA | 5.4.3.4 | 2613 | PS256 | http://www.w3.org/2007/05/xm | SHA256withR | 1.2.840.1135 | 2614 | | ldsig-more#sha256-rsa-MGF1 | SAandMGF1 | 49.1.1.10 | 2615 | PS384 | http://www.w3.org/2007/05/xm | SHA384withR | 1.2.840.1135 | 2616 | | ldsig-more#sha384-rsa-MGF1 | SAandMGF1 | 49.1.1.10 | 2617 | PS512 | http://www.w3.org/2007/05/xm | SHA512withR | 1.2.840.1135 | 2618 | | ldsig-more#sha512-rsa-MGF1 | SAandMGF1 | 49.1.1.10 | 2619 +-------+------------------------------+-------------+--------------+ 2621 A.2. Key Management Algorithm Identifier Cross-Reference 2623 This section contains a table cross-referencing the JWE "alg" 2624 (algorithm) values defined in this specification with the equivalent 2625 identifiers used by other standards and software packages. 2627 +----------+----------------------+-------------------+-------------+ 2628 | JWE | XML ENC | JCA | OID | 2629 +----------+----------------------+-------------------+-------------+ 2630 | RSA1_5 | http://www.w3.org/20 | RSA/ECB/PKCS1Padd | 1.2.840.113 | 2631 | | 01/04/xmlenc#rsa-1_5 | ing | 549.1.1.1 | 2632 | RSA-OAEP | http://www.w3.org/20 | RSA/ECB/OAEPWithS | 1.2.840.113 | 2633 | | 01/04/xmlenc#rsa-oae | HA-1AndMGF1Paddin | 549.1.1.7 | 2634 | | p-mgf1p | g | | 2635 | RSA-OAEP | http://www.w3.org/20 | RSA/ECB/OAEPWithS | 1.2.840.113 | 2636 | -256 | 09/xmlenc11#rsa-oaep | HA-256AndMGF1Padd | 549.1.1.7 | 2637 | | & | ing & | | 2638 | | http://www.w3.org/2 | MGF1ParameterSp | | 2639 | | 009/xmlenc11#mgf1sha | ec.SHA256 | | 2640 | | 256 | | | 2641 | ECDH-ES | http://www.w3.org/20 | ECDH | 1.3.132.1.1 | 2642 | | 09/xmlenc11#ECDH-ES | | 2 | 2643 | A128KW | http://www.w3.org/20 | AESWrap | 2.16.840.1. | 2644 | | 01/04/xmlenc#kw-aes1 | | 101.3.4.1.5 | 2645 | | 28 | | | 2646 | A192KW | http://www.w3.org/20 | AESWrap | 2.16.840.1. | 2647 | | 01/04/xmlenc#kw-aes1 | | 101.3.4.1.2 | 2648 | | 92 | | 5 | 2649 | A256KW | http://www.w3.org/20 | AESWrap | 2.16.840.1. | 2650 | | 01/04/xmlenc#kw-aes2 | | 101.3.4.1.4 | 2651 | | 56 | | 5 | 2652 +----------+----------------------+-------------------+-------------+ 2654 A.3. Content Encryption Algorithm Identifier Cross-Reference 2656 This section contains a table cross-referencing the JWE "enc" 2657 (encryption algorithm) values defined in this specification with the 2658 equivalent identifiers used by other standards and software packages. 2660 For the composite algorithms "A128CBC-HS256", "A192CBC-HS384", and 2661 "A256CBC-HS512", the corresponding AES CBC algorithm identifiers are 2662 listed. 2664 +----------+-------------------------+--------------+---------------+ 2665 | JWE | XML ENC | JCA | OID | 2666 +----------+-------------------------+--------------+---------------+ 2667 | A128CBC- | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.10 | 2668 | HS256 | 04/xmlenc#aes128-cbc | 5Padding | 1.3.4.1.2 | 2669 | A192CBC- | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.10 | 2670 | HS384 | 04/xmlenc#aes192-cbc | 5Padding | 1.3.4.1.22 | 2671 | A256CBC- | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.10 | 2672 | HS512 | 04/xmlenc#aes256-cbc | 5Padding | 1.3.4.1.42 | 2673 | A128GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.10 | 2674 | | xmlenc11#aes128-gcm | dding | 1.3.4.1.6 | 2675 | A192GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.10 | 2676 | | xmlenc11#aes192-gcm | dding | 1.3.4.1.26 | 2677 | A256GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.10 | 2678 | | xmlenc11#aes256-gcm | dding | 1.3.4.1.46 | 2679 +----------+-------------------------+--------------+---------------+ 2681 Appendix B. Test Cases for AES_CBC_HMAC_SHA2 Algorithms 2683 The following test cases can be used to validate implementations of 2684 the AES_CBC_HMAC_SHA2 algorithms defined in Section 5.2. They are 2685 also intended to correspond to test cases that may appear in a future 2686 version of [I-D.mcgrew-aead-aes-cbc-hmac-sha2], demonstrating that 2687 the cryptographic computations performed are the same. 2689 The variable names are those defined in Section 5.2. All values are 2690 hexadecimal. 2692 B.1. Test Cases for AES_128_CBC_HMAC_SHA_256 2694 AES_128_CBC_HMAC_SHA_256 2696 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2697 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2699 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2701 ENC_KEY = 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2703 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2704 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2705 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2706 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2707 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2708 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2709 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2710 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2712 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2714 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2715 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2716 4b 65 72 63 6b 68 6f 66 66 73 2718 AL = 00 00 00 00 00 00 01 50 2720 E = c8 0e df a3 2d df 39 d5 ef 00 c0 b4 68 83 42 79 2721 a2 e4 6a 1b 80 49 f7 92 f7 6b fe 54 b9 03 a9 c9 2722 a9 4a c9 b4 7a d2 65 5c 5f 10 f9 ae f7 14 27 e2 2723 fc 6f 9b 3f 39 9a 22 14 89 f1 63 62 c7 03 23 36 2724 09 d4 5a c6 98 64 e3 32 1c f8 29 35 ac 40 96 c8 2725 6e 13 33 14 c5 40 19 e8 ca 79 80 df a4 b9 cf 1b 2726 38 4c 48 6f 3a 54 c5 10 78 15 8e e5 d7 9d e5 9f 2727 bd 34 d8 48 b3 d6 95 50 a6 76 46 34 44 27 ad e5 2728 4b 88 51 ff b5 98 f7 f8 00 74 b9 47 3c 82 e2 db 2730 M = 65 2c 3f a3 6b 0a 7c 5b 32 19 fa b3 a3 0b c1 c4 2731 e6 e5 45 82 47 65 15 f0 ad 9f 75 a2 b7 1c 73 ef 2733 T = 65 2c 3f a3 6b 0a 7c 5b 32 19 fa b3 a3 0b c1 c4 2735 B.2. Test Cases for AES_192_CBC_HMAC_SHA_384 2737 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2738 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2739 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2741 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2742 10 11 12 13 14 15 16 17 2744 ENC_KEY = 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 2745 28 29 2a 2b 2c 2d 2e 2f 2747 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2748 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2749 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2750 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2751 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2752 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2753 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2754 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2756 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2758 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2759 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2760 4b 65 72 63 6b 68 6f 66 66 73 2762 AL = 00 00 00 00 00 00 01 50 2764 E = ea 65 da 6b 59 e6 1e db 41 9b e6 2d 19 71 2a e5 2765 d3 03 ee b5 00 52 d0 df d6 69 7f 77 22 4c 8e db 2766 00 0d 27 9b dc 14 c1 07 26 54 bd 30 94 42 30 c6 2767 57 be d4 ca 0c 9f 4a 84 66 f2 2b 22 6d 17 46 21 2768 4b f8 cf c2 40 0a dd 9f 51 26 e4 79 66 3f c9 0b 2769 3b ed 78 7a 2f 0f fc bf 39 04 be 2a 64 1d 5c 21 2770 05 bf e5 91 ba e2 3b 1d 74 49 e5 32 ee f6 0a 9a 2771 c8 bb 6c 6b 01 d3 5d 49 78 7b cd 57 ef 48 49 27 2772 f2 80 ad c9 1a c0 c4 e7 9c 7b 11 ef c6 00 54 e3 2774 M = 84 90 ac 0e 58 94 9b fe 51 87 5d 73 3f 93 ac 20 2775 75 16 80 39 cc c7 33 d7 45 94 f8 86 b3 fa af d4 2776 86 f2 5c 71 31 e3 28 1e 36 c7 a2 d1 30 af de 57 2778 T = 84 90 ac 0e 58 94 9b fe 51 87 5d 73 3f 93 ac 20 2779 75 16 80 39 cc c7 33 d7 2781 B.3. Test Cases for AES_256_CBC_HMAC_SHA_512 2783 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2784 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2785 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2786 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 2788 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2789 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2791 ENC_KEY = 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2792 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 2794 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2795 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2796 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2797 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2798 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2799 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2800 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2801 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2803 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2805 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2806 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2807 4b 65 72 63 6b 68 6f 66 66 73 2809 AL = 00 00 00 00 00 00 01 50 2811 E = 4a ff aa ad b7 8c 31 c5 da 4b 1b 59 0d 10 ff bd 2812 3d d8 d5 d3 02 42 35 26 91 2d a0 37 ec bc c7 bd 2813 82 2c 30 1d d6 7c 37 3b cc b5 84 ad 3e 92 79 c2 2814 e6 d1 2a 13 74 b7 7f 07 75 53 df 82 94 10 44 6b 2815 36 eb d9 70 66 29 6a e6 42 7e a7 5c 2e 08 46 a1 2816 1a 09 cc f5 37 0d c8 0b fe cb ad 28 c7 3f 09 b3 2817 a3 b7 5e 66 2a 25 94 41 0a e4 96 b2 e2 e6 60 9e 2818 31 e6 e0 2c c8 37 f0 53 d2 1f 37 ff 4f 51 95 0b 2819 be 26 38 d0 9d d7 a4 93 09 30 80 6d 07 03 b1 f6 2821 M = 4d d3 b4 c0 88 a7 f4 5c 21 68 39 64 5b 20 12 bf 2822 2e 62 69 a8 c5 6a 81 6d bc 1b 26 77 61 95 5b c5 2823 fd 30 a5 65 c6 16 ff b2 f3 64 ba ec e6 8f c4 07 2824 53 bc fc 02 5d de 36 93 75 4a a1 f5 c3 37 3b 9c 2826 T = 4d d3 b4 c0 88 a7 f4 5c 21 68 39 64 5b 20 12 bf 2827 2e 62 69 a8 c5 6a 81 6d bc 1b 26 77 61 95 5b c5 2829 Appendix C. Example ECDH-ES Key Agreement Computation 2831 This example uses ECDH-ES Key Agreement and the Concat KDF to derive 2832 the Content Encryption Key (CEK) in the manner described in 2833 Section 4.6. In this example, the ECDH-ES Direct Key Agreement mode 2834 ("alg" value "ECDH-ES") is used to produce an agreed upon key for AES 2835 GCM with a 128 bit key ("enc" value "A128GCM"). 2837 In this example, a sender Alice is encrypting content to a recipient 2838 Bob. The sender (Alice) generates an ephemeral key for the key 2839 agreement computation. Alice's ephemeral key (in JWK format) used 2840 for the key agreement computation in this example (including the 2841 private part) is: 2843 {"kty":"EC", 2844 "crv":"P-256", 2845 "x":"gI0GAILBdu7T53akrFmMyGcsF3n5dO7MmwNBHKW5SV0", 2846 "y":"SLW_xSffzlPWrHEVI30DHM_4egVwt3NQqeUD7nMFpps", 2847 "d":"0_NxaRPUMQoAJt50Gz8YiTr8gRTwyEaCumd-MToTmIo" 2848 } 2850 The recipient's (Bob's) key (in JWK format) used for the key 2851 agreement computation in this example (including the private part) 2852 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 sender's (Alice's) ephemeral public key value to the recipient 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 UTF-8 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 -35 2989 o Addressed AppsDir reviews by Carsten Bormann. 2991 o Adjusted some table column widths. 2993 -34 2995 o Addressed IESG review comments by Barry Leiba, Alissa Cooper, Pete 2996 Resnick, Stephen Farrell, and Richard Barnes. 2998 -33 3000 o Changed the registration review period to three weeks. 3002 o Acknowledged additional contributors. 3004 -32 3006 o Added a note to implementers about libraries that prefix an extra 3007 zero-valued octet to RSA modulus representations returned. 3009 o Addressed secdir review comments by Charlie Kaufman, Scott Kelly, 3010 and Stephen Kent. 3012 o Addressed Gen-ART review comments by Roni Even. 3014 o Replaced the term Plaintext JWS with Unsecured JWS. 3016 -31 3018 o Referenced NIST SP 800-57 for guidance on key lifetimes. 3020 o Updated the reference to draft-mcgrew-aead-aes-cbc-hmac-sha2. 3022 -30 3024 o Cleaned up the reference syntax in a few places. 3026 o Applied minor wording changes to the Security Considerations 3027 section. 3029 -29 3031 o Replaced the terms JWS Header, JWE Header, and JWT Header with a 3032 single JOSE Header term defined in the JWS specification. This 3033 also enabled a single Header Parameter definition to be used and 3034 reduced other areas of duplication between specifications. 3036 -28 3038 o Specified the use of PKCS #7 padding with AES CBC, rather than 3039 PKCS #5. (PKCS #7 is a superset of PKCS #5, and is appropriate 3040 for the 16 octet blocks used by AES CBC.) 3042 o Revised the introduction to the Security Considerations section. 3043 Also introduced additional subsection headings for security 3044 considerations items and moved a few security consideration items 3045 from here to the JWS and JWE drafts. 3047 -27 3049 o Described additional security considerations. 3051 o Updated the JCA and XMLENC parameters for "RSA-OAEP-256" and the 3052 JCA parameters for "A128KW", "A192KW", "A256KW", and "ECDH-ES". 3054 -26 3055 o Added algorithm identifier "RSA-OAEP-256" for RSAES OAEP using 3056 SHA-256 and MGF1 with SHA-256. 3058 o Clarified that the ECDSA signature values R and S are represented 3059 as octet sequences as defined in Section 2.3.7 of SEC1 [SEC1]. 3061 o Noted that octet sequences are depicted using JSON array notation. 3063 o Updated references, including to W3C specifications. 3065 -25 3067 o Corrected an external section number reference that had changed. 3069 -24 3071 o Replaced uses of the term "associated data" wherever it was used 3072 to refer to a data value with "additional authenticated data", 3073 since both terms were being used as synonyms, causing confusion. 3075 o Updated the JSON reference to RFC 7159. 3077 -23 3079 o No changes were made, other than to the version number and date. 3081 -22 3083 o Corrected RFC 2119 terminology usage. 3085 o Replaced references to draft-ietf-json-rfc4627bis with RFC 7158. 3087 -21 3089 o Compute the PBES2 salt parameter as (UTF8(Alg) || 0x00 || Salt 3090 Input), where the "p2s" Header Parameter encodes the Salt Input 3091 value and Alg is the "alg" Header Parameter value. 3093 o Changed some references from being normative to informative, 3094 addressing issue #90. 3096 -20 3098 o Replaced references to RFC 4627 with draft-ietf-json-rfc4627bis, 3099 addressing issue #90. 3101 -19 3102 o Used tables to show the correspondence between algorithm 3103 identifiers and algorithm descriptions and parameters in the 3104 algorithm definition sections, addressing issue #183. 3106 o Changed the "Implementation Requirements" registry field names to 3107 "JOSE Implementation Requirements" to make it clear that these 3108 implementation requirements apply only to JWS and JWE 3109 implementations. 3111 -18 3113 o Changes to address editorial and minor issues #129, #134, #135, 3114 #158, #161, #185, #186, and #187. 3116 o Added and used Description registry fields. 3118 -17 3120 o Explicitly named all the logical components of a JWS and JWE and 3121 defined the processing rules and serializations in terms of those 3122 components, addressing issues #60, #61, and #62. 3124 o Removed processing steps in algorithm definitions that duplicated 3125 processing steps in JWS or JWE, addressing issue #56. 3127 o Replaced verbose repetitive phases such as "base64url encode the 3128 octets of the UTF-8 representation of X" with mathematical 3129 notation such as "BASE64URL(UTF8(X))". 3131 o Terms used in multiple documents are now defined in one place and 3132 incorporated by reference. Some lightly used or obvious terms 3133 were also removed. This addresses issue #58. 3135 o Changes to address minor issue #53. 3137 -16 3139 o Added a DataLen prefix to the AlgorithmID value in the Concat KDF 3140 computation. 3142 o Added OIDs for encryption algorithms, additional signature 3143 algorithm OIDs, and additional XML DSIG/ENC URIs in the algorithm 3144 cross-reference tables. 3146 o Changes to address editorial and minor issues #28, #36, #39, #52, 3147 #53, #55, #127, #128, #136, #137, #141, #150, #151, #152, and 3148 #155. 3150 -15 3152 o Changed statements about rejecting JWSs to statements about 3153 validation failing, addressing issue #35. 3155 o Stated that changes of implementation requirements are only 3156 permitted on a Specification Required basis, addressing issue #38. 3158 o Made "oct" a required key type, addressing issue #40. 3160 o Updated the example ECDH-ES key agreement values. 3162 o Changes to address editorial and minor issues #34, #37, #49, #63, 3163 #123, #124, #125, #130, #132, #133, #138, #139, #140, #142, #143, 3164 #144, #145, #148, #149, #150, and #162. 3166 -14 3168 o Removed "PBKDF2" key type and added "p2s" and "p2c" header 3169 parameters for use with the PBES2 algorithms. 3171 o Made the RSA private key parameters that are there to enable 3172 optimizations be RECOMMENDED rather than REQUIRED. 3174 o Added algorithm identifiers for AES algorithms using 192 bit keys 3175 and for RSASSA-PSS using HMAC SHA-384. 3177 o Added security considerations about key lifetimes, addressing 3178 issue #18. 3180 o Added an example ECDH-ES key agreement computation. 3182 -13 3184 o Added key encryption with AES GCM as specified in 3185 draft-jones-jose-aes-gcm-key-wrap-01, addressing issue #13. 3187 o Added security considerations text limiting the number of times 3188 that an AES GCM key can be used for key encryption or direct 3189 encryption, per Section 8.3 of NIST SP 800-38D, addressing issue 3190 #28. 3192 o Added password-based key encryption as specified in 3193 draft-miller-jose-jwe-protected-jwk-02. 3195 -12 3196 o In the Direct Key Agreement case, the Concat KDF AlgorithmID is 3197 set to the octets of the UTF-8 representation of the "enc" header 3198 parameter value. 3200 o Restored the "apv" (agreement PartyVInfo) parameter. 3202 o Moved the "epk", "apu", and "apv" Header Parameter definitions to 3203 be with the algorithm descriptions that use them. 3205 o Changed terminology from "block encryption" to "content 3206 encryption". 3208 -11 3210 o Removed the Encrypted Key value from the AAD computation since it 3211 is already effectively integrity protected by the encryption 3212 process. The AAD value now only contains the representation of 3213 the JWE Encrypted Header. 3215 o Removed "apv" (agreement PartyVInfo) since it is no longer used. 3217 o Added more information about the use of PartyUInfo during key 3218 agreement. 3220 o Use the keydatalen as the SuppPubInfo value for the Concat KDF 3221 when doing key agreement, as RFC 2631 does. 3223 o Added algorithm identifiers for RSASSA-PSS with SHA-256 and SHA- 3224 512. 3226 o Added a Parameter Information Class value to the JSON Web Key 3227 Parameters registry, which registers whether the parameter conveys 3228 public or private information. 3230 -10 3232 o Changed the JWE processing rules for multiple recipients so that a 3233 single AAD value contains the header parameters and encrypted key 3234 values for all the recipients, enabling AES GCM to be safely used 3235 for multiple recipients. 3237 -09 3239 o Expanded the scope of the JWK parameters to include private and 3240 symmetric key representations, as specified by 3241 draft-jones-jose-json-private-and-symmetric-key-00. 3243 o Changed term "JWS Secured Input" to "JWS Signing Input". 3245 o Changed from using the term "byte" to "octet" when referring to 8 3246 bit values. 3248 o Specified that AES Key Wrap uses the default initial value 3249 specified in Section 2.2.3.1 of RFC 3394. This addressed issue 3250 #19. 3252 o Added Key Management Mode definitions to terminology section and 3253 used the defined terms to provide clearer key management 3254 instructions. This addressed issue #5. 3256 o Replaced "A128CBC+HS256" and "A256CBC+HS512" with "A128CBC-HS256" 3257 and "A256CBC-HS512". The new algorithms perform the same 3258 cryptographic computations as [I-D.mcgrew-aead-aes-cbc-hmac-sha2], 3259 but with the Initialization Vector and Authentication Tag values 3260 remaining separate from the Ciphertext value in the output 3261 representation. Also deleted the header parameters "epu" 3262 (encryption PartyUInfo) and "epv" (encryption PartyVInfo), since 3263 they are no longer used. 3265 o Changed from using the term "Integrity Value" to "Authentication 3266 Tag". 3268 -08 3270 o Changed the name of the JWK key type parameter from "alg" to 3271 "kty". 3273 o Replaced uses of the term "AEAD" with "Authenticated Encryption", 3274 since the term AEAD in the RFC 5116 sense implied the use of a 3275 particular data representation, rather than just referring to the 3276 class of algorithms that perform authenticated encryption with 3277 associated data. 3279 o Applied editorial improvements suggested by Jeff Hodges. Many of 3280 these simplified the terminology used. 3282 o Added seriesInfo information to Internet Draft references. 3284 -07 3286 o Added a data length prefix to PartyUInfo and PartyVInfo values. 3288 o Changed the name of the JWK RSA modulus parameter from "mod" to 3289 "n" and the name of the JWK RSA exponent parameter from "xpo" to 3290 "e", so that the identifiers are the same as those used in RFC 3291 3447. 3293 o Made several local editorial changes to clean up loose ends left 3294 over from to the decision to only support block encryption methods 3295 providing integrity. 3297 -06 3299 o Removed the "int" and "kdf" parameters and defined the new 3300 composite Authenticated Encryption algorithms "A128CBC+HS256" and 3301 "A256CBC+HS512" to replace the former uses of AES CBC, which 3302 required the use of separate integrity and key derivation 3303 functions. 3305 o Included additional values in the Concat KDF calculation -- the 3306 desired output size and the algorithm value, and optionally 3307 PartyUInfo and PartyVInfo values. Added the optional header 3308 parameters "apu" (agreement PartyUInfo), "apv" (agreement 3309 PartyVInfo), "epu" (encryption PartyUInfo), and "epv" (encryption 3310 PartyVInfo). 3312 o Changed the name of the JWK RSA exponent parameter from "exp" to 3313 "xpo" so as to allow the potential use of the name "exp" for a 3314 future extension that might define an expiration parameter for 3315 keys. (The "exp" name is already used for this purpose in the JWT 3316 specification.) 3318 o Applied changes made by the RFC Editor to RFC 6749's registry 3319 language to this specification. 3321 -05 3323 o Support both direct encryption using a shared or agreed upon 3324 symmetric key, and the use of a shared or agreed upon symmetric 3325 key to key wrap the CMK. Specifically, added the "alg" values 3326 "dir", "ECDH-ES+A128KW", and "ECDH-ES+A256KW" to finish filling in 3327 this set of capabilities. 3329 o Updated open issues. 3331 -04 3333 o Added text requiring that any leading zero bytes be retained in 3334 base64url encoded key value representations for fixed-length 3335 values. 3337 o Added this language to Registration Templates: "This name is case 3338 sensitive. Names that match other registered names in a case 3339 insensitive manner SHOULD NOT be accepted." 3341 o Described additional open issues. 3343 o Applied editorial suggestions. 3345 -03 3347 o Always use a 128 bit "authentication tag" size for AES GCM, 3348 regardless of the key size. 3350 o Specified that use of a 128 bit IV is REQUIRED with AES CBC. It 3351 was previously RECOMMENDED. 3353 o Removed key size language for ECDSA algorithms, since the key size 3354 is implied by the algorithm being used. 3356 o Stated that the "int" key size must be the same as the hash output 3357 size (and not larger, as was previously allowed) so that its size 3358 is defined for key generation purposes. 3360 o Added the "kdf" (key derivation function) header parameter to 3361 provide crypto agility for key derivation. The default KDF 3362 remains the Concat KDF with the SHA-256 digest function. 3364 o Clarified that the "mod" and "exp" values are unsigned. 3366 o Added Implementation Requirements columns to algorithm tables and 3367 Implementation Requirements entries to algorithm registries. 3369 o Changed AES Key Wrap to RECOMMENDED. 3371 o Moved registries JSON Web Signature and Encryption Header 3372 Parameters and JSON Web Signature and Encryption Type Values to 3373 the JWS specification. 3375 o Moved JSON Web Key Parameters registry to the JWK specification. 3377 o Changed registration requirements from RFC Required to 3378 Specification Required with Expert Review. 3380 o Added Registration Template sections for defined registries. 3382 o Added Registry Contents sections to populate registry values. 3384 o No longer say "the UTF-8 representation of the JWS Secured Input 3385 (which is the same as the ASCII representation)". Just call it 3386 "the ASCII representation of the JWS Secured Input". 3388 o Added "Collision Resistant Namespace" to the terminology section. 3390 o Numerous editorial improvements. 3392 -02 3394 o For AES GCM, use the "additional authenticated data" parameter to 3395 provide integrity for the header, encrypted key, and ciphertext 3396 and use the resulting "authentication tag" value as the JWE 3397 Authentication Tag. 3399 o Defined minimum required key sizes for algorithms without 3400 specified key sizes. 3402 o Defined KDF output key sizes. 3404 o Specified the use of PKCS #5 padding with AES CBC. 3406 o Generalized text to allow key agreement to be employed as an 3407 alternative to key wrapping or key encryption. 3409 o Clarified that ECDH-ES is a key agreement algorithm. 3411 o Required implementation of AES-128-KW and AES-256-KW. 3413 o Removed the use of "A128GCM" and "A256GCM" for key wrapping. 3415 o Removed "A512KW" since it turns out that it's not a standard 3416 algorithm. 3418 o Clarified the relationship between "typ" header parameter values 3419 and MIME types. 3421 o Generalized language to refer to Message Authentication Codes 3422 (MACs) rather than Hash-based Message Authentication Codes (HMACs) 3423 unless in a context specific to HMAC algorithms. 3425 o Established registries: JSON Web Signature and Encryption Header 3426 Parameters, JSON Web Signature and Encryption Algorithms, JSON Web 3427 Signature and Encryption "typ" Values, JSON Web Key Parameters, 3428 and JSON Web Key Algorithm Families. 3430 o Moved algorithm-specific definitions from JWK to JWA. 3432 o Reformatted to give each member definition its own section 3433 heading. 3435 -01 3436 o Moved definition of "alg":"none" for JWSs here from the JWT 3437 specification since this functionality is likely to be useful in 3438 more contexts that just for JWTs. 3440 o Added Advanced Encryption Standard (AES) Key Wrap Algorithm using 3441 512 bit keys ("A512KW"). 3443 o Added text "Alternatively, the Encoded JWS Signature MAY be 3444 base64url decoded to produce the JWS Signature and this value can 3445 be compared with the computed HMAC value, as this comparison 3446 produces the same result as comparing the encoded values". 3448 o Corrected the Magic Signatures reference. 3450 o Made other editorial improvements suggested by JOSE working group 3451 participants. 3453 -00 3455 o Created the initial IETF draft based upon 3456 draft-jones-json-web-signature-04 and 3457 draft-jones-json-web-encryption-02 with no normative changes. 3459 o Changed terminology to no longer call both digital signatures and 3460 HMACs "signatures". 3462 Author's Address 3464 Michael B. Jones 3465 Microsoft 3467 Email: mbj@microsoft.com 3468 URI: http://self-issued.info/