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