idnits 2.17.1 draft-ietf-jose-json-web-algorithms-40.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 (January 13, 2015) is 3388 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 2981 -- Looks like a reference, but probably isn't: '0' on line 2981 -- Looks like a reference, but probably isn't: '7' on line 2953 -- Looks like a reference, but probably isn't: '65' on line 2961 -- Looks like a reference, but probably isn't: '49' on line 2955 -- Looks like a reference, but probably isn't: '50' on line 2955 -- Looks like a reference, but probably isn't: '56' on line 2955 -- Looks like a reference, but probably isn't: '71' on line 2955 -- Looks like a reference, but probably isn't: '67' on line 2955 -- Looks like a reference, but probably isn't: '77' on line 2955 -- Looks like a reference, but probably isn't: '5' on line 2959 -- Looks like a reference, but probably isn't: '108' on line 2961 -- Looks like a reference, but probably isn't: '105' on line 2961 -- Looks like a reference, but probably isn't: '99' on line 2961 -- Looks like a reference, but probably isn't: '101' on line 2961 -- Looks like a reference, but probably isn't: '3' on line 2965 -- Looks like a reference, but probably isn't: '66' on line 2967 -- Looks like a reference, but probably isn't: '111' on line 2967 -- Looks like a reference, but probably isn't: '98' on line 2967 -- Looks like a reference, but probably isn't: '128' on line 2971 -- Possible downref: Non-RFC (?) normative reference: ref. 'AES' -- Possible downref: Non-RFC (?) normative reference: ref. 'Boneh99' -- Possible downref: Non-RFC (?) normative reference: ref. 'DSS' ** Downref: Normative reference to an Informational RFC: RFC 2104 ** Obsolete normative reference: RFC 2898 (Obsoleted by RFC 8018) ** Downref: Normative reference to an Informational RFC: RFC 3394 ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Downref: Normative reference to an Informational RFC: RFC 4949 ** Downref: Normative reference to an Informational RFC: RFC 6090 ** Obsolete normative reference: RFC 7159 (Obsoleted by RFC 8259) -- Possible downref: Non-RFC (?) normative reference: ref. 'SEC1' -- Possible downref: Non-RFC (?) normative reference: ref. 'SHS' -- Possible downref: Non-RFC (?) normative reference: ref. 'UNICODE' == 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 (==), 29 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 JOSE Working Group M. Jones 3 Internet-Draft Microsoft 4 Intended status: Standards Track January 13, 2015 5 Expires: July 17, 2015 7 JSON Web Algorithms (JWA) 8 draft-ietf-jose-json-web-algorithms-40 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 17, 2015. 35 Copyright Notice 37 Copyright (c) 2015 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, where STRING is a sequence of zero or more Unicode 204 [UNICODE] characters. 206 ASCII(STRING) denotes the octets of the ASCII [RFC20] representation 207 of STRING, where STRING is a sequence of zero or more ASCII 208 characters. 210 The concatenation of two values A and B is denoted as A || B. 212 2. Terminology 214 These terms defined by the JSON Web Signature (JWS) [JWS] 215 specification are incorporated into this specification: "JSON Web 216 Signature (JWS)", "Base64url Encoding", "Header Parameter", "JOSE 217 Header", "JWS Payload", "JWS Protected Header", "JWS Signature", "JWS 218 Signing Input", and "Unsecured JWS". 220 These terms defined by the JSON Web Encryption (JWE) [JWE] 221 specification are incorporated into this specification: "JSON Web 222 Encryption (JWE)", "Additional Authenticated Data (AAD)", 223 "Authentication Tag", "Content Encryption Key (CEK)", "Direct 224 Encryption", "Direct Key Agreement", "JWE Authentication Tag", "JWE 225 Ciphertext", "JWE Encrypted Key", "JWE Initialization Vector", "JWE 226 Protected Header", "Key Agreement with Key Wrapping", "Key 227 Encryption", "Key Management Mode", and "Key Wrapping". 229 These terms defined by the JSON Web Key (JWK) [JWK] specification are 230 incorporated into this specification: "JSON Web Key (JWK)" and "JSON 231 Web Key Set (JWK Set)". 233 These terms defined by the Internet Security Glossary, Version 2 234 [RFC4949] are incorporated into this specification: "Ciphertext", 235 "Digital Signature", "Message Authentication Code (MAC)", and 236 "Plaintext". 238 This term is defined by this specification: 240 Base64urlUInt 241 The representation of a positive or zero integer value as the 242 base64url encoding of the value's unsigned big endian 243 representation as an octet sequence. The octet sequence MUST 244 utilize the minimum number of octets needed to represent the 245 value. Zero is represented as BASE64URL(single zero-valued 246 octet), which is "AA". 248 3. Cryptographic Algorithms for Digital Signatures and MACs 250 JWS uses cryptographic algorithms to digitally sign or create a 251 Message Authentication Code (MAC) of the contents of the JWS 252 Protected Header and the JWS Payload. 254 3.1. "alg" (Algorithm) Header Parameter Values for JWS 256 The table below is the set of "alg" (algorithm) header parameter 257 values defined by this specification for use with JWS, each of which 258 is explained in more detail in the following sections: 260 +--------------+-----------------------------------+----------------+ 261 | alg Param | Digital Signature or MAC | Implementation | 262 | Value | Algorithm | Requirements | 263 +--------------+-----------------------------------+----------------+ 264 | HS256 | HMAC using SHA-256 | Required | 265 | HS384 | HMAC using SHA-384 | Optional | 266 | HS512 | HMAC using SHA-512 | Optional | 267 | RS256 | RSASSA-PKCS-v1_5 using SHA-256 | Recommended | 268 | RS384 | RSASSA-PKCS-v1_5 using SHA-384 | Optional | 269 | RS512 | RSASSA-PKCS-v1_5 using SHA-512 | Optional | 270 | ES256 | ECDSA using P-256 and SHA-256 | Recommended+ | 271 | ES384 | ECDSA using P-384 and SHA-384 | Optional | 272 | ES512 | ECDSA using P-521 and SHA-512 | Optional | 273 | PS256 | RSASSA-PSS using SHA-256 and MGF1 | Optional | 274 | | with SHA-256 | | 275 | PS384 | RSASSA-PSS using SHA-384 and MGF1 | Optional | 276 | | with SHA-384 | | 277 | PS512 | RSASSA-PSS using SHA-512 and MGF1 | Optional | 278 | | with SHA-512 | | 279 | none | No digital signature or MAC | Optional | 280 | | performed | | 281 +--------------+-----------------------------------+----------------+ 283 The use of "+" in the Implementation Requirements indicates that the 284 requirement strength is likely to be increased in a future version of 285 the specification. 287 See Appendix A.1 for a table cross-referencing the JWS digital 288 signature and MAC "alg" (algorithm) values defined in this 289 specification with the equivalent identifiers used by other standards 290 and software packages. 292 3.2. HMAC with SHA-2 Functions 294 Hash-based Message Authentication Codes (HMACs) enable one to use a 295 secret plus a cryptographic hash function to generate a Message 296 Authentication Code (MAC). This can be used to demonstrate that 297 whoever generated the MAC was in possession of the MAC key. The 298 algorithm for implementing and validating HMACs is provided in RFC 299 2104 [RFC2104]. 301 A key of the same size as the hash output (for instance, 256 bits for 302 "HS256") or larger MUST be used with this algorithm. (This 303 requirement is based on Section 5.3.4 (Security Effect of the HMAC 304 Key) of NIST SP 800-117 [NIST.800-107], which states that the 305 effective security strength is the minimum of the security strength 306 of the key and two times the size of the internal hash value.) 307 The HMAC SHA-256 MAC is generated per RFC 2104, using SHA-256 as the 308 hash algorithm "H", using the JWS Signing Input as the "text" value, 309 and using the shared key. The HMAC output value is the JWS 310 Signature. 312 The following "alg" (algorithm) Header Parameter values are used to 313 indicate that the JWS Signature is an HMAC value computed using the 314 corresponding algorithm: 316 +-----------------+--------------------+ 317 | alg Param Value | MAC Algorithm | 318 +-----------------+--------------------+ 319 | HS256 | HMAC using SHA-256 | 320 | HS384 | HMAC using SHA-384 | 321 | HS512 | HMAC using SHA-512 | 322 +-----------------+--------------------+ 324 The HMAC SHA-256 MAC for a JWS is validated by computing an HMAC 325 value per RFC 2104, using SHA-256 as the hash algorithm "H", using 326 the received JWS Signing Input as the "text" value, and using the 327 shared key. This computed HMAC value is then compared to the result 328 of base64url decoding the received encoded JWS Signature value. The 329 comparison of the computed HMAC value to the JWS Signature value MUST 330 be done in a constant-time manner to thwart timing attacks. 331 Alternatively, the computed HMAC value can be base64url encoded and 332 compared to the received encoded JWS Signature value (also in a 333 constant-time manner), as this comparison produces the same result as 334 comparing the unencoded values. In either case, if the values match, 335 the HMAC has been validated. 337 Securing content and validation with the HMAC SHA-384 and HMAC SHA- 338 512 algorithms is performed identically to the procedure for HMAC 339 SHA-256 -- just using the corresponding hash algorithms with 340 correspondingly larger minimum key sizes and result values: 384 bits 341 each for HMAC SHA-384 and 512 bits each for HMAC SHA-512. 343 An example using this algorithm is shown in Appendix A.1 of [JWS]. 345 3.3. Digital Signature with RSASSA-PKCS1-V1_5 347 This section defines the use of the RSASSA-PKCS1-V1_5 digital 348 signature algorithm as defined in Section 8.2 of RFC 3447 [RFC3447] 349 (commonly known as PKCS #1), using SHA-2 [SHS] hash functions. 351 A key of size 2048 bits or larger MUST be used with these algorithms. 353 The RSASSA-PKCS1-V1_5 SHA-256 digital signature is generated as 354 follows: Generate a digital signature of the JWS Signing Input using 355 RSASSA-PKCS1-V1_5-SIGN and the SHA-256 hash function with the desired 356 private key. This is the JWS Signature value. 358 The following "alg" (algorithm) Header Parameter values are used to 359 indicate that the JWS Signature is a digital signature value computed 360 using the corresponding algorithm: 362 +-----------------+--------------------------------+ 363 | alg Param Value | Digital Signature Algorithm | 364 +-----------------+--------------------------------+ 365 | RS256 | RSASSA-PKCS-v1_5 using SHA-256 | 366 | RS384 | RSASSA-PKCS-v1_5 using SHA-384 | 367 | RS512 | RSASSA-PKCS-v1_5 using SHA-512 | 368 +-----------------+--------------------------------+ 370 The RSASSA-PKCS1-V1_5 SHA-256 digital signature for a JWS is 371 validated as follows: Submit the JWS Signing Input, the JWS 372 Signature, and the public key corresponding to the private key used 373 by the signer to the RSASSA-PKCS1-V1_5-VERIFY algorithm using SHA-256 374 as the hash function. 376 Signing and validation with the RSASSA-PKCS1-V1_5 SHA-384 and RSASSA- 377 PKCS1-V1_5 SHA-512 algorithms is performed identically to the 378 procedure for RSASSA-PKCS1-V1_5 SHA-256 -- just using the 379 corresponding hash algorithms instead of SHA-256. 381 An example using this algorithm is shown in Appendix A.2 of [JWS]. 383 3.4. Digital Signature with ECDSA 385 The Elliptic Curve Digital Signature Algorithm (ECDSA) [DSS] provides 386 for the use of Elliptic Curve cryptography, which is able to provide 387 equivalent security to RSA cryptography but using shorter key sizes 388 and with greater processing speed for many operations. This means 389 that ECDSA digital signatures will be substantially smaller in terms 390 of length than equivalently strong RSA digital signatures. 392 This specification defines the use of ECDSA with the P-256 curve and 393 the SHA-256 cryptographic hash function, ECDSA with the P-384 curve 394 and the SHA-384 hash function, and ECDSA with the P-521 curve and the 395 SHA-512 hash function. The P-256, P-384, and P-521 curves are 396 defined in [DSS]. 398 The ECDSA P-256 SHA-256 digital signature is generated as follows: 400 1. Generate a digital signature of the JWS Signing Input using ECDSA 401 P-256 SHA-256 with the desired private key. The output will be 402 the pair (R, S), where R and S are 256 bit unsigned integers. 404 2. Turn R and S into octet sequences in big endian order, with each 405 array being be 32 octets long. The octet sequence 406 representations MUST NOT be shortened to omit any leading zero 407 octets contained in the values. 409 3. Concatenate the two octet sequences in the order R and then S. 410 (Note that many ECDSA implementations will directly produce this 411 concatenation as their output.) 413 4. The resulting 64 octet sequence is the JWS Signature value. 415 The following "alg" (algorithm) Header Parameter values are used to 416 indicate that the JWS Signature is a digital signature value computed 417 using the corresponding algorithm: 419 +-----------------+-------------------------------+ 420 | alg Param Value | Digital Signature Algorithm | 421 +-----------------+-------------------------------+ 422 | ES256 | ECDSA using P-256 and SHA-256 | 423 | ES384 | ECDSA using P-384 and SHA-384 | 424 | ES512 | ECDSA using P-521 and SHA-512 | 425 +-----------------+-------------------------------+ 427 The ECDSA P-256 SHA-256 digital signature for a JWS is validated as 428 follows: 430 1. The JWS Signature value MUST be a 64 octet sequence. If it is 431 not a 64 octet sequence, the validation has failed. 433 2. Split the 64 octet sequence into two 32 octet sequences. The 434 first octet sequence represents R and the second S. The values R 435 and S are represented as octet sequences using the Integer-to- 436 OctetString Conversion defined in Section 2.3.7 of SEC1 [SEC1] 437 (in big endian octet order). 439 3. Submit the JWS Signing Input R, S and the public key (x, y) to 440 the ECDSA P-256 SHA-256 validator. 442 Signing and validation with the ECDSA P-384 SHA-384 and ECDSA P-521 443 SHA-512 algorithms is performed identically to the procedure for 444 ECDSA P-256 SHA-256 -- just using the corresponding hash algorithms 445 with correspondingly larger result values. For ECDSA P-384 SHA-384, 446 R and S will be 384 bits each, resulting in a 96 octet sequence. For 447 ECDSA P-521 SHA-512, R and S will be 521 bits each, resulting in a 448 132 octet sequence. (Note that the Integer-to-OctetString Conversion 449 defined in Section 2.3.7 of SEC1 [SEC1] used to represent R and S as 450 octet sequences adds zero-valued high-order padding bits when needed 451 to round the size up to a multiple of 8 bits; thus, each 521-bit 452 integer is represented using 528 bits in 66 octets.) 454 Examples using these algorithms are shown in Appendices A.3 and A.4 455 of [JWS]. 457 3.5. Digital Signature with RSASSA-PSS 459 This section defines the use of the RSASSA-PSS digital signature 460 algorithm as defined in Section 8.1 of RFC 3447 [RFC3447] with the 461 MGF1 mask generation function and SHA-2 hash functions, always using 462 the same hash function for both the RSASSA-PSS hash function and the 463 MGF1 hash function. The size of the salt value is the same size as 464 the hash function output. All other algorithm parameters use the 465 defaults specified in Section A.2.3 of RFC 3447. 467 A key of size 2048 bits or larger MUST be used with this algorithm. 469 The RSASSA-PSS SHA-256 digital signature is generated as follows: 470 Generate a digital signature of the JWS Signing Input using RSASSA- 471 PSS-SIGN, the SHA-256 hash function, and the MGF1 mask generation 472 function with SHA-256 with the desired private key. This is the JWS 473 signature value. 475 The following "alg" (algorithm) Header Parameter values are used to 476 indicate that the JWS Signature is a digital signature value computed 477 using the corresponding algorithm: 479 +-----------------+------------------------------------------------+ 480 | alg Param Value | Digital Signature Algorithm | 481 +-----------------+------------------------------------------------+ 482 | PS256 | RSASSA-PSS using SHA-256 and MGF1 with SHA-256 | 483 | PS384 | RSASSA-PSS using SHA-384 and MGF1 with SHA-384 | 484 | PS512 | RSASSA-PSS using SHA-512 and MGF1 with SHA-512 | 485 +-----------------+------------------------------------------------+ 487 The RSASSA-PSS SHA-256 digital signature for a JWS is validated as 488 follows: Submit the JWS Signing Input, the JWS Signature, and the 489 public key corresponding to the private key used by the signer to the 490 RSASSA-PSS-VERIFY algorithm using SHA-256 as the hash function and 491 using MGF1 as the mask generation function with SHA-256. 493 Signing and validation with the RSASSA-PSS SHA-384 and RSASSA-PSS 494 SHA-512 algorithms is performed identically to the procedure for 495 RSASSA-PSS SHA-256 -- just using the alternative hash algorithm in 496 both roles. 498 3.6. Using the Algorithm "none" 500 JWSs MAY also be created that do not provide integrity protection. 501 Such a JWS is called an Unsecured JWS. An Unsecured JWS uses the 502 "alg" value "none" and is formatted identically to other JWSs, but 503 MUST use the empty octet sequence as its JWS Signature value. 504 Recipients MUST verify that the JWS Signature value is the empty 505 octet sequence. 507 Implementations that support Unsecured JWSs MUST NOT accept such 508 objects as valid unless the application specifies that it is 509 acceptable for a specific object to not be integrity protected. 510 Implementations MUST NOT accept Unsecured JWSs by default. In order 511 to mitigate downgrade attacks, applications MUST NOT signal 512 acceptance of Unsecured JWSs at a global level, and SHOULD signal 513 acceptance on a per-object basis. See Section 8.5 for security 514 considerations associated with using this algorithm. 516 4. Cryptographic Algorithms for Key Management 518 JWE uses cryptographic algorithms to encrypt or determine the Content 519 Encryption Key (CEK). 521 4.1. "alg" (Algorithm) Header Parameter Values for JWE 523 The table below is the set of "alg" (algorithm) Header Parameter 524 values that are defined by this specification for use with JWE. 525 These algorithms are used to encrypt the CEK, producing the JWE 526 Encrypted Key, or to use key agreement to agree upon the CEK. 528 +--------------------+--------------------+--------+----------------+ 529 | alg Param Value | Key Management | More | Implementation | 530 | | Algorithm | Header | Requirements | 531 | | | Params | | 532 +--------------------+--------------------+--------+----------------+ 533 | RSA1_5 | RSAES-PKCS1-V1_5 | (none) | Recommended- | 534 | RSA-OAEP | RSAES OAEP using | (none) | Recommended+ | 535 | | default parameters | | | 536 | RSA-OAEP-256 | RSAES OAEP using | (none) | Optional | 537 | | SHA-256 and MGF1 | | | 538 | | with SHA-256 | | | 539 | A128KW | AES Key Wrap with | (none) | Recommended | 540 | | default initial | | | 541 | | value using 128 | | | 542 | | bit key | | | 543 | A192KW | AES Key Wrap with | (none) | Optional | 544 | | default initial | | | 545 | | value using 192 | | | 546 | | bit key | | | 547 | A256KW | AES Key Wrap with | (none) | Recommended | 548 | | default initial | | | 549 | | value using 256 | | | 550 | | bit key | | | 551 | dir | Direct use of a | (none) | Recommended | 552 | | shared symmetric | | | 553 | | key as the CEK | | | 554 | ECDH-ES | Elliptic Curve | "epk", | Recommended+ | 555 | | Diffie-Hellman | "apu", | | 556 | | Ephemeral Static | "apv" | | 557 | | key agreement | | | 558 | | using Concat KDF | | | 559 | ECDH-ES+A128KW | ECDH-ES using | "epk", | Recommended | 560 | | Concat KDF and CEK | "apu", | | 561 | | wrapped with | "apv" | | 562 | | "A128KW" | | | 563 | ECDH-ES+A192KW | ECDH-ES using | "epk", | Optional | 564 | | Concat KDF and CEK | "apu", | | 565 | | wrapped with | "apv" | | 566 | | "A192KW" | | | 567 | ECDH-ES+A256KW | ECDH-ES using | "epk", | Recommended | 568 | | Concat KDF and CEK | "apu", | | 569 | | wrapped with | "apv" | | 570 | | "A256KW" | | | 571 | A128GCMKW | Key wrapping with | "iv", | Optional | 572 | | AES GCM using 128 | "tag" | | 573 | | bit key | | | 574 | A192GCMKW | Key wrapping with | "iv", | Optional | 575 | | AES GCM using 192 | "tag" | | 576 | | bit key | | | 577 | A256GCMKW | Key wrapping with | "iv", | Optional | 578 | | AES GCM using 256 | "tag" | | 579 | | bit key | | | 580 | PBES2-HS256+A128KW | PBES2 with HMAC | "p2s", | Optional | 581 | | SHA-256 and | "p2c" | | 582 | | "A128KW" wrapping | | | 583 | PBES2-HS384+A192KW | PBES2 with HMAC | "p2s", | Optional | 584 | | SHA-384 and | "p2c" | | 585 | | "A192KW" wrapping | | | 586 | PBES2-HS512+A256KW | PBES2 with HMAC | "p2s", | Optional | 587 | | SHA-512 and | "p2c" | | 588 | | "A256KW" wrapping | | | 589 +--------------------+--------------------+--------+----------------+ 591 The More Header Params column indicates what additional Header 592 Parameters are used by the algorithm, beyond "alg", which all use. 593 All but "dir" and "ECDH-ES" also produce a JWE Encrypted Key value. 595 The use of "+" in the Implementation Requirements indicates that the 596 requirement strength is likely to be increased in a future version of 597 the specification. 599 See Appendix A.2 for a table cross-referencing the JWE "alg" 600 (algorithm) values defined in this specification with the equivalent 601 identifiers used by other standards and software packages. 603 4.2. Key Encryption with RSAES-PKCS1-V1_5 605 This section defines the specifics of encrypting a JWE CEK with 606 RSAES-PKCS1-V1_5 [RFC3447]. The "alg" Header Parameter value 607 "RSA1_5" is used for this algorithm. 609 A key of size 2048 bits or larger MUST be used with this algorithm. 611 An example using this algorithm is shown in Appendix A.2 of [JWE]. 613 4.3. Key Encryption with RSAES OAEP 615 This section defines the specifics of encrypting a JWE CEK with RSAES 616 using Optimal Asymmetric Encryption Padding (OAEP) [RFC3447]. Two 617 sets of parameters for using OAEP are defined, which use different 618 hash functions. In the first case, the default parameters specified 619 by RFC 3447 in Section A.2.1 are used. (Those default parameters are 620 the SHA-1 hash function and the MGF1 with SHA-1 mask generation 621 function.) In the second case, the SHA-256 hash function and the 622 MGF1 with SHA-256 mask generation function are used. 624 The following "alg" (algorithm) Header Parameter values are used to 625 indicate that the JWE Encrypted Key is the result of encrypting the 626 CEK using the corresponding algorithm: 628 +-----------------+------------------------------------------------+ 629 | alg Param Value | Key Management Algorithm | 630 +-----------------+------------------------------------------------+ 631 | RSA-OAEP | RSAES OAEP using default parameters | 632 | RSA-OAEP-256 | RSAES OAEP using SHA-256 and MGF1 with SHA-256 | 633 +-----------------+------------------------------------------------+ 635 A key of size 2048 bits or larger MUST be used with these algorithms. 636 (This requirement is based on Table 4 (Security-strength time frames) 637 of NIST SP 800-57 [NIST.800-57], which requires 112 bits of security 638 for new uses, and Table 2 (Comparable strengths) of the same, which 639 states that 2048 bit RSA keys provide 112 bits of security.) 641 An example using RSAES OAEP with the default parameters is shown in 642 Appendix A.1 of [JWE]. 644 4.4. Key Wrapping with AES Key Wrap 646 This section defines the specifics of encrypting a JWE CEK with the 647 Advanced Encryption Standard (AES) Key Wrap Algorithm [RFC3394] using 648 the default initial value specified in Section 2.2.3.1. 650 The following "alg" (algorithm) Header Parameter values are used to 651 indicate that the JWE Encrypted Key is the result of encrypting the 652 CEK using the corresponding algorithm and key size: 654 +---------------+---------------------------------------------------+ 655 | alg Param | Key Management Algorithm | 656 | Value | | 657 +---------------+---------------------------------------------------+ 658 | A128KW | AES Key Wrap with default initial value using 128 | 659 | | bit key | 660 | A192KW | AES Key Wrap with default initial value using 192 | 661 | | bit key | 662 | A256KW | AES Key Wrap with default initial value using 256 | 663 | | bit key | 664 +---------------+---------------------------------------------------+ 666 An example using this algorithm is shown in Appendix A.3 of [JWE]. 668 4.5. Direct Encryption with a Shared Symmetric Key 670 This section defines the specifics of directly performing symmetric 671 key encryption without performing a key wrapping step. In this case, 672 the shared symmetric key is used directly as the Content Encryption 673 Key (CEK) value for the "enc" algorithm. An empty octet sequence is 674 used as the JWE Encrypted Key value. The "alg" Header Parameter 675 value "dir" is used in this case. 677 Refer to the security considerations on key lifetimes in Section 8.2 678 and AES GCM in Section 8.4 when considering utilizing direct 679 encryption. 681 4.6. Key Agreement with Elliptic Curve Diffie-Hellman Ephemeral Static 682 (ECDH-ES) 684 This section defines the specifics of key agreement with Elliptic 685 Curve Diffie-Hellman Ephemeral Static [RFC6090], in combination with 686 the Concat KDF, as defined in Section 5.8.1 of [NIST.800-56A]. The 687 key agreement result can be used in one of two ways: 689 1. directly as the Content Encryption Key (CEK) for the "enc" 690 algorithm, in the Direct Key Agreement mode, or 692 2. as a symmetric key used to wrap the CEK with the "A128KW", 693 "A192KW", or "A256KW" algorithms, in the Key Agreement with Key 694 Wrapping mode. 696 A new ephemeral public key value MUST be generated for each key 697 agreement operation. 699 In Direct Key Agreement mode, the output of the Concat KDF MUST be a 700 key of the same length as that used by the "enc" algorithm. In this 701 case, the empty octet sequence is used as the JWE Encrypted Key 702 value. The "alg" Header Parameter value "ECDH-ES" is used in the 703 Direct Key Agreement mode. 705 In Key Agreement with Key Wrapping mode, the output of the Concat KDF 706 MUST be a key of the length needed for the specified key wrapping 707 algorithm. In this case, the JWE Encrypted Key is the CEK wrapped 708 with the agreed upon key. 710 The following "alg" (algorithm) Header Parameter values are used to 711 indicate that the JWE Encrypted Key is the result of encrypting the 712 CEK using the result of the key agreement algorithm as the key 713 encryption key for the corresponding key wrapping algorithm: 715 +----------------+--------------------------------------------------+ 716 | alg Param | Key Management Algorithm | 717 | Value | | 718 +----------------+--------------------------------------------------+ 719 | ECDH-ES+A128KW | ECDH-ES using Concat KDF and CEK wrapped with | 720 | | "A128KW" | 721 | ECDH-ES+A192KW | ECDH-ES using Concat KDF and CEK wrapped with | 722 | | "A192KW" | 723 | ECDH-ES+A256KW | ECDH-ES using Concat KDF and CEK wrapped with | 724 | | "A256KW" | 725 +----------------+--------------------------------------------------+ 727 4.6.1. Header Parameters Used for ECDH Key Agreement 729 The following Header Parameter names are used for key agreement as 730 defined below. 732 4.6.1.1. "epk" (Ephemeral Public Key) Header Parameter 734 The "epk" (ephemeral public key) value created by the originator for 735 the use in key agreement algorithms. This key is represented as a 736 JSON Web Key [JWK] public key value. It MUST contain only public key 737 parameters and SHOULD contain only the minimum JWK parameters 738 necessary to represent the key; other JWK parameters included can be 739 checked for consistency and honored or can be ignored. This Header 740 Parameter MUST be present and MUST be understood and processed by 741 implementations when these algorithms are used. 743 4.6.1.2. "apu" (Agreement PartyUInfo) Header Parameter 745 The "apu" (agreement PartyUInfo) value for key agreement algorithms 746 using it (such as "ECDH-ES"), represented as a base64url encoded 747 string. When used, the PartyUInfo value contains information about 748 the producer. Use of this Header Parameter is OPTIONAL. This Header 749 Parameter MUST be understood and processed by implementations when 750 these algorithms are used. 752 4.6.1.3. "apv" (Agreement PartyVInfo) Header Parameter 754 The "apv" (agreement PartyVInfo) value for key agreement algorithms 755 using it (such as "ECDH-ES"), represented as a base64url encoded 756 string. When used, the PartyVInfo value contains information about 757 the recipient. Use of this Header Parameter is OPTIONAL. This 758 Header Parameter MUST be understood and processed by implementations 759 when these algorithms are used. 761 4.6.2. Key Derivation for ECDH Key Agreement 763 The key derivation process derives the agreed upon key from the 764 shared secret Z established through the ECDH algorithm, per Section 765 6.2.2.2 of [NIST.800-56A]. 767 Key derivation is performed using the Concat KDF, as defined in 768 Section 5.8.1 of [NIST.800-56A], where the Digest Method is SHA-256. 769 The Concat KDF parameters are set as follows: 771 Z 772 This is set to the representation of the shared secret Z as an 773 octet sequence. 775 keydatalen 776 This is set to the number of bits in the desired output key. For 777 "ECDH-ES", this is length of the key used by the "enc" algorithm. 778 For "ECDH-ES+A128KW", "ECDH-ES+A192KW", and "ECDH-ES+A256KW", this 779 is 128, 192, and 256, respectively. 781 AlgorithmID 782 The AlgorithmID value is of the form Datalen || Data, where Data 783 is a variable-length string of zero or more octets, and Datalen is 784 a fixed-length, big endian 32 bit counter that indicates the 785 length (in octets) of Data. In the Direct Key Agreement case, 786 Data is set to the octets of the ASCII representation of the "enc" 787 Header Parameter value. In the Key Agreement with Key Wrapping 788 case, Data is set to the octets of the ASCII representation of the 789 "alg" Header Parameter value. 791 PartyUInfo 792 The PartyUInfo value is of the form Datalen || Data, where Data is 793 a variable-length string of zero or more octets, and Datalen is a 794 fixed-length, big endian 32 bit counter that indicates the length 795 (in octets) of Data. If an "apu" (agreement PartyUInfo) Header 796 Parameter is present, Data is set to the result of base64url 797 decoding the "apu" value and Datalen is set to the number of 798 octets in Data. Otherwise, Datalen is set to 0 and Data is set to 799 the empty octet sequence. 801 PartyVInfo 802 The PartyVInfo value is of the form Datalen || Data, where Data is 803 a variable-length string of zero or more octets, and Datalen is a 804 fixed-length, big endian 32 bit counter that indicates the length 805 (in octets) of Data. If an "apv" (agreement PartyVInfo) Header 806 Parameter is present, Data is set to the result of base64url 807 decoding the "apv" value and Datalen is set to the number of 808 octets in Data. Otherwise, Datalen is set to 0 and Data is set to 809 the empty octet sequence. 811 SuppPubInfo 812 This is set to the keydatalen represented as a 32 bit big endian 813 integer. 815 SuppPrivInfo 816 This is set to the empty octet sequence. 818 Applications need to specify how the "apu" and "apv" parameters are 819 used for that application. The "apu" and "apv" values MUST be 820 distinct, when used. Applications wishing to conform to 821 [NIST.800-56A] need to provide values that meet the requirements of 822 that document, e.g., by using values that identify the producer and 823 consumer. Alternatively, applications MAY conduct key derivation in 824 a manner similar to The Diffie-Hellman Key Agreement Method 825 [RFC2631]: In that case, the "apu" field MAY either be omitted or 826 represent a random 512-bit value (analogous to PartyAInfo in 827 Ephemeral-Static mode in RFC 2631) and the "apv" field SHOULD NOT be 828 present. 830 See Appendix C for an example key agreement computation using this 831 method. 833 4.7. Key Encryption with AES GCM 835 This section defines the specifics of encrypting a JWE Content 836 Encryption Key (CEK) with Advanced Encryption Standard (AES) in 837 Galois/Counter Mode (GCM) [AES, NIST.800-38D]. 839 Use of an Initialization Vector of size 96 bits is REQUIRED with this 840 algorithm. The Initialization Vector is represented in base64url 841 encoded form as the "iv" (initialization vector) Header Parameter 842 value. 844 The Additional Authenticated Data value used is the empty octet 845 string. 847 The requested size of the Authentication Tag output MUST be 128 bits, 848 regardless of the key size. 850 The JWE Encrypted Key value is the Ciphertext output. 852 The Authentication Tag output is represented in base64url encoded 853 form as the "tag" (authentication tag) Header Parameter value. 855 The following "alg" (algorithm) Header Parameter values are used to 856 indicate that the JWE Encrypted Key is the result of encrypting the 857 CEK using the corresponding algorithm and key size: 859 +-----------------+---------------------------------------------+ 860 | alg Param Value | Key Management Algorithm | 861 +-----------------+---------------------------------------------+ 862 | A128GCMKW | Key wrapping with AES GCM using 128 bit key | 863 | A192GCMKW | Key wrapping with AES GCM using 192 bit key | 864 | A256GCMKW | Key wrapping with AES GCM using 256 bit key | 865 +-----------------+---------------------------------------------+ 867 4.7.1. Header Parameters Used for AES GCM Key Encryption 869 The following Header Parameters are used for AES GCM key encryption. 871 4.7.1.1. "iv" (Initialization Vector) Header Parameter 873 The "iv" (initialization vector) Header Parameter value is the 874 base64url encoded representation of the 96 bit Initialization Vector 875 value used for the key encryption operation. This Header Parameter 876 MUST be present and MUST be understood and processed by 877 implementations when these algorithms are used. 879 4.7.1.2. "tag" (Authentication Tag) Header Parameter 881 The "tag" (authentication tag) Header Parameter value is the 882 base64url encoded representation of the 128 bit Authentication Tag 883 value resulting from the key encryption operation. This Header 884 Parameter MUST be present and MUST be understood and processed by 885 implementations when these algorithms are used. 887 4.8. Key Encryption with PBES2 889 This section defines the specifics of performing password-based 890 encryption of a JWE CEK, by first deriving a key encryption key from 891 a user-supplied password using PBES2 schemes as specified in Section 892 6.2 of [RFC2898], then by encrypting the JWE CEK using the derived 893 key. 895 These algorithms use HMAC SHA-2 algorithms as the Pseudo-Random 896 Function (PRF) for the PBKDF2 key derivation and AES Key Wrap 897 [RFC3394] for the encryption scheme. The PBES2 password input is an 898 octet sequence; if the password to be used is represented as a text 899 string rather than an octet sequence, the UTF-8 encoding of the text 900 string MUST be used as the octet sequence. The salt parameter MUST 901 be computed from the "p2s" (PBES2 salt input) Header Parameter value 902 and the "alg" (algorithm) Header Parameter value as specified in the 903 "p2s" definition below. The iteration count parameter MUST be 904 provided as the "p2c" Header Parameter value. The algorithms 905 respectively use HMAC SHA-256, HMAC SHA-384, and HMAC SHA-512 as the 906 PRF and use 128, 192, and 256 bit AES Key Wrap keys. Their derived- 907 key lengths respectively are 16, 24, and 32 octets. 909 The following "alg" (algorithm) Header Parameter values are used to 910 indicate that the JWE Encrypted Key is the result of encrypting the 911 CEK using the result of the corresponding password-based encryption 912 algorithm as the key encryption key for the corresponding key 913 wrapping algorithm: 915 +--------------------+----------------------------------------------+ 916 | alg Param Value | Key Management Algorithm | 917 +--------------------+----------------------------------------------+ 918 | PBES2-HS256+A128KW | PBES2 with HMAC SHA-256 and "A128KW" | 919 | | wrapping | 920 | PBES2-HS384+A192KW | PBES2 with HMAC SHA-384 and "A192KW" | 921 | | wrapping | 922 | PBES2-HS512+A256KW | PBES2 with HMAC SHA-512 and "A256KW" | 923 | | wrapping | 924 +--------------------+----------------------------------------------+ 926 See Appendix C of JSON Web Key (JWK) [JWK] for an example key 927 encryption computation using "PBES2-HS256+A128KW". 929 4.8.1. Header Parameters Used for PBES2 Key Encryption 931 The following Header Parameters are used for Key Encryption with 932 PBES2. 934 4.8.1.1. "p2s" (PBES2 salt input) Parameter 936 The "p2s" (PBES2 salt input) Header Parameter encodes a Salt Input 937 value, which is used as part of the PBKDF2 salt value. The "p2s" 938 value is BASE64URL(Salt Input). This Header Parameter MUST be 939 present and MUST be understood and processed by implementations when 940 these algorithms are used. 942 The salt expands the possible keys that can be derived from a given 943 password. A Salt Input value containing 8 or more octets MUST be 944 used. A new Salt Input value MUST be generated randomly for every 945 encryption operation; see RFC 4086 [RFC4086] for considerations on 946 generating random values. The salt value used is (UTF8(Alg) || 0x00 947 || Salt Input), where Alg is the "alg" Header Parameter value. 949 4.8.1.2. "p2c" (PBES2 count) Parameter 951 The "p2c" (PBES2 count) Header Parameter contains the PBKDF2 952 iteration count, represented as a positive JSON integer. This Header 953 Parameter MUST be present and MUST be understood and processed by 954 implementations when these algorithms are used. 956 The iteration count adds computational expense, ideally compounded by 957 the possible range of keys introduced by the salt. A minimum 958 iteration count of 1000 is RECOMMENDED. 960 5. Cryptographic Algorithms for Content Encryption 962 JWE uses cryptographic algorithms to encrypt and integrity protect 963 the Plaintext and to also integrity protect additional authenticated 964 data. 966 5.1. "enc" (Encryption Algorithm) Header Parameter Values for JWE 968 The table below is the set of "enc" (encryption algorithm) Header 969 Parameter values that are defined by this specification for use with 970 JWE. 972 +---------------+----------------------------------+----------------+ 973 | enc Param | Content Encryption Algorithm | Implementation | 974 | Value | | Requirements | 975 +---------------+----------------------------------+----------------+ 976 | A128CBC-HS256 | AES_128_CBC_HMAC_SHA_256 | Required | 977 | | authenticated encryption | | 978 | | algorithm, as defined in | | 979 | | Section 5.2.3 | | 980 | A192CBC-HS384 | AES_192_CBC_HMAC_SHA_384 | Optional | 981 | | authenticated encryption | | 982 | | algorithm, as defined in | | 983 | | Section 5.2.4 | | 984 | A256CBC-HS512 | AES_256_CBC_HMAC_SHA_512 | Required | 985 | | authenticated encryption | | 986 | | algorithm, as defined in | | 987 | | Section 5.2.5 | | 988 | A128GCM | AES GCM using 128 bit key | Recommended | 989 | A192GCM | AES GCM using 192 bit key | Optional | 990 | A256GCM | AES GCM using 256 bit key | Recommended | 991 +---------------+----------------------------------+----------------+ 993 All also use a JWE Initialization Vector value and produce JWE 994 Ciphertext and JWE Authentication Tag values. 996 See Appendix A.3 for a table cross-referencing the JWE "enc" 997 (encryption algorithm) values defined in this specification with the 998 equivalent identifiers used by other standards and software packages. 1000 5.2. AES_CBC_HMAC_SHA2 Algorithms 1002 This section defines a family of authenticated encryption algorithms 1003 built using a composition of Advanced Encryption Standard (AES) [AES] 1004 in Cipher Block Chaining (CBC) mode [NIST.800-38A] with PKCS #7 1005 padding [RFC5652], Section 6.3 operations and HMAC [RFC2104, SHS] 1006 operations. This algorithm family is called AES_CBC_HMAC_SHA2. It 1007 also defines three instances of this family, the first using 128 bit 1008 CBC keys and HMAC SHA-256, the second using 192 bit CBC keys and HMAC 1009 SHA-384, and the third using 256 bit CBC keys and HMAC SHA-512. Test 1010 cases for these algorithms can be found in Appendix B. 1012 These algorithms are based upon Authenticated Encryption with AES-CBC 1013 and HMAC-SHA [I-D.mcgrew-aead-aes-cbc-hmac-sha2], performing the same 1014 cryptographic computations, but with the Initialization Vector and 1015 Authentication Tag values remaining separate, rather than being 1016 concatenated with the Ciphertext value in the output representation. 1017 This option is discussed in Appendix B of that specification. This 1018 algorithm family is a generalization of the algorithm family in 1019 [I-D.mcgrew-aead-aes-cbc-hmac-sha2], and can be used to implement 1020 those algorithms. 1022 5.2.1. Conventions Used in Defining AES_CBC_HMAC_SHA2 1024 We use the following notational conventions. 1026 CBC-PKCS5-ENC(X, P) denotes the AES CBC encryption of P using PKCS 1027 #7 padding using the cipher with the key X. 1029 MAC(Y, M) denotes the application of the Message Authentication 1030 Code (MAC) to the message M, using the key Y. 1032 5.2.2. Generic AES_CBC_HMAC_SHA2 Algorithm 1034 This section defines AES_CBC_HMAC_SHA2 in a manner that is 1035 independent of the AES CBC key size or hash function to be used. 1036 Section 5.2.2.1 and Section 5.2.2.2 define the generic encryption and 1037 decryption algorithms. Sections 5.2.3 through 5.2.5 define instances 1038 of AES_CBC_HMAC_SHA2 that specify those details. 1040 5.2.2.1. AES_CBC_HMAC_SHA2 Encryption 1042 The authenticated encryption algorithm takes as input four octet 1043 strings: a secret key K, a plaintext P, additional authenticated data 1044 A, and an initialization vector IV. The authenticated ciphertext 1045 value E and the authentication tag value T are provided as outputs. 1046 The data in the plaintext are encrypted and authenticated, and the 1047 additional authenticated data are authenticated, but not encrypted. 1049 The encryption process is as follows, or uses an equivalent set of 1050 steps: 1052 1. The secondary keys MAC_KEY and ENC_KEY are generated from the 1053 input key K as follows. Each of these two keys is an octet 1054 string. 1056 MAC_KEY consists of the initial MAC_KEY_LEN octets of K, in 1057 order. 1059 ENC_KEY consists of the final ENC_KEY_LEN octets of K, in 1060 order. 1062 The number of octets in the input key K MUST be the sum of 1063 MAC_KEY_LEN and ENC_KEY_LEN. The values of these parameters are 1064 specified by the Authenticated Encryption algorithms in Sections 1065 5.2.3 through 5.2.5. Note that the MAC key comes before the 1066 encryption key in the input key K; this is in the opposite order 1067 of the algorithm names in the identifier "AES_CBC_HMAC_SHA2". 1069 2. The Initialization Vector (IV) used is a 128 bit value generated 1070 randomly or pseudorandomly for use in the cipher. 1072 3. The plaintext is CBC encrypted using PKCS #7 padding using 1073 ENC_KEY as the key, and the IV. We denote the ciphertext output 1074 from this step as E. 1076 4. The octet string AL is equal to the number of bits in the 1077 additional authenticated data A expressed as a 64-bit unsigned 1078 big endian integer. 1080 5. A message authentication tag T is computed by applying HMAC 1081 [RFC2104] to the following data, in order: 1083 the additional authenticated data A, 1085 the initialization vector IV, 1087 the ciphertext E computed in the previous step, and 1089 the octet string AL defined above. 1091 The string MAC_KEY is used as the MAC key. We denote the output 1092 of the MAC computed in this step as M. The first T_LEN bits of M 1093 are used as T. 1095 6. The Ciphertext E and the Authentication Tag T are returned as the 1096 outputs of the authenticated encryption. 1098 The encryption process can be illustrated as follows. Here K, P, A, 1099 IV, and E denote the key, plaintext, additional authenticated data, 1100 initialization vector, and ciphertext, respectively. 1102 MAC_KEY = initial MAC_KEY_LEN octets of K, 1104 ENC_KEY = final ENC_KEY_LEN octets of K, 1106 E = CBC-PKCS5-ENC(ENC_KEY, P), 1108 M = MAC(MAC_KEY, A || IV || E || AL), 1110 T = initial T_LEN octets of M. 1112 5.2.2.2. AES_CBC_HMAC_SHA2 Decryption 1114 The authenticated decryption operation has five inputs: K, A, IV, E, 1115 and T as defined above. It has only a single output, either a 1116 plaintext value P or a special symbol FAIL that indicates that the 1117 inputs are not authentic. The authenticated decryption algorithm is 1118 as follows, or uses an equivalent set of steps: 1120 1. The secondary keys MAC_KEY and ENC_KEY are generated from the 1121 input key K as in Step 1 of Section 5.2.2.1. 1123 2. The integrity and authenticity of A and E are checked by 1124 computing an HMAC with the inputs as in Step 5 of 1125 Section 5.2.2.1. The value T, from the previous step, is 1126 compared to the first MAC_KEY length bits of the HMAC output. If 1127 those values are identical, then A and E are considered valid, 1128 and processing is continued. Otherwise, all of the data used in 1129 the MAC validation are discarded, and the Authenticated 1130 Encryption decryption operation returns an indication that it 1131 failed, and the operation halts. (But see Section 11.5 of [JWE] 1132 for security considerations on thwarting timing attacks.) 1134 3. The value E is decrypted and the PKCS #7 padding is checked and 1135 removed. The value IV is used as the initialization vector. The 1136 value ENC_KEY is used as the decryption key. 1138 4. The plaintext value is returned. 1140 5.2.3. AES_128_CBC_HMAC_SHA_256 1142 This algorithm is a concrete instantiation of the generic 1143 AES_CBC_HMAC_SHA2 algorithm above. It uses the HMAC message 1144 authentication code [RFC2104] with the SHA-256 hash function [SHS] to 1145 provide message authentication, with the HMAC output truncated to 128 1146 bits, corresponding to the HMAC-SHA-256-128 algorithm defined in 1147 [RFC4868]. For encryption, it uses AES in the Cipher Block Chaining 1148 (CBC) mode of operation as defined in Section 6.2 of [NIST.800-38A], 1149 with PKCS #7 padding and a 128 bit initialization vector (IV) value. 1151 The AES_CBC_HMAC_SHA2 parameters specific to AES_128_CBC_HMAC_SHA_256 1152 are: 1154 The input key K is 32 octets long. 1156 ENC_KEY_LEN is 16 octets. 1158 MAC_KEY_LEN is 16 octets. 1160 The SHA-256 hash algorithm is used for the HMAC. 1162 The HMAC-SHA-256 output is truncated to T_LEN=16 octets, by 1163 stripping off the final 16 octets. 1165 5.2.4. AES_192_CBC_HMAC_SHA_384 1167 AES_192_CBC_HMAC_SHA_384 is based on AES_128_CBC_HMAC_SHA_256, but 1168 with the following differences: 1170 The input key K is 48 octets long instead of 32. 1172 ENC_KEY_LEN is 24 octets instead of 16. 1174 MAC_KEY_LEN is 24 octets instead of 16. 1176 SHA-384 is used for the HMAC instead of SHA-256. 1178 The HMAC SHA-384 value is truncated to T_LEN=24 octets instead of 1179 16. 1181 5.2.5. AES_256_CBC_HMAC_SHA_512 1183 AES_256_CBC_HMAC_SHA_512 is based on AES_128_CBC_HMAC_SHA_256, but 1184 with the following differences: 1186 The input key K is 64 octets long instead of 32. 1188 ENC_KEY_LEN is 32 octets instead of 16. 1190 MAC_KEY_LEN is 32 octets instead of 16. 1192 SHA-512 is used for the HMAC instead of SHA-256. 1194 The HMAC SHA-512 value is truncated to T_LEN=32 octets instead of 1195 16. 1197 5.2.6. Content Encryption with AES_CBC_HMAC_SHA2 1199 This section defines the specifics of performing authenticated 1200 encryption with the AES_CBC_HMAC_SHA2 algorithms. 1202 The CEK is used as the secret key K. 1204 The following "enc" (encryption algorithm) Header Parameter values 1205 are used to indicate that the JWE Ciphertext and JWE Authentication 1206 Tag values have been computed using the corresponding algorithm: 1208 +---------------+---------------------------------------------------+ 1209 | enc Param | Content Encryption Algorithm | 1210 | Value | | 1211 +---------------+---------------------------------------------------+ 1212 | A128CBC-HS256 | AES_128_CBC_HMAC_SHA_256 authenticated encryption | 1213 | | algorithm, as defined in Section 5.2.3 | 1214 | A192CBC-HS384 | AES_192_CBC_HMAC_SHA_384 authenticated encryption | 1215 | | algorithm, as defined in Section 5.2.4 | 1216 | A256CBC-HS512 | AES_256_CBC_HMAC_SHA_512 authenticated encryption | 1217 | | algorithm, as defined in Section 5.2.5 | 1218 +---------------+---------------------------------------------------+ 1220 5.3. Content Encryption with AES GCM 1222 This section defines the specifics of performing authenticated 1223 encryption with Advanced Encryption Standard (AES) in Galois/Counter 1224 Mode (GCM) [AES, NIST.800-38D]. 1226 The CEK is used as the encryption key. 1228 Use of an initialization vector of size 96 bits is REQUIRED with this 1229 algorithm. 1231 The requested size of the Authentication Tag output MUST be 128 bits, 1232 regardless of the key size. 1234 The following "enc" (encryption algorithm) Header Parameter values 1235 are used to indicate that the JWE Ciphertext and JWE Authentication 1236 Tag values have been computed using the corresponding algorithm and 1237 key size: 1239 +-----------------+------------------------------+ 1240 | enc Param Value | Content Encryption Algorithm | 1241 +-----------------+------------------------------+ 1242 | A128GCM | AES GCM using 128 bit key | 1243 | A192GCM | AES GCM using 192 bit key | 1244 | A256GCM | AES GCM using 256 bit key | 1245 +-----------------+------------------------------+ 1247 An example using this algorithm is shown in Appendix A.1 of [JWE]. 1249 6. Cryptographic Algorithms for Keys 1251 A JSON Web Key (JWK) [JWK] is a JSON data structure that represents a 1252 cryptographic key. These keys can be either asymmetric or symmetric. 1253 They can hold both public and private information about the key. 1254 This section defines the parameters for keys using the algorithms 1255 specified by this document. 1257 6.1. "kty" (Key Type) Parameter Values 1259 The table below is the set of "kty" (key type) parameter values that 1260 are defined by this specification for use in JWKs. 1262 +-------------+------------------------------------+----------------+ 1263 | kty Param | Key Type | Implementation | 1264 | Value | | Requirements | 1265 +-------------+------------------------------------+----------------+ 1266 | EC | Elliptic Curve [DSS] | Recommended+ | 1267 | RSA | RSA [RFC3447] | Required | 1268 | oct | Octet sequence (used to represent | Required | 1269 | | symmetric keys) | | 1270 +-------------+------------------------------------+----------------+ 1272 The use of "+" in the Implementation Requirements indicates that the 1273 requirement strength is likely to be increased in a future version of 1274 the specification. 1276 6.2. Parameters for Elliptic Curve Keys 1278 JWKs can represent Elliptic Curve [DSS] keys. In this case, the 1279 "kty" member value is "EC". 1281 6.2.1. Parameters for Elliptic Curve Public Keys 1283 An elliptic curve public key is represented by a pair of coordinates 1284 drawn from a finite field, which together define a point on an 1285 elliptic curve. The following members MUST be present for all 1286 elliptic curve public keys: 1288 o "crv" 1289 o "x" 1291 The following member MUST also be present for elliptic curve public 1292 keys for the three curves defined in the following section: 1294 o "y" 1296 6.2.1.1. "crv" (Curve) Parameter 1298 The "crv" (curve) member identifies the cryptographic curve used with 1299 the key. Curve values from [DSS] used by this specification are: 1301 o "P-256" 1302 o "P-384" 1303 o "P-521" 1305 These values are registered in the IANA JSON Web Key Elliptic Curve 1306 registry defined in Section 7.6. Additional "crv" values can be 1307 registered by other specifications. Specifications registering 1308 additional curves must define what parameters are used to represent 1309 keys for the curves registered. The "crv" value is a case-sensitive 1310 string. 1312 SEC1 [SEC1] point compression is not supported for any of these three 1313 curves. 1315 6.2.1.2. "x" (X Coordinate) Parameter 1317 The "x" (x coordinate) member contains the x coordinate for the 1318 elliptic curve point. It is represented as the base64url encoding of 1319 the octet string representation of the coordinate, as defined in 1320 Section 2.3.5 of SEC1 [SEC1]. The length of this octet string MUST 1321 be the full size of a coordinate for the curve specified in the "crv" 1322 parameter. For example, if the value of "crv" is "P-521", the octet 1323 string must be 66 octets long. 1325 6.2.1.3. "y" (Y Coordinate) Parameter 1327 The "y" (y coordinate) member contains the y coordinate for the 1328 elliptic curve point. It is represented as the base64url encoding of 1329 the octet string representation of the coordinate, as defined in 1330 Section 2.3.5 of SEC1 [SEC1]. The length of this octet string MUST 1331 be the full size of a coordinate for the curve specified in the "crv" 1332 parameter. For example, if the value of "crv" is "P-521", the octet 1333 string must be 66 octets long. 1335 6.2.2. Parameters for Elliptic Curve Private Keys 1337 In addition to the members used to represent Elliptic Curve public 1338 keys, the following member MUST be present to represent Elliptic 1339 Curve private keys. 1341 6.2.2.1. "d" (ECC Private Key) Parameter 1343 The "d" (ECC private key) member contains the Elliptic Curve private 1344 key value. It is represented as the base64url encoding of the octet 1345 string representation of the private key value, as defined in Section 1346 2.3.7 of SEC1 [SEC1]. The length of this octet string MUST be 1347 ceiling(log-base-2(n)/8) octets (where n is the order of the curve). 1349 6.3. Parameters for RSA Keys 1351 JWKs can represent RSA [RFC3447] keys. In this case, the "kty" 1352 member value is "RSA". The semantics of the parameters defined below 1353 are the same as those defined in Sections 3.1 and 3.2 of RFC 3447. 1355 6.3.1. Parameters for RSA Public Keys 1357 The following members MUST be present for RSA public keys. 1359 6.3.1.1. "n" (Modulus) Parameter 1361 The "n" (modulus) member contains the modulus value for the RSA 1362 public key. It is represented as a Base64urlUInt encoded value. 1364 Note that implementers have found that some cryptographic libraries 1365 prefix an extra zero-valued octet to the modulus representations they 1366 return, for instance, returning 257 octets for a 2048 bit key, rather 1367 than 256. Implementations using such libraries will need to take 1368 care to omit the extra octet from the base64url encoded 1369 representation. 1371 6.3.1.2. "e" (Exponent) Parameter 1373 The "e" (exponent) member contains the exponent value for the RSA 1374 public key. It is represented as a Base64urlUInt encoded value. 1376 For instance, when representing the value 65537, the octet sequence 1377 to be base64url encoded MUST consist of the three octets [1, 0, 1]; 1378 the resulting representation for this value is "AQAB". 1380 6.3.2. Parameters for RSA Private Keys 1382 In addition to the members used to represent RSA public keys, the 1383 following members are used to represent RSA private keys. The 1384 parameter "d" is REQUIRED for RSA private keys. The others enable 1385 optimizations and SHOULD be included by producers of JWKs 1386 representing RSA private keys. If the producer includes any of the 1387 other private key parameters, then all of the others MUST be present, 1388 with the exception of "oth", which MUST only be present when more 1389 than two prime factors were used. 1391 6.3.2.1. "d" (Private Exponent) Parameter 1393 The "d" (private exponent) member contains the private exponent value 1394 for the RSA private key. It is represented as a Base64urlUInt 1395 encoded value. 1397 6.3.2.2. "p" (First Prime Factor) Parameter 1399 The "p" (first prime factor) member contains the first prime factor. 1400 It is represented as a Base64urlUInt encoded value. 1402 6.3.2.3. "q" (Second Prime Factor) Parameter 1404 The "q" (second prime factor) member contains the second prime 1405 factor. It is represented as a Base64urlUInt encoded value. 1407 6.3.2.4. "dp" (First Factor CRT Exponent) Parameter 1409 The "dp" (first factor CRT exponent) member contains the Chinese 1410 Remainder Theorem (CRT) exponent of the first factor. It is 1411 represented as a Base64urlUInt encoded value. 1413 6.3.2.5. "dq" (Second Factor CRT Exponent) Parameter 1415 The "dq" (second factor CRT exponent) member contains the Chinese 1416 Remainder Theorem (CRT) exponent of the second factor. It is 1417 represented as a Base64urlUInt encoded value. 1419 6.3.2.6. "qi" (First CRT Coefficient) Parameter 1421 The "qi" (first CRT coefficient) member contains the Chinese 1422 Remainder Theorem (CRT) coefficient of the second factor. It is 1423 represented as a Base64urlUInt encoded value. 1425 6.3.2.7. "oth" (Other Primes Info) Parameter 1427 The "oth" (other primes info) member contains an array of information 1428 about any third and subsequent primes, should they exist. When only 1429 two primes have been used (the normal case), this parameter MUST be 1430 omitted. When three or more primes have been used, the number of 1431 array elements MUST be the number of primes used minus two. For more 1432 information on this case, see the description of the OtherPrimeInfo 1433 parameters in Section A.1.2 of RFC 3447 [RFC3447], upon which the 1434 following parameters are modelled. If the consumer of a JWK does not 1435 support private keys with more than two primes and it encounters a 1436 private key that includes the "oth" parameter, then it MUST NOT use 1437 the key. Each array element MUST be an object with the following 1438 members: 1440 6.3.2.7.1. "r" (Prime Factor) 1442 The "r" (prime factor) parameter within an "oth" array member 1443 represents the value of a subsequent prime factor. It is represented 1444 as a Base64urlUInt encoded value. 1446 6.3.2.7.2. "d" (Factor CRT Exponent) 1448 The "d" (Factor CRT Exponent) parameter within an "oth" array member 1449 represents the CRT exponent of the corresponding prime factor. It is 1450 represented as a Base64urlUInt encoded value. 1452 6.3.2.7.3. "t" (Factor CRT Coefficient) 1454 The "t" (factor CRT coefficient) parameter within an "oth" array 1455 member represents the CRT coefficient of the corresponding prime 1456 factor. It is represented as a Base64urlUInt encoded value. 1458 6.4. Parameters for Symmetric Keys 1460 When the JWK "kty" member value is "oct" (octet sequence), the member 1461 "k" is used to represent a symmetric key (or another key whose value 1462 is a single octet sequence). An "alg" member SHOULD also be present 1463 to identify the algorithm intended to be used with the key, unless 1464 the application uses another means or convention to determine the 1465 algorithm used. 1467 6.4.1. "k" (Key Value) Parameter 1469 The "k" (key value) member contains the value of the symmetric (or 1470 other single-valued) key. It is represented as the base64url 1471 encoding of the octet sequence containing the key value. 1473 7. IANA Considerations 1475 The following registration procedure is used for all the registries 1476 established by this specification. 1478 Values are registered on a Specification Required [RFC5226] basis 1479 after a three-week review period on the jose-reg-review@ietf.org 1480 mailing list, on the advice of one or more Designated Experts. 1481 However, to allow for the allocation of values prior to publication, 1482 the Designated Expert(s) may approve registration once they are 1483 satisfied that such a specification will be published. 1485 Registration requests must be sent to the jose-reg-review@ietf.org 1486 mailing list for review and comment, with an appropriate subject 1487 (e.g., "Request to register algorithm: example"). 1489 Within the review period, the Designated Expert(s) will either 1490 approve or deny the registration request, communicating this decision 1491 to the review list and IANA. Denials should include an explanation 1492 and, if applicable, suggestions as to how to make the request 1493 successful. Registration requests that are undetermined for a period 1494 longer than 21 days can be brought to the IESG's attention (using the 1495 iesg@ietf.org mailing list) for resolution. 1497 Criteria that should be applied by the Designated Expert(s) includes 1498 determining whether the proposed registration duplicates existing 1499 functionality, determining whether it is likely to be of general 1500 applicability or whether it is useful only for a single application, 1501 and whether the registration description is clear. 1503 IANA must only accept registry updates from the Designated Expert(s) 1504 and should direct all requests for registration to the review mailing 1505 list. 1507 It is suggested that multiple Designated Experts be appointed who are 1508 able to represent the perspectives of different applications using 1509 this specification, in order to enable broadly-informed review of 1510 registration decisions. In cases where a registration decision could 1511 be perceived as creating a conflict of interest for a particular 1512 Expert, that Expert should defer to the judgment of the other 1513 Expert(s). 1515 [[ Note to the RFC Editor and IANA: Pearl Liang of ICANN had 1516 requested that the draft supply the following proposed registry 1517 description information. It is to be used for all registries 1518 established by this specification. 1520 o Protocol Category: JSON Object Signing and Encryption (JOSE) 1522 o Registry Location: http://www.iana.org/assignments/jose 1524 o Webpage Title: (same as the protocol category) 1526 o Registry Name: (same as the section title, but excluding the word 1527 "Registry", for example "JSON Web Signature and Encryption 1528 Algorithms") 1530 ]] 1532 7.1. JSON Web Signature and Encryption Algorithms Registry 1534 This specification establishes the IANA JSON Web Signature and 1535 Encryption Algorithms registry for values of the JWS and JWE "alg" 1536 (algorithm) and "enc" (encryption algorithm) Header Parameters. The 1537 registry records the algorithm name, the algorithm usage locations, 1538 implementation requirements, and a reference to the specification 1539 that defines it. The same algorithm name can be registered multiple 1540 times, provided that the sets of usage locations are disjoint. 1542 It is suggested that when multiple variations of algorithms are being 1543 registered that use keys of different lengths and the key lengths for 1544 each need to be fixed (for instance, because they will be created by 1545 key derivation functions), that the length of the key be included in 1546 the algorithm name. This allows readers of the JSON text to more 1547 easily make security decisions. 1549 The Designated Expert(s) should perform reasonable due diligence that 1550 algorithms being registered are either currently considered 1551 cryptographically credible or are being registered as Deprecated or 1552 Prohibited. 1554 The implementation requirements of an algorithm may be changed over 1555 time as the cryptographic landscape evolves, for instance, to change 1556 the status of an algorithm to Deprecated, or to change the status of 1557 an algorithm from Optional to Recommended+ or Required. Changes of 1558 implementation requirements are only permitted on a Specification 1559 Required basis after review by the Designated Experts(s), with the 1560 new specification defining the revised implementation requirements 1561 level. 1563 7.1.1. Registration Template 1564 Algorithm Name: 1565 The name requested (e.g., "HS256"). This name is a case-sensitive 1566 ASCII string. Names may not match other registered names in a 1567 case-insensitive manner unless the Designated Expert(s) state that 1568 there is a compelling reason to allow an exception in this 1569 particular case. 1571 Algorithm Description: 1572 Brief description of the Algorithm (e.g., "HMAC using SHA-256"). 1574 Algorithm Usage Location(s): 1575 The algorithm usage location. This must be one or more of the 1576 values "alg" or "enc" if the algorithm is to be used with JWS or 1577 JWE. The value "JWK" is used if the algorithm identifier will be 1578 used as a JWK "alg" member value, but will not be used with JWS or 1579 JWE; this could be the case, for instance, for non-authenticated 1580 encryption algorithms. Other values may be used with the approval 1581 of a Designated Expert. 1583 JOSE Implementation Requirements: 1584 The algorithm implementation requirements for JWS and JWE, which 1585 must be one the words Required, Recommended, Optional, Deprecated, 1586 or Prohibited. Optionally, the word can be followed by a "+" or 1587 "-". The use of "+" indicates that the requirement strength is 1588 likely to be increased in a future version of the specification. 1589 The use of "-" indicates that the requirement strength is likely 1590 to be decreased in a future version of the specification. Any 1591 identifiers registered for non-authenticated encryption algorithms 1592 or other algorithms that are otherwise unsuitable for direct use 1593 as JWS or JWE algorithms must be registered as "Prohibited". 1595 Change Controller: 1596 For Standards Track RFCs, state "IESG". For others, give the name 1597 of the responsible party. Other details (e.g., postal address, 1598 email address, home page URI) may also be included. 1600 Specification Document(s): 1601 Reference to the document(s) that specify the parameter, 1602 preferably including URI(s) that can be used to retrieve copies of 1603 the document(s). An indication of the relevant sections may also 1604 be included but is not required. 1606 Algorithm Analysis Documents(s): 1607 References to publication(s) in well-known cryptographic 1608 conferences, by national standards bodies, or by other 1609 authoritative sources analyzing the cryptographic soundness of the 1610 algorithm to be registered. The designated experts may require 1611 convincing evidence of the cryptographic soundness of a new 1612 algorithm to be provided with the registration request unless the 1613 algorithm is being registered as Deprecated or Prohibited. Having 1614 gone through working group and IETF review, the initial 1615 registrations made by this document are exempt from the need to 1616 provide this information. 1618 7.1.2. Initial Registry Contents 1620 o Algorithm Name: "HS256" 1621 o Algorithm Description: HMAC using SHA-256 1622 o Algorithm Usage Location(s): "alg" 1623 o JOSE Implementation Requirements: Required 1624 o Change Controller: IESG 1625 o Specification Document(s): Section 3.1 of [[ this document ]] 1626 o Algorithm Analysis Documents(s): n/a 1628 o Algorithm Name: "HS384" 1629 o Algorithm Description: HMAC using SHA-384 1630 o Algorithm Usage Location(s): "alg" 1631 o JOSE Implementation Requirements: Optional 1632 o Change Controller: IESG 1633 o Specification Document(s): Section 3.1 of [[ this document ]] 1634 o Algorithm Analysis Documents(s): n/a 1636 o Algorithm Name: "HS512" 1637 o Algorithm Description: HMAC using SHA-512 1638 o Algorithm Usage Location(s): "alg" 1639 o JOSE Implementation Requirements: Optional 1640 o Change Controller: IESG 1641 o Specification Document(s): Section 3.1 of [[ this document ]] 1642 o Algorithm Analysis Documents(s): n/a 1644 o Algorithm Name: "RS256" 1645 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-256 1646 o Algorithm Usage Location(s): "alg" 1647 o JOSE Implementation Requirements: Recommended 1648 o Change Controller: IESG 1649 o Specification Document(s): Section 3.1 of [[ this document ]] 1650 o Algorithm Analysis Documents(s): n/a 1652 o Algorithm Name: "RS384" 1653 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-384 1654 o Algorithm Usage Location(s): "alg" 1655 o JOSE Implementation Requirements: Optional 1656 o Change Controller: IESG 1657 o Specification Document(s): Section 3.1 of [[ this document ]] 1658 o Algorithm Analysis Documents(s): n/a 1660 o Algorithm Name: "RS512" 1661 o Algorithm Description: RSASSA-PKCS-v1_5 using SHA-512 1662 o Algorithm Usage Location(s): "alg" 1663 o JOSE Implementation Requirements: Optional 1664 o Change Controller: IESG 1665 o Specification Document(s): Section 3.1 of [[ this document ]] 1666 o Algorithm Analysis Documents(s): n/a 1668 o Algorithm Name: "ES256" 1669 o Algorithm Description: ECDSA using P-256 and SHA-256 1670 o Algorithm Usage Location(s): "alg" 1671 o JOSE Implementation Requirements: Recommended+ 1672 o Change Controller: IESG 1673 o Specification Document(s): Section 3.1 of [[ this document ]] 1674 o Algorithm Analysis Documents(s): n/a 1676 o Algorithm Name: "ES384" 1677 o Algorithm Description: ECDSA using P-384 and SHA-384 1678 o Algorithm Usage Location(s): "alg" 1679 o JOSE Implementation Requirements: Optional 1680 o Change Controller: IESG 1681 o Specification Document(s): Section 3.1 of [[ this document ]] 1682 o Algorithm Analysis Documents(s): n/a 1684 o Algorithm Name: "ES512" 1685 o Algorithm Description: ECDSA using P-521 and SHA-512 1686 o Algorithm Usage Location(s): "alg" 1687 o JOSE Implementation Requirements: Optional 1688 o Change Controller: IESG 1689 o Specification Document(s): Section 3.1 of [[ this document ]] 1690 o Algorithm Analysis Documents(s): n/a 1692 o Algorithm Name: "PS256" 1693 o Algorithm Description: RSASSA-PSS using SHA-256 and MGF1 with SHA- 1694 256 1695 o Algorithm Usage Location(s): "alg" 1696 o JOSE Implementation Requirements: Optional 1697 o Change Controller: IESG 1698 o Specification Document(s): Section 3.1 of [[ this document ]] 1699 o Algorithm Analysis Documents(s): n/a 1701 o Algorithm Name: "PS384" 1702 o Algorithm Description: RSASSA-PSS using SHA-384 and MGF1 with SHA- 1703 384 1705 o Algorithm Usage Location(s): "alg" 1706 o JOSE Implementation Requirements: Optional 1707 o Change Controller: IESG 1708 o Specification Document(s): Section 3.1 of [[ this document ]] 1709 o Algorithm Analysis Documents(s): n/a 1711 o Algorithm Name: "PS512" 1712 o Algorithm Description: RSASSA-PSS using SHA-512 and MGF1 with SHA- 1713 512 1714 o Algorithm Usage Location(s): "alg" 1715 o JOSE Implementation Requirements: Optional 1716 o Change Controller: IESG 1717 o Specification Document(s): Section 3.1 of [[ this document ]] 1718 o Algorithm Analysis Documents(s): n/a 1720 o Algorithm Name: "none" 1721 o Algorithm Description: No digital signature or MAC performed 1722 o Algorithm Usage Location(s): "alg" 1723 o JOSE Implementation Requirements: Optional 1724 o Change Controller: IESG 1725 o Specification Document(s): Section 3.1 of [[ this document ]] 1726 o Algorithm Analysis Documents(s): n/a 1728 o Algorithm Name: "RSA1_5" 1729 o Algorithm Description: RSAES-PKCS1-V1_5 1730 o Algorithm Usage Location(s): "alg" 1731 o JOSE Implementation Requirements: Recommended- 1732 o Change Controller: IESG 1733 o Specification Document(s): Section 4.1 of [[ this document ]] 1734 o Algorithm Analysis Documents(s): n/a 1736 o Algorithm Name: "RSA-OAEP" 1737 o Algorithm Description: RSAES OAEP using default parameters 1738 o Algorithm Usage Location(s): "alg" 1739 o JOSE Implementation Requirements: Recommended+ 1740 o Change Controller: IESG 1741 o Specification Document(s): Section 4.1 of [[ this document ]] 1742 o Algorithm Analysis Documents(s): n/a 1744 o Algorithm Name: "RSA-OAEP-256" 1745 o Algorithm Description: RSAES OAEP using SHA-256 and MGF1 with SHA- 1746 256 1747 o Algorithm Usage Location(s): "alg" 1748 o JOSE Implementation Requirements: Optional 1749 o Change Controller: IESG 1750 o Specification Document(s): Section 4.1 of [[ this document ]] 1751 o Algorithm Analysis Documents(s): n/a 1753 o Algorithm Name: "A128KW" 1754 o Algorithm Description: AES Key Wrap using 128 bit key 1755 o Algorithm Usage Location(s): "alg" 1756 o JOSE Implementation Requirements: Recommended 1757 o Change Controller: IESG 1758 o Specification Document(s): Section 4.1 of [[ this document ]] 1759 o Algorithm Analysis Documents(s): n/a 1761 o Algorithm Name: "A192KW" 1762 o Algorithm Description: AES Key Wrap using 192 bit key 1763 o Algorithm Usage Location(s): "alg" 1764 o JOSE Implementation Requirements: Optional 1765 o Change Controller: IESG 1766 o Specification Document(s): Section 4.1 of [[ this document ]] 1767 o Algorithm Analysis Documents(s): n/a 1769 o Algorithm Name: "A256KW" 1770 o Algorithm Description: AES Key Wrap using 256 bit key 1771 o Algorithm Usage Location(s): "alg" 1772 o JOSE Implementation Requirements: Recommended 1773 o Change Controller: IESG 1774 o Specification Document(s): Section 4.1 of [[ this document ]] 1775 o Algorithm Analysis Documents(s): n/a 1777 o Algorithm Name: "dir" 1778 o Algorithm Description: Direct use of a shared symmetric key 1779 o Algorithm Usage Location(s): "alg" 1780 o JOSE Implementation Requirements: Recommended 1781 o Change Controller: IESG 1782 o Specification Document(s): Section 4.1 of [[ this document ]] 1783 o Algorithm Analysis Documents(s): n/a 1785 o Algorithm Name: "ECDH-ES" 1786 o Algorithm Description: ECDH-ES using Concat KDF 1787 o Algorithm Usage Location(s): "alg" 1788 o JOSE Implementation Requirements: Recommended+ 1789 o Change Controller: IESG 1790 o Specification Document(s): Section 4.1 of [[ this document ]] 1791 o Algorithm Analysis Documents(s): n/a 1793 o Algorithm Name: "ECDH-ES+A128KW" 1794 o Algorithm Description: ECDH-ES using Concat KDF and "A128KW" 1795 wrapping 1796 o Algorithm Usage Location(s): "alg" 1797 o JOSE Implementation Requirements: Recommended 1798 o Change Controller: IESG 1799 o Specification Document(s): Section 4.1 of [[ this document ]] 1800 o Algorithm Analysis Documents(s): n/a 1802 o Algorithm Name: "ECDH-ES+A192KW" 1803 o Algorithm Description: ECDH-ES using Concat KDF and "A192KW" 1804 wrapping 1805 o Algorithm Usage Location(s): "alg" 1806 o JOSE Implementation Requirements: Optional 1807 o Change Controller: IESG 1808 o Specification Document(s): Section 4.1 of [[ this document ]] 1809 o Algorithm Analysis Documents(s): n/a 1811 o Algorithm Name: "ECDH-ES+A256KW" 1812 o Algorithm Description: ECDH-ES using Concat KDF and "A256KW" 1813 wrapping 1814 o Algorithm Usage Location(s): "alg" 1815 o JOSE Implementation Requirements: Recommended 1816 o Change Controller: IESG 1817 o Specification Document(s): Section 4.1 of [[ this document ]] 1818 o Algorithm Analysis Documents(s): n/a 1820 o Algorithm Name: "A128GCMKW" 1821 o Algorithm Description: Key wrapping with AES GCM using 128 bit key 1822 o Algorithm Usage Location(s): "alg" 1823 o JOSE Implementation Requirements: Optional 1824 o Change Controller: IESG 1825 o Specification Document(s): Section 4.7 of [[ this document ]] 1826 o Algorithm Analysis Documents(s): n/a 1828 o Algorithm Name: "A192GCMKW" 1829 o Algorithm Description: Key wrapping with AES GCM using 192 bit key 1830 o Algorithm Usage Location(s): "alg" 1831 o JOSE Implementation Requirements: Optional 1832 o Change Controller: IESG 1833 o Specification Document(s): Section 4.7 of [[ this document ]] 1834 o Algorithm Analysis Documents(s): n/a 1836 o Algorithm Name: "A256GCMKW" 1837 o Algorithm Description: Key wrapping with AES GCM using 256 bit key 1838 o Algorithm Usage Location(s): "alg" 1839 o JOSE Implementation Requirements: Optional 1840 o Change Controller: IESG 1841 o Specification Document(s): Section 4.7 of [[ this document ]] 1842 o Algorithm Analysis Documents(s): n/a 1843 o Algorithm Name: "PBES2-HS256+A128KW" 1844 o Algorithm Description: PBES2 with HMAC SHA-256 and "A128KW" 1845 wrapping 1846 o Algorithm Usage Location(s): "alg" 1847 o JOSE Implementation Requirements: Optional 1848 o Change Controller: IESG 1849 o Specification Document(s): Section 4.8 of [[ this document ]] 1850 o Algorithm Analysis Documents(s): n/a 1852 o Algorithm Name: "PBES2-HS384+A192KW" 1853 o Algorithm Description: PBES2 with HMAC SHA-384 and "A192KW" 1854 wrapping 1855 o Algorithm Usage Location(s): "alg" 1856 o JOSE Implementation Requirements: Optional 1857 o Change Controller: IESG 1858 o Specification Document(s): Section 4.8 of [[ this document ]] 1859 o Algorithm Analysis Documents(s): n/a 1861 o Algorithm Name: "PBES2-HS512+A256KW" 1862 o Algorithm Description: PBES2 with HMAC SHA-512 and "A256KW" 1863 wrapping 1864 o Algorithm Usage Location(s): "alg" 1865 o JOSE Implementation Requirements: Optional 1866 o Change Controller: IESG 1867 o Specification Document(s): Section 4.8 of [[ this document ]] 1868 o Algorithm Analysis Documents(s): n/a 1870 o Algorithm Name: "A128CBC-HS256" 1871 o Algorithm Description: AES_128_CBC_HMAC_SHA_256 authenticated 1872 encryption algorithm 1873 o Algorithm Usage Location(s): "enc" 1874 o JOSE Implementation Requirements: Required 1875 o Change Controller: IESG 1876 o Specification Document(s): Section 5.1 of [[ this document ]] 1877 o Algorithm Analysis Documents(s): n/a 1879 o Algorithm Name: "A192CBC-HS384" 1880 o Algorithm Description: AES_192_CBC_HMAC_SHA_384 authenticated 1881 encryption algorithm 1882 o Algorithm Usage Location(s): "enc" 1883 o JOSE Implementation Requirements: Optional 1884 o Change Controller: IESG 1885 o Specification Document(s): Section 5.1 of [[ this document ]] 1886 o Algorithm Analysis Documents(s): n/a 1888 o Algorithm Name: "A256CBC-HS512" 1889 o Algorithm Description: AES_256_CBC_HMAC_SHA_512 authenticated 1890 encryption algorithm 1891 o Algorithm Usage Location(s): "enc" 1892 o JOSE Implementation Requirements: Required 1893 o Change Controller: IESG 1894 o Specification Document(s): Section 5.1 of [[ this document ]] 1895 o Algorithm Analysis Documents(s): n/a 1897 o Algorithm Name: "A128GCM" 1898 o Algorithm Description: AES GCM using 128 bit key 1899 o Algorithm Usage Location(s): "enc" 1900 o JOSE Implementation Requirements: Recommended 1901 o Change Controller: IESG 1902 o Specification Document(s): Section 5.1 of [[ this document ]] 1903 o Algorithm Analysis Documents(s): n/a 1905 o Algorithm Name: "A192GCM" 1906 o Algorithm Description: AES GCM using 192 bit key 1907 o Algorithm Usage Location(s): "enc" 1908 o JOSE Implementation Requirements: Optional 1909 o Change Controller: IESG 1910 o Specification Document(s): Section 5.1 of [[ this document ]] 1911 o Algorithm Analysis Documents(s): n/a 1913 o Algorithm Name: "A256GCM" 1914 o Algorithm Description: AES GCM using 256 bit key 1915 o Algorithm Usage Location(s): "enc" 1916 o JOSE Implementation Requirements: Recommended 1917 o Change Controller: IESG 1918 o Specification Document(s): Section 5.1 of [[ this document ]] 1919 o Algorithm Analysis Documents(s): n/a 1921 7.2. Header Parameter Names Registration 1923 This specification registers the Header Parameter names defined in 1924 Section 4.6.1, Section 4.7.1, and Section 4.8.1 in the IANA JSON Web 1925 Signature and Encryption Header Parameters registry defined in [JWS]. 1927 7.2.1. Registry Contents 1929 o Header Parameter Name: "epk" 1930 o Header Parameter Description: Ephemeral Public Key 1931 o Header Parameter Usage Location(s): JWE 1932 o Change Controller: IESG 1933 o Specification Document(s): Section 4.6.1.1 of [[ this document ]] 1934 o Header Parameter Name: "apu" 1935 o Header Parameter Description: Agreement PartyUInfo 1936 o Header Parameter Usage Location(s): JWE 1937 o Change Controller: IESG 1938 o Specification Document(s): Section 4.6.1.2 of [[ this document ]] 1940 o Header Parameter Name: "apv" 1941 o Header Parameter Description: Agreement PartyVInfo 1942 o Header Parameter Usage Location(s): JWE 1943 o Change Controller: IESG 1944 o Specification Document(s): Section 4.6.1.3 of [[ this document ]] 1946 o Header Parameter Name: "iv" 1947 o Header Parameter Description: Initialization Vector 1948 o Header Parameter Usage Location(s): JWE 1949 o Change Controller: IESG 1950 o Specification Document(s): Section 4.7.1.1 of [[ this document ]] 1952 o Header Parameter Name: "tag" 1953 o Header Parameter Description: Authentication Tag 1954 o Header Parameter Usage Location(s): JWE 1955 o Change Controller: IESG 1956 o Specification Document(s): Section 4.7.1.2 of [[ this document ]] 1958 o Header Parameter Name: "p2s" 1959 o Header Parameter Description: PBES2 salt 1960 o Header Parameter Usage Location(s): JWE 1961 o Change Controller: IESG 1962 o Specification Document(s): Section 4.8.1.1 of [[ this document ]] 1964 o Header Parameter Name: "p2c" 1965 o Header Parameter Description: PBES2 count 1966 o Header Parameter Usage Location(s): JWE 1967 o Change Controller: IESG 1968 o Specification Document(s): Section 4.8.1.2 of [[ this document ]] 1970 7.3. JSON Web Encryption Compression Algorithms Registry 1972 This specification establishes the IANA JSON Web Encryption 1973 Compression Algorithms registry for JWE "zip" member values. The 1974 registry records the compression algorithm value and a reference to 1975 the specification that defines it. 1977 7.3.1. Registration Template 1978 Compression Algorithm Value: 1979 The name requested (e.g., "DEF"). Because a core goal of this 1980 specification is for the resulting representations to be compact, 1981 it is RECOMMENDED that the name be short -- not to exceed 8 1982 characters without a compelling reason to do so. This name is 1983 case-sensitive. Names may not match other registered names in a 1984 case-insensitive manner unless the Designated Expert(s) state that 1985 there is a compelling reason to allow an exception in this 1986 particular case. 1988 Compression Algorithm Description: 1989 Brief description of the compression algorithm (e.g., "DEFLATE"). 1991 Change Controller: 1992 For Standards Track RFCs, state "IESG". For others, give the name 1993 of the responsible party. Other details (e.g., postal address, 1994 email address, home page URI) may also be included. 1996 Specification Document(s): 1997 Reference to the document(s) that specify the parameter, 1998 preferably including URI(s) that can be used to retrieve copies of 1999 the document(s). An indication of the relevant sections may also 2000 be included but is not required. 2002 7.3.2. Initial Registry Contents 2004 o Compression Algorithm Value: "DEF" 2005 o Compression Algorithm Description: DEFLATE 2006 o Change Controller: IESG 2007 o Specification Document(s): JSON Web Encryption (JWE) [JWE] 2009 7.4. JSON Web Key Types Registry 2011 This specification establishes the IANA JSON Web Key Types registry 2012 for values of the JWK "kty" (key type) parameter. The registry 2013 records the "kty" value, implementation requirements, and a reference 2014 to the specification that defines it. 2016 The implementation requirements of a key type may be changed over 2017 time as the cryptographic landscape evolves, for instance, to change 2018 the status of a key type to Deprecated, or to change the status of a 2019 key type from Optional to Recommended+ or Required. Changes of 2020 implementation requirements are only permitted on a Specification 2021 Required basis after review by the Designated Experts(s), with the 2022 new specification defining the revised implementation requirements 2023 level. 2025 7.4.1. Registration Template 2027 "kty" Parameter Value: 2028 The name requested (e.g., "EC"). Because a core goal of this 2029 specification is for the resulting representations to be compact, 2030 it is RECOMMENDED that the name be short -- not to exceed 8 2031 characters without a compelling reason to do so. This name is 2032 case-sensitive. Names may not match other registered names in a 2033 case-insensitive manner unless the Designated Expert(s) state that 2034 there is a compelling reason to allow an exception in this 2035 particular case. 2037 Key Type Description: 2038 Brief description of the Key Type (e.g., "Elliptic Curve"). 2040 Change Controller: 2041 For Standards Track RFCs, state "IESG". For others, give the name 2042 of the responsible party. Other details (e.g., postal address, 2043 email address, home page URI) may also be included. 2045 JOSE Implementation Requirements: 2046 The key type implementation requirements for JWS and JWE, which 2047 must be one the words Required, Recommended, Optional, Deprecated, 2048 or Prohibited. Optionally, the word can be followed by a "+" or 2049 "-". The use of "+" indicates that the requirement strength is 2050 likely to be increased in a future version of the specification. 2051 The use of "-" indicates that the requirement strength is likely 2052 to be decreased in a future version of the specification. 2054 Specification Document(s): 2055 Reference to the document(s) that specify the parameter, 2056 preferably including URI(s) that can be used to retrieve copies of 2057 the document(s). An indication of the relevant sections may also 2058 be included but is not required. 2060 7.4.2. Initial Registry Contents 2062 This specification registers the values defined in Section 6.1. 2064 o "kty" Parameter Value: "EC" 2065 o Key Type Description: Elliptic Curve 2066 o JOSE Implementation Requirements: Recommended+ 2067 o Change Controller: IESG 2068 o Specification Document(s): Section 6.2 of [[ this document ]] 2070 o "kty" Parameter Value: "RSA" 2071 o Key Type Description: RSA 2072 o JOSE Implementation Requirements: Required 2073 o Change Controller: IESG 2074 o Specification Document(s): Section 6.3 of [[ this document ]] 2076 o "kty" Parameter Value: "oct" 2077 o Key Type Description: Octet sequence 2078 o JOSE Implementation Requirements: Required 2079 o Change Controller: IESG 2080 o Specification Document(s): Section 6.4 of [[ this document ]] 2082 7.5. JSON Web Key Parameters Registration 2084 This specification registers the parameter names defined in Sections 2085 6.2, 6.3, and 6.4 in the IANA JSON Web Key Parameters registry 2086 defined in [JWK]. 2088 7.5.1. Registry Contents 2090 o Parameter Name: "crv" 2091 o Parameter Description: Curve 2092 o Used with "kty" Value(s): "EC" 2093 o Parameter Information Class: Public 2094 o Change Controller: IESG 2095 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2097 o Parameter Name: "x" 2098 o Parameter Description: X Coordinate 2099 o Used with "kty" Value(s): "EC" 2100 o Parameter Information Class: Public 2101 o Change Controller: IESG 2102 o Specification Document(s): Section 6.2.1.2 of [[ this document ]] 2104 o Parameter Name: "y" 2105 o Parameter Description: Y Coordinate 2106 o Used with "kty" Value(s): "EC" 2107 o Parameter Information Class: Public 2108 o Change Controller: IESG 2109 o Specification Document(s): Section 6.2.1.3 of [[ this document ]] 2111 o Parameter Name: "d" 2112 o Parameter Description: ECC Private Key 2113 o Used with "kty" Value(s): "EC" 2114 o Parameter Information Class: Private 2115 o Change Controller: IESG 2116 o Specification Document(s): Section 6.2.2.1 of [[ this document ]] 2117 o Parameter Name: "n" 2118 o Parameter Description: Modulus 2119 o Used with "kty" Value(s): "RSA" 2120 o Parameter Information Class: Public 2121 o Change Controller: IESG 2122 o Specification Document(s): Section 6.3.1.1 of [[ this document ]] 2124 o Parameter Name: "e" 2125 o Parameter Description: Exponent 2126 o Used with "kty" Value(s): "RSA" 2127 o Parameter Information Class: Public 2128 o Change Controller: IESG 2129 o Specification Document(s): Section 6.3.1.2 of [[ this document ]] 2131 o Parameter Name: "d" 2132 o Parameter Description: Private Exponent 2133 o Used with "kty" Value(s): "RSA" 2134 o Parameter Information Class: Private 2135 o Change Controller: IESG 2136 o Specification Document(s): Section 6.3.2.1 of [[ this document ]] 2138 o Parameter Name: "p" 2139 o Parameter Description: First Prime Factor 2140 o Used with "kty" Value(s): "RSA" 2141 o Parameter Information Class: Private 2142 o Change Controller: IESG 2143 o Specification Document(s): Section 6.3.2.2 of [[ this document ]] 2145 o Parameter Name: "q" 2146 o Parameter Description: Second Prime Factor 2147 o Used with "kty" Value(s): "RSA" 2148 o Parameter Information Class: Private 2149 o Change Controller: IESG 2150 o Specification Document(s): Section 6.3.2.3 of [[ this document ]] 2152 o Parameter Name: "dp" 2153 o Parameter Description: First Factor CRT Exponent 2154 o Used with "kty" Value(s): "RSA" 2155 o Parameter Information Class: Private 2156 o Change Controller: IESG 2157 o Specification Document(s): Section 6.3.2.4 of [[ this document ]] 2159 o Parameter Name: "dq" 2160 o Parameter Description: Second Factor CRT Exponent 2161 o Used with "kty" Value(s): "RSA" 2162 o Parameter Information Class: Private 2163 o Change Controller: IESG 2164 o Specification Document(s): Section 6.3.2.5 of [[ this document ]] 2166 o Parameter Name: "qi" 2167 o Parameter Description: First CRT Coefficient 2168 o Used with "kty" Value(s): "RSA" 2169 o Parameter Information Class: Private 2170 o Change Controller: IESG 2171 o Specification Document(s): Section 6.3.2.6 of [[ this document ]] 2173 o Parameter Name: "oth" 2174 o Parameter Description: Other Primes Info 2175 o Used with "kty" Value(s): "RSA" 2176 o Parameter Information Class: Private 2177 o Change Controller: IESG 2178 o Specification Document(s): Section 6.3.2.7 of [[ this document ]] 2180 o Parameter Name: "k" 2181 o Parameter Description: Key Value 2182 o Used with "kty" Value(s): "oct" 2183 o Parameter Information Class: Private 2184 o Change Controller: IESG 2185 o Specification Document(s): Section 6.4.1 of [[ this document ]] 2187 7.6. JSON Web Key Elliptic Curve Registry 2189 This specification establishes the IANA JSON Web Key Elliptic Curve 2190 registry for JWK "crv" member values. The registry records the curve 2191 name, implementation requirements, and a reference to the 2192 specification that defines it. This specification registers the 2193 parameter names defined in Section 6.2.1.1. 2195 The implementation requirements of a curve may be changed over time 2196 as the cryptographic landscape evolves, for instance, to change the 2197 status of a curve to Deprecated, or to change the status of a curve 2198 from Optional to Recommended+ or Required. Changes of implementation 2199 requirements are only permitted on a Specification Required basis 2200 after review by the Designated Experts(s), with the new specification 2201 defining the revised implementation requirements level. 2203 7.6.1. Registration Template 2205 Curve Name: 2206 The name requested (e.g., "P-256"). Because a core goal of this 2207 specification is for the resulting representations to be compact, 2208 it is RECOMMENDED that the name be short -- not to exceed 8 2209 characters without a compelling reason to do so. This name is 2210 case-sensitive. Names may not match other registered names in a 2211 case-insensitive manner unless the Designated Expert(s) state that 2212 there is a compelling reason to allow an exception in this 2213 particular case. 2215 Curve Description: 2216 Brief description of the curve (e.g., "P-256 curve"). 2218 JOSE Implementation Requirements: 2219 The curve implementation requirements for JWS and JWE, which must 2220 be one the words Required, Recommended, Optional, Deprecated, or 2221 Prohibited. Optionally, the word can be followed by a "+" or "-". 2222 The use of "+" indicates that the requirement strength is likely 2223 to be increased in a future version of the specification. The use 2224 of "-" indicates that the requirement strength is likely to be 2225 decreased in a future version of the specification. 2227 Change Controller: 2228 For Standards Track RFCs, state "IESG". For others, give the name 2229 of the responsible party. Other details (e.g., postal address, 2230 email address, home page URI) may also be included. 2232 Specification Document(s): 2233 Reference to the document(s) that specify the parameter, 2234 preferably including URI(s) that can be used to retrieve copies of 2235 the document(s). An indication of the relevant sections may also 2236 be included but is not required. 2238 7.6.2. Initial Registry Contents 2240 o Curve Name: "P-256" 2241 o Curve Description: P-256 curve 2242 o JOSE Implementation Requirements: Recommended+ 2243 o Change Controller: IESG 2244 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2246 o Curve Name: "P-384" 2247 o Curve Description: P-384 curve 2248 o JOSE Implementation Requirements: Optional 2249 o Change Controller: IESG 2250 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2252 o Curve Name: "P-521" 2253 o Curve Description: P-521 curve 2254 o JOSE Implementation Requirements: Optional 2255 o Change Controller: IESG 2256 o Specification Document(s): Section 6.2.1.1 of [[ this document ]] 2258 8. Security Considerations 2260 All of the security issues that are pertinent to any cryptographic 2261 application must be addressed by JWS/JWE/JWK agents. Among these 2262 issues are protecting the user's asymmetric private and symmetric 2263 secret keys and employing countermeasures to various attacks. 2265 The security considerations in [AES], [DSS], [JWE], [JWK], [JWS], 2266 [NIST.800-38D], [NIST.800-56A], [NIST.800-107], [RFC2104], [RFC3394], 2267 [RFC3447], [RFC5116], [RFC6090], and [SHS] apply to this 2268 specification. 2270 8.1. Cryptographic Agility 2272 Implementers should be aware that cryptographic algorithms become 2273 weaker with time. As new cryptanalysis techniques are developed and 2274 computing performance improves, the work factor to break a particular 2275 cryptographic algorithm will be reduced. Therefore, implementers and 2276 deployments must be prepared for the set of algorithms that are 2277 supported and used to change over time. Thus, cryptographic 2278 algorithm implementations should be modular, allowing new algorithms 2279 to be readily inserted. 2281 8.2. Key Lifetimes 2283 Many algorithms have associated security considerations related to 2284 key lifetimes and/or the number of times that a key may be used. 2285 Those security considerations continue to apply when using those 2286 algorithms with JOSE data structures. See NIST SP 800-57 2287 [NIST.800-57] for specific guidance on key lifetimes. 2289 8.3. RSAES-PKCS1-v1_5 Security Considerations 2291 While Section 8 of RFC 3447 [RFC3447] explicitly calls for people not 2292 to adopt RSASSA-PKCS-v1_5 for new applications and instead requests 2293 that people transition to RSASSA-PSS, this specification does include 2294 RSASSA-PKCS-v1_5, for interoperability reasons, because it is 2295 commonly implemented. 2297 Keys used with RSAES-PKCS1-v1_5 must follow the constraints in 2298 Section 7.2 of RFC 3447. Also, keys with a low public key exponent 2299 value, as described in Section 3 of Twenty years of attacks on the 2300 RSA cryptosystem [Boneh99], must not be used. 2302 8.4. AES GCM Security Considerations 2304 Keys used with AES GCM must follow the constraints in Section 8.3 of 2305 [NIST.800-38D], which states: "The total number of invocations of the 2306 authenticated encryption function shall not exceed 2^32, including 2307 all IV lengths and all instances of the authenticated encryption 2308 function with the given key". In accordance with this rule, AES GCM 2309 MUST NOT be used with the same key value more than 2^32 times. 2311 An Initialization Vector value MUST NOT ever be used multiple times 2312 with the same AES GCM key. One way to prevent this is to store a 2313 counter with the key and increment it with every use. The counter 2314 can also be used to prevent exceeding the 2^32 limit above. 2316 This security consideration does not apply to the composite AES-CBC 2317 HMAC SHA-2 or AES Key Wrap algorithms. 2319 8.5. Unsecured JWS Security Considerations 2321 Unsecured JWSs (JWSs that use the "alg" value "none") provide no 2322 integrity protection. Thus, they must only be used in contexts in 2323 which the payload is secured by means other than a digital signature 2324 or MAC value, or need not be secured. 2326 An example means of preventing accepting Unsecured JWSs by default is 2327 for the "verify" method of a hypothetical JWS software library to 2328 have a Boolean "acceptUnsecured" parameter that indicates "none" is 2329 an acceptable "alg" value. As another example, the "verify" method 2330 might take a list of algorithms that are acceptable to the 2331 application as a parameter and would reject Unsecured JWS values if 2332 "none" is not in that list. 2334 The following example illustrates the reasons for not accepting 2335 Unsecured JWSs at a global level. Suppose an application accepts 2336 JWSs over two channels, (1) HTTP and (2) HTTPS with client 2337 authentication. It requires a JWS signature on objects received over 2338 HTTP, but accepts Unsecured JWSs over HTTPS. If the application were 2339 to globally indicate that "none" is acceptable, then an attacker 2340 could provide it with an Unsecured JWS over HTTP and still have that 2341 object successfully validate. Instead, the application needs to 2342 indicate acceptance of "none" for each object received over HTTPS 2343 (e.g., by setting "acceptUnsecured" to "true" for the first 2344 hypothetical JWS software library above), but not for each object 2345 received over HTTP. 2347 8.6. Denial of Service Attacks 2349 Receiving agents that validate signatures and sending agents that 2350 encrypt messages need to be cautious of cryptographic processing 2351 usage when validating signatures and encrypting messages using keys 2352 larger than those mandated in this specification. An attacker could 2353 supply content using keys that would result in excessive 2354 cryptographic processing, for example, keys larger than those 2355 mandated in this specification. Implementations should set and 2356 enforce upper limits on the key sizes they accept. Section 5.6.1 2357 (Comparable Algorithm Strengths) of NIST SP 800-57 [NIST.800-57] 2358 contains statements on largest approved key sizes that may be 2359 applicable. 2361 8.7. Reusing Key Material when Encrypting Keys 2363 It is NOT RECOMMENDED to reuse the same entire set of key material 2364 (Key Encryption Key, Content Encryption Key, Initialization Vector, 2365 etc.) to encrypt multiple JWK or JWK Set objects, or to encrypt the 2366 same JWK or JWK Set object multiple times. One suggestion for 2367 preventing re-use is to always generate at least one new piece of key 2368 material for each encryption operation (e.g., a new Content 2369 Encryption Key, a new Initialization Vector, and/or a new PBES2 2370 Salt), based on the considerations noted in this document as well as 2371 from RFC 4086 [RFC4086]. 2373 8.8. Password Considerations 2375 Passwords are vulnerable to a number of attacks. To help mitigate 2376 some of these limitations, this document applies principles from RFC 2377 2898 [RFC2898] to derive cryptographic keys from user-supplied 2378 passwords. 2380 However, the strength of the password still has a significant impact. 2381 A high-entropy password has greater resistance to dictionary attacks. 2382 [NIST.800-63-1] contains guidelines for estimating password entropy, 2383 which can help applications and users generate stronger passwords. 2385 An ideal password is one that is as large as (or larger than) the 2386 derived key length. However, passwords larger than a certain 2387 algorithm-specific size are first hashed, which reduces an attacker's 2388 effective search space to the length of the hash algorithm. It is 2389 RECOMMENDED that a password used for "PBES2-HS256+A128KW" be no 2390 shorter than 16 octets and no longer than 128 octets and a password 2391 used for "PBES2-HS512+A256KW" be no shorter than 32 octets and no 2392 longer than 128 octets long. 2394 Still, care needs to be taken in where and how password-based 2395 encryption is used. These algorithms can still be susceptible to 2396 dictionary-based attacks if the iteration count is too small; this is 2397 of particular concern if these algorithms are used to protect data 2398 that an attacker can have indefinite number of attempts to circumvent 2399 the protection, such as protected data stored on a file system. 2401 8.9. Key Entropy and Random Values 2403 See Section 10.1 of [JWS] for security considerations on key entropy 2404 and random values. 2406 8.10. Differences between Digital Signatures and MACs 2408 See Section 10.5 of [JWS] for security considerations on differences 2409 between digital signatures and MACs. 2411 8.11. Using Matching Algorithm Strengths 2413 See Section 11.3 of [JWE] for security considerations on using 2414 matching algorithm strengths. 2416 8.12. Adaptive Chosen-Ciphertext Attacks 2418 See Section 11.4 of [JWE] for security considerations on adaptive 2419 chosen-ciphertext attacks. 2421 8.13. Timing Attacks 2423 See Section 10.9 of [JWS] and Section 11.5 of [JWE] for security 2424 considerations on timing attacks. 2426 8.14. RSA Private Key Representations and Blinding 2428 See Section 9.3 of [JWK] for security considerations on RSA private 2429 key representations and blinding. 2431 9. Internationalization Considerations 2433 Passwords obtained from users are likely to require preparation and 2434 normalization to account for differences of octet sequences generated 2435 by different input devices, locales, etc. It is RECOMMENDED that 2436 applications to perform the steps outlined in 2437 [I-D.ietf-precis-saslprepbis] to prepare a password supplied directly 2438 by a user before performing key derivation and encryption. 2440 10. References 2442 10.1. Normative References 2444 [AES] National Institute of Standards and Technology (NIST), 2445 "Advanced Encryption Standard (AES)", FIPS PUB 197, 2446 November 2001. 2448 [Boneh99] "Twenty years of attacks on the RSA cryptosystem", Notices 2449 of the American Mathematical Society (AMS), Vol. 46, No. 2450 2, pp. 203-213 http://crypto.stanford.edu/~dabo/pubs/ 2451 papers/RSA-survey.pdf, 1999. 2453 [DSS] National Institute of Standards and Technology, "Digital 2454 Signature Standard (DSS)", FIPS PUB 186-4, July 2013. 2456 [JWE] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", 2457 draft-ietf-jose-json-web-encryption (work in progress), 2458 January 2015. 2460 [JWK] Jones, M., "JSON Web Key (JWK)", 2461 draft-ietf-jose-json-web-key (work in progress), 2462 January 2015. 2464 [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 2465 Signature (JWS)", draft-ietf-jose-json-web-signature (work 2466 in progress), January 2015. 2468 [NIST.800-38A] 2469 National Institute of Standards and Technology (NIST), 2470 "Recommendation for Block Cipher Modes of Operation", 2471 NIST PUB 800-38A, December 2001. 2473 [NIST.800-38D] 2474 National Institute of Standards and Technology (NIST), 2475 "Recommendation for Block Cipher Modes of Operation: 2476 Galois/Counter Mode (GCM) and GMAC", NIST PUB 800-38D, 2477 December 2001. 2479 [NIST.800-56A] 2480 National Institute of Standards and Technology (NIST), 2481 "Recommendation for Pair-Wise Key Establishment Schemes 2482 Using Discrete Logarithm Cryptography", NIST Special 2483 Publication 800-56A, Revision 2, May 2013. 2485 [NIST.800-57] 2486 National Institute of Standards and Technology (NIST), 2487 "Recommendation for Key Management - Part 1: General 2488 (Revision 3)", NIST Special Publication 800-57, Part 1, 2489 Revision 3, July 2012. 2491 [RFC20] Cerf, V., "ASCII format for Network Interchange", RFC 20, 2492 October 1969. 2494 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 2495 Hashing for Message Authentication", RFC 2104, 2496 February 1997. 2498 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2499 Requirement Levels", BCP 14, RFC 2119, March 1997. 2501 [RFC2898] Kaliski, B., "PKCS #5: Password-Based Cryptography 2502 Specification Version 2.0", RFC 2898, September 2000. 2504 [RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard 2505 (AES) Key Wrap Algorithm", RFC 3394, September 2002. 2507 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 2508 Standards (PKCS) #1: RSA Cryptography Specifications 2509 Version 2.1", RFC 3447, February 2003. 2511 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2512 10646", STD 63, RFC 3629, November 2003. 2514 [RFC4868] Kelly, S. and S. Frankel, "Using HMAC-SHA-256, HMAC-SHA- 2515 384, and HMAC-SHA-512 with IPsec", RFC 4868, May 2007. 2517 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2518 RFC 4949, August 2007. 2520 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 2521 RFC 5652, September 2009. 2523 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 2524 Curve Cryptography Algorithms", RFC 6090, February 2011. 2526 [RFC7159] Bray, T., "The JavaScript Object Notation (JSON) Data 2527 Interchange Format", RFC 7159, March 2014. 2529 [SEC1] Standards for Efficient Cryptography Group, "SEC 1: 2530 Elliptic Curve Cryptography", Version 2.0, May 2009. 2532 [SHS] National Institute of Standards and Technology, "Secure 2533 Hash Standard (SHS)", FIPS PUB 180-4, March 2012. 2535 [UNICODE] The Unicode Consortium, "The Unicode Standard", 1991-, 2536 . 2538 10.2. Informative References 2540 [CanvasApp] 2541 Facebook, "Canvas Applications", 2010. 2543 [I-D.ietf-precis-saslprepbis] 2544 Saint-Andre, P. and A. Melnikov, "Preparation, 2545 Enforcement, and Comparison of Internationalized Strings 2546 Representing Usernames and Passwords", 2547 draft-ietf-precis-saslprepbis-13 (work in progress), 2548 December 2014. 2550 [I-D.mcgrew-aead-aes-cbc-hmac-sha2] 2551 McGrew, D., Foley, J., and K. Paterson, "Authenticated 2552 Encryption with AES-CBC and HMAC-SHA", 2553 draft-mcgrew-aead-aes-cbc-hmac-sha2-05 (work in progress), 2554 July 2014. 2556 [I-D.miller-jose-jwe-protected-jwk] 2557 Miller, M., "Using JavaScript Object Notation (JSON) Web 2558 Encryption (JWE) for Protecting JSON Web Key (JWK) 2559 Objects", draft-miller-jose-jwe-protected-jwk-02 (work in 2560 progress), June 2013. 2562 [I-D.rescorla-jsms] 2563 Rescorla, E. and J. Hildebrand, "JavaScript Message 2564 Security Format", draft-rescorla-jsms-00 (work in 2565 progress), March 2011. 2567 [JCA] Oracle, "Java Cryptography Architecture (JCA) Reference 2568 Guide", 2014. 2570 [JSE] Bradley, J. and N. Sakimura (editor), "JSON Simple 2571 Encryption", September 2010. 2573 [JSS] Bradley, J. and N. Sakimura (editor), "JSON Simple Sign", 2574 September 2010. 2576 [MagicSignatures] 2577 Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic 2578 Signatures", January 2011. 2580 [NIST.800-107] 2581 National Institute of Standards and Technology (NIST), 2582 "Recommendation for Applications Using Approved Hash 2583 Algorithms", NIST Special Publication 800-107, Revision 1, 2584 August 2012. 2586 [NIST.800-63-1] 2587 National Institute of Standards and Technology (NIST), 2588 "Electronic Authentication Guideline", NIST Special 2589 Publication 800-63-1, December 2011. 2591 [RFC2631] Rescorla, E., "Diffie-Hellman Key Agreement Method", 2592 RFC 2631, June 1999. 2594 [RFC3275] Eastlake, D., Reagle, J., and D. Solo, "(Extensible Markup 2595 Language) XML-Signature Syntax and Processing", RFC 3275, 2596 March 2002. 2598 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 2599 Requirements for Security", BCP 106, RFC 4086, June 2005. 2601 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 2602 Encryption", RFC 5116, January 2008. 2604 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2605 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2606 May 2008. 2608 [W3C.NOTE-xmldsig-core2-20130411] 2609 Eastlake, D., Reagle, J., Solo, D., Hirsch, F., Roessler, 2610 T., Yiu, K., Datta, P., and S. Cantor, "XML Signature 2611 Syntax and Processing Version 2.0", World Wide Web 2612 Consortium Note NOTE-xmldsig-core2-20130411, April 2013, 2613 . 2615 [W3C.REC-xmlenc-core-20021210] 2616 Eastlake, D. and J. Reagle, "XML Encryption Syntax and 2617 Processing", World Wide Web Consortium Recommendation REC- 2618 xmlenc-core-20021210, December 2002, 2619 . 2621 [W3C.REC-xmlenc-core1-20130411] 2622 Eastlake, D., Reagle, J., Hirsch, F., and T. Roessler, 2623 "XML Encryption Syntax and Processing Version 1.1", World 2624 Wide Web Consortium Recommendation REC-xmlenc-core1- 2625 20130411, April 2013, 2626 . 2628 Appendix A. Algorithm Identifier Cross-Reference 2630 This appendix contains tables cross-referencing the cryptographic 2631 algorithm identifier values defined in this specification with the 2632 equivalent identifiers used by other standards and software packages. 2633 See XML DSIG [RFC3275], XML DSIG 2.0 2634 [W3C.NOTE-xmldsig-core2-20130411], XML Encryption 2635 [W3C.REC-xmlenc-core-20021210], XML Encryption 1.1 2636 [W3C.REC-xmlenc-core1-20130411], and Java Cryptography Architecture 2637 [JCA] for more information about the names defined by those 2638 documents. 2640 A.1. Digital Signature/MAC Algorithm Identifier Cross-Reference 2642 This section contains a table cross-referencing the JWS digital 2643 signature and MAC "alg" (algorithm) values defined in this 2644 specification with the equivalent identifiers used by other standards 2645 and software packages. 2647 +-------+------------------------------+-------------+--------------+ 2648 | JWS | XML DSIG | JCA | OID | 2649 +-------+------------------------------+-------------+--------------+ 2650 | HS256 | http://www.w3.org/2001/04/xm | HmacSHA256 | 1.2.840.1135 | 2651 | | ldsig-more#hmac-sha256 | | 49.2.9 | 2652 | HS384 | http://www.w3.org/2001/04/xm | HmacSHA384 | 1.2.840.1135 | 2653 | | ldsig-more#hmac-sha384 | | 49.2.10 | 2654 | HS512 | http://www.w3.org/2001/04/xm | HmacSHA512 | 1.2.840.1135 | 2655 | | ldsig-more#hmac-sha512 | | 49.2.11 | 2656 | RS256 | http://www.w3.org/2001/04/xm | SHA256withR | 1.2.840.1135 | 2657 | | ldsig-more#rsa-sha256 | SA | 49.1.1.11 | 2658 | RS384 | http://www.w3.org/2001/04/xm | SHA384withR | 1.2.840.1135 | 2659 | | ldsig-more#rsa-sha384 | SA | 49.1.1.12 | 2660 | RS512 | http://www.w3.org/2001/04/xm | SHA512withR | 1.2.840.1135 | 2661 | | ldsig-more#rsa-sha512 | SA | 49.1.1.13 | 2662 | ES256 | http://www.w3.org/2001/04/xm | SHA256withE | 1.2.840.1004 | 2663 | | ldsig-more#ecdsa-sha256 | CDSA | 5.4.3.2 | 2664 | ES384 | http://www.w3.org/2001/04/xm | SHA384withE | 1.2.840.1004 | 2665 | | ldsig-more#ecdsa-sha384 | CDSA | 5.4.3.3 | 2666 | ES512 | http://www.w3.org/2001/04/xm | SHA512withE | 1.2.840.1004 | 2667 | | ldsig-more#ecdsa-sha512 | CDSA | 5.4.3.4 | 2668 | PS256 | http://www.w3.org/2007/05/xm | SHA256withR | 1.2.840.1135 | 2669 | | ldsig-more#sha256-rsa-MGF1 | SAandMGF1 | 49.1.1.10 | 2670 | PS384 | http://www.w3.org/2007/05/xm | SHA384withR | 1.2.840.1135 | 2671 | | ldsig-more#sha384-rsa-MGF1 | SAandMGF1 | 49.1.1.10 | 2672 | PS512 | http://www.w3.org/2007/05/xm | SHA512withR | 1.2.840.1135 | 2673 | | ldsig-more#sha512-rsa-MGF1 | SAandMGF1 | 49.1.1.10 | 2674 +-------+------------------------------+-------------+--------------+ 2676 A.2. Key Management Algorithm Identifier Cross-Reference 2678 This section contains a table cross-referencing the JWE "alg" 2679 (algorithm) values defined in this specification with the equivalent 2680 identifiers used by other standards and software packages. 2682 +----------+----------------------+-------------------+-------------+ 2683 | JWE | XML ENC | JCA | OID | 2684 +----------+----------------------+-------------------+-------------+ 2685 | RSA1_5 | http://www.w3.org/20 | RSA/ECB/PKCS1Padd | 1.2.840.113 | 2686 | | 01/04/xmlenc#rsa-1_5 | ing | 549.1.1.1 | 2687 | RSA-OAEP | http://www.w3.org/20 | RSA/ECB/OAEPWithS | 1.2.840.113 | 2688 | | 01/04/xmlenc#rsa-oae | HA-1AndMGF1Paddin | 549.1.1.7 | 2689 | | p-mgf1p | g | | 2690 | RSA-OAEP | http://www.w3.org/20 | RSA/ECB/OAEPWithS | 1.2.840.113 | 2691 | -256 | 09/xmlenc11#rsa-oaep | HA-256AndMGF1Padd | 549.1.1.7 | 2692 | | & | ing & | | 2693 | | http://www.w3.org/2 | MGF1ParameterSp | | 2694 | | 009/xmlenc11#mgf1sha | ec.SHA256 | | 2695 | | 256 | | | 2696 | ECDH-ES | http://www.w3.org/20 | ECDH | 1.3.132.1.1 | 2697 | | 09/xmlenc11#ECDH-ES | | 2 | 2698 | A128KW | http://www.w3.org/20 | AESWrap | 2.16.840.1. | 2699 | | 01/04/xmlenc#kw-aes1 | | 101.3.4.1.5 | 2700 | | 28 | | | 2701 | A192KW | http://www.w3.org/20 | AESWrap | 2.16.840.1. | 2702 | | 01/04/xmlenc#kw-aes1 | | 101.3.4.1.2 | 2703 | | 92 | | 5 | 2704 | A256KW | http://www.w3.org/20 | AESWrap | 2.16.840.1. | 2705 | | 01/04/xmlenc#kw-aes2 | | 101.3.4.1.4 | 2706 | | 56 | | 5 | 2707 +----------+----------------------+-------------------+-------------+ 2709 A.3. Content Encryption Algorithm Identifier Cross-Reference 2711 This section contains a table cross-referencing the JWE "enc" 2712 (encryption algorithm) values defined in this specification with the 2713 equivalent identifiers used by other standards and software packages. 2715 For the composite algorithms "A128CBC-HS256", "A192CBC-HS384", and 2716 "A256CBC-HS512", the corresponding AES CBC algorithm identifiers are 2717 listed. 2719 +----------+-------------------------+--------------+---------------+ 2720 | JWE | XML ENC | JCA | OID | 2721 +----------+-------------------------+--------------+---------------+ 2722 | A128CBC- | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.10 | 2723 | HS256 | 04/xmlenc#aes128-cbc | 5Padding | 1.3.4.1.2 | 2724 | A192CBC- | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.10 | 2725 | HS384 | 04/xmlenc#aes192-cbc | 5Padding | 1.3.4.1.22 | 2726 | A256CBC- | http://www.w3.org/2001/ | AES/CBC/PKCS | 2.16.840.1.10 | 2727 | HS512 | 04/xmlenc#aes256-cbc | 5Padding | 1.3.4.1.42 | 2728 | A128GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.10 | 2729 | | xmlenc11#aes128-gcm | dding | 1.3.4.1.6 | 2730 | A192GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.10 | 2731 | | xmlenc11#aes192-gcm | dding | 1.3.4.1.26 | 2732 | A256GCM | http://www.w3.org/2009/ | AES/GCM/NoPa | 2.16.840.1.10 | 2733 | | xmlenc11#aes256-gcm | dding | 1.3.4.1.46 | 2734 +----------+-------------------------+--------------+---------------+ 2736 Appendix B. Test Cases for AES_CBC_HMAC_SHA2 Algorithms 2738 The following test cases can be used to validate implementations of 2739 the AES_CBC_HMAC_SHA2 algorithms defined in Section 5.2. They are 2740 also intended to correspond to test cases that may appear in a future 2741 version of [I-D.mcgrew-aead-aes-cbc-hmac-sha2], demonstrating that 2742 the cryptographic computations performed are the same. 2744 The variable names are those defined in Section 5.2. All values are 2745 hexadecimal. 2747 B.1. Test Cases for AES_128_CBC_HMAC_SHA_256 2749 AES_128_CBC_HMAC_SHA_256 2751 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2752 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2754 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2756 ENC_KEY = 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2758 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2759 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2760 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2761 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2762 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2763 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2764 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2765 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2767 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2769 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2770 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2771 4b 65 72 63 6b 68 6f 66 66 73 2773 AL = 00 00 00 00 00 00 01 50 2775 E = c8 0e df a3 2d df 39 d5 ef 00 c0 b4 68 83 42 79 2776 a2 e4 6a 1b 80 49 f7 92 f7 6b fe 54 b9 03 a9 c9 2777 a9 4a c9 b4 7a d2 65 5c 5f 10 f9 ae f7 14 27 e2 2778 fc 6f 9b 3f 39 9a 22 14 89 f1 63 62 c7 03 23 36 2779 09 d4 5a c6 98 64 e3 32 1c f8 29 35 ac 40 96 c8 2780 6e 13 33 14 c5 40 19 e8 ca 79 80 df a4 b9 cf 1b 2781 38 4c 48 6f 3a 54 c5 10 78 15 8e e5 d7 9d e5 9f 2782 bd 34 d8 48 b3 d6 95 50 a6 76 46 34 44 27 ad e5 2783 4b 88 51 ff b5 98 f7 f8 00 74 b9 47 3c 82 e2 db 2785 M = 65 2c 3f a3 6b 0a 7c 5b 32 19 fa b3 a3 0b c1 c4 2786 e6 e5 45 82 47 65 15 f0 ad 9f 75 a2 b7 1c 73 ef 2788 T = 65 2c 3f a3 6b 0a 7c 5b 32 19 fa b3 a3 0b c1 c4 2790 B.2. Test Cases for AES_192_CBC_HMAC_SHA_384 2792 K = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2793 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2794 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2796 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2797 10 11 12 13 14 15 16 17 2799 ENC_KEY = 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 2800 28 29 2a 2b 2c 2d 2e 2f 2802 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2803 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2804 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2805 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2806 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2807 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2808 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2809 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2811 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2813 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2814 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2815 4b 65 72 63 6b 68 6f 66 66 73 2817 AL = 00 00 00 00 00 00 01 50 2819 E = ea 65 da 6b 59 e6 1e db 41 9b e6 2d 19 71 2a e5 2820 d3 03 ee b5 00 52 d0 df d6 69 7f 77 22 4c 8e db 2821 00 0d 27 9b dc 14 c1 07 26 54 bd 30 94 42 30 c6 2822 57 be d4 ca 0c 9f 4a 84 66 f2 2b 22 6d 17 46 21 2823 4b f8 cf c2 40 0a dd 9f 51 26 e4 79 66 3f c9 0b 2824 3b ed 78 7a 2f 0f fc bf 39 04 be 2a 64 1d 5c 21 2825 05 bf e5 91 ba e2 3b 1d 74 49 e5 32 ee f6 0a 9a 2826 c8 bb 6c 6b 01 d3 5d 49 78 7b cd 57 ef 48 49 27 2827 f2 80 ad c9 1a c0 c4 e7 9c 7b 11 ef c6 00 54 e3 2829 M = 84 90 ac 0e 58 94 9b fe 51 87 5d 73 3f 93 ac 20 2830 75 16 80 39 cc c7 33 d7 45 94 f8 86 b3 fa af d4 2831 86 f2 5c 71 31 e3 28 1e 36 c7 a2 d1 30 af de 57 2833 T = 84 90 ac 0e 58 94 9b fe 51 87 5d 73 3f 93 ac 20 2834 75 16 80 39 cc c7 33 d7 2836 B.3. Test Cases for AES_256_CBC_HMAC_SHA_512 2838 K = 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 2840 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2841 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 2843 MAC_KEY = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 2844 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 2846 ENC_KEY = 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2847 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 2849 P = 41 20 63 69 70 68 65 72 20 73 79 73 74 65 6d 20 2850 6d 75 73 74 20 6e 6f 74 20 62 65 20 72 65 71 75 2851 69 72 65 64 20 74 6f 20 62 65 20 73 65 63 72 65 2852 74 2c 20 61 6e 64 20 69 74 20 6d 75 73 74 20 62 2853 65 20 61 62 6c 65 20 74 6f 20 66 61 6c 6c 20 69 2854 6e 74 6f 20 74 68 65 20 68 61 6e 64 73 20 6f 66 2855 20 74 68 65 20 65 6e 65 6d 79 20 77 69 74 68 6f 2856 75 74 20 69 6e 63 6f 6e 76 65 6e 69 65 6e 63 65 2858 IV = 1a f3 8c 2d c2 b9 6f fd d8 66 94 09 23 41 bc 04 2860 A = 54 68 65 20 73 65 63 6f 6e 64 20 70 72 69 6e 63 2861 69 70 6c 65 20 6f 66 20 41 75 67 75 73 74 65 20 2862 4b 65 72 63 6b 68 6f 66 66 73 2864 AL = 00 00 00 00 00 00 01 50 2866 E = 4a ff aa ad b7 8c 31 c5 da 4b 1b 59 0d 10 ff bd 2867 3d d8 d5 d3 02 42 35 26 91 2d a0 37 ec bc c7 bd 2868 82 2c 30 1d d6 7c 37 3b cc b5 84 ad 3e 92 79 c2 2869 e6 d1 2a 13 74 b7 7f 07 75 53 df 82 94 10 44 6b 2870 36 eb d9 70 66 29 6a e6 42 7e a7 5c 2e 08 46 a1 2871 1a 09 cc f5 37 0d c8 0b fe cb ad 28 c7 3f 09 b3 2872 a3 b7 5e 66 2a 25 94 41 0a e4 96 b2 e2 e6 60 9e 2873 31 e6 e0 2c c8 37 f0 53 d2 1f 37 ff 4f 51 95 0b 2874 be 26 38 d0 9d d7 a4 93 09 30 80 6d 07 03 b1 f6 2876 M = 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 2878 fd 30 a5 65 c6 16 ff b2 f3 64 ba ec e6 8f c4 07 2879 53 bc fc 02 5d de 36 93 75 4a a1 f5 c3 37 3b 9c 2881 T = 4d d3 b4 c0 88 a7 f4 5c 21 68 39 64 5b 20 12 bf 2882 2e 62 69 a8 c5 6a 81 6d bc 1b 26 77 61 95 5b c5 2884 Appendix C. Example ECDH-ES Key Agreement Computation 2886 This example uses ECDH-ES Key Agreement and the Concat KDF to derive 2887 the Content Encryption Key (CEK) in the manner described in 2888 Section 4.6. In this example, the ECDH-ES Direct Key Agreement mode 2889 ("alg" value "ECDH-ES") is used to produce an agreed upon key for AES 2890 GCM with a 128 bit key ("enc" value "A128GCM"). 2892 In this example, a producer Alice is encrypting content to a consumer 2893 Bob. The producer (Alice) generates an ephemeral key for the key 2894 agreement computation. Alice's ephemeral key (in JWK format) used 2895 for the key agreement computation in this example (including the 2896 private part) is: 2898 {"kty":"EC", 2899 "crv":"P-256", 2900 "x":"gI0GAILBdu7T53akrFmMyGcsF3n5dO7MmwNBHKW5SV0", 2901 "y":"SLW_xSffzlPWrHEVI30DHM_4egVwt3NQqeUD7nMFpps", 2902 "d":"0_NxaRPUMQoAJt50Gz8YiTr8gRTwyEaCumd-MToTmIo" 2903 } 2905 The consumer's (Bob's) key (in JWK format) used for the key agreement 2906 computation in this example (including the private part) is: 2908 {"kty":"EC", 2909 "crv":"P-256", 2910 "x":"weNJy2HscCSM6AEDTDg04biOvhFhyyWvOHQfeF_PxMQ", 2911 "y":"e8lnCO-AlStT-NJVX-crhB7QRYhiix03illJOVAOyck", 2912 "d":"VEmDZpDXXK8p8N0Cndsxs924q6nS1RXFASRl6BfUqdw" 2913 } 2915 Header Parameter values used in this example are as follows. In this 2916 example, the "apu" (agreement PartyUInfo) parameter value is the 2917 base64url encoding of the UTF-8 string "Alice" and the "apv" 2918 (agreement PartyVInfo) parameter value is the base64url encoding of 2919 the UTF-8 string "Bob". The "epk" parameter is used to communicate 2920 the producer's (Alice's) ephemeral public key value to the consumer 2921 (Bob). 2923 {"alg":"ECDH-ES", 2924 "enc":"A128GCM", 2925 "apu":"QWxpY2U", 2926 "apv":"Qm9i", 2927 "epk": 2928 {"kty":"EC", 2929 "crv":"P-256", 2930 "x":"gI0GAILBdu7T53akrFmMyGcsF3n5dO7MmwNBHKW5SV0", 2931 "y":"SLW_xSffzlPWrHEVI30DHM_4egVwt3NQqeUD7nMFpps" 2932 } 2933 } 2935 The resulting Concat KDF [NIST.800-56A] parameter values are: 2937 Z 2938 This is set to the ECDH-ES key agreement output. (This value is 2939 often not directly exposed by libraries, due to NIST security 2940 requirements, and only serves as an input to a KDF.) In this 2941 example, Z is following the octet sequence (using JSON array 2942 notation): 2943 [158, 86, 217, 29, 129, 113, 53, 211, 114, 131, 66, 131, 191, 132, 2944 38, 156, 251, 49, 110, 163, 218, 128, 106, 72, 246, 218, 167, 121, 2945 140, 254, 144, 196]. 2947 keydatalen 2948 This value is 128 - the number of bits in the desired output key 2949 (because "A128GCM" uses a 128 bit key). 2951 AlgorithmID 2952 This is set to the octets representing the 32 bit big endian value 2953 7 - [0, 0, 0, 7] - the number of octets in the AlgorithmID content 2954 "A128GCM", followed, by the octets representing the ASCII string 2955 "A128GCM" - [65, 49, 50, 56, 71, 67, 77]. 2957 PartyUInfo 2958 This is set to the octets representing the 32 bit big endian value 2959 5 - [0, 0, 0, 5] - the number of octets in the PartyUInfo content 2960 "Alice", followed, by the octets representing the UTF-8 string 2961 "Alice" - [65, 108, 105, 99, 101]. 2963 PartyVInfo 2964 This is set to the octets representing the 32 bit big endian value 2965 3 - [0, 0, 0, 3] - the number of octets in the PartyUInfo content 2966 "Bob", followed, by the octets representing the UTF-8 string "Bob" 2967 - [66, 111, 98]. 2969 SuppPubInfo 2970 This is set to the octets representing the 32 bit big endian value 2971 128 - [0, 0, 0, 128] - the keydatalen value. 2973 SuppPrivInfo 2974 This is set to the empty octet sequence. 2976 Concatenating the parameters AlgorithmID through SuppPubInfo results 2977 in an OtherInfo value of: 2978 [0, 0, 0, 7, 65, 49, 50, 56, 71, 67, 77, 0, 0, 0, 5, 65, 108, 105, 2979 99, 101, 0, 0, 0, 3, 66, 111, 98, 0, 0, 0, 128] 2981 Concatenating the round number 1 ([0, 0, 0, 1]), Z, and the OtherInfo 2982 value results in the Concat KDF round 1 hash input of: 2983 [0, 0, 0, 1, 2984 158, 86, 217, 29, 129, 113, 53, 211, 114, 131, 66, 131, 191, 132, 38, 2985 156, 251, 49, 110, 163, 218, 128, 106, 72, 246, 218, 167, 121, 140, 2986 254, 144, 196, 2987 0, 0, 0, 7, 65, 49, 50, 56, 71, 67, 77, 0, 0, 0, 5, 65, 108, 105, 99, 2988 101, 0, 0, 0, 3, 66, 111, 98, 0, 0, 0, 128] 2990 The resulting derived key, which is the first 128 bits of the round 1 2991 hash output is: 2992 [86, 170, 141, 234, 248, 35, 109, 32, 92, 34, 40, 205, 113, 167, 16, 2993 26] 2995 The base64url encoded representation of this derived key is: 2997 VqqN6vgjbSBcIijNcacQGg 2999 Appendix D. Acknowledgements 3001 Solutions for signing and encrypting JSON content were previously 3002 explored by Magic Signatures [MagicSignatures], JSON Simple Sign 3003 [JSS], Canvas Applications [CanvasApp], JSON Simple Encryption [JSE], 3004 and JavaScript Message Security Format [I-D.rescorla-jsms], all of 3005 which influenced this draft. 3007 The Authenticated Encryption with AES-CBC and HMAC-SHA 3008 [I-D.mcgrew-aead-aes-cbc-hmac-sha2] specification, upon which the 3009 AES_CBC_HMAC_SHA2 algorithms are based, was written by David A. 3010 McGrew and Kenny Paterson. The test cases for AES_CBC_HMAC_SHA2 are 3011 based upon those for [I-D.mcgrew-aead-aes-cbc-hmac-sha2] by John 3012 Foley. 3014 Matt Miller wrote Using JavaScript Object Notation (JSON) Web 3015 Encryption (JWE) for Protecting JSON Web Key (JWK) Objects 3017 [I-D.miller-jose-jwe-protected-jwk], which the password-based 3018 encryption content of this draft is based upon. 3020 This specification is the work of the JOSE Working Group, which 3021 includes dozens of active and dedicated participants. In particular, 3022 the following individuals contributed ideas, feedback, and wording 3023 that influenced this specification: 3025 Dirk Balfanz, Richard Barnes, Carsten Bormann, John Bradley, Brian 3026 Campbell, Alissa Cooper, Breno de Medeiros, Vladimir Dzhuvinov, Roni 3027 Even, Stephen Farrell, Yaron Y. Goland, Dick Hardt, Joe Hildebrand, 3028 Jeff Hodges, Edmund Jay, Charlie Kaufman, Barry Leiba, James Manger, 3029 Matt Miller, Kathleen Moriarty, Tony Nadalin, Axel Nennker, John 3030 Panzer, Emmanuel Raviart, Eric Rescorla, Pete Resnick, Nat Sakimura, 3031 Jim Schaad, Hannes Tschofenig, and Sean Turner. 3033 Jim Schaad and Karen O'Donoghue chaired the JOSE working group and 3034 Sean Turner, Stephen Farrell, and Kathleen Moriarty served as 3035 Security area directors during the creation of this specification. 3037 Appendix E. Document History 3039 [[ to be removed by the RFC Editor before publication as an RFC ]] 3041 -40 3043 o Clarified the definitions of UTF8(STRING) and ASCII(STRING). 3045 -39 3047 o Added the Algorithm Analysis Documents(s) field to the IANA JSON 3048 Web Signature and Encryption Algorithms registry. 3050 o Updated the reference to draft-ietf-precis-saslprepbis. 3052 -38 3054 o Require discarding private keys with an "oth" parameter when the 3055 implementation does not support private keys with more than two 3056 primes. 3058 o Replaced uses of the phrases "JWS object" and "JWE object" with 3059 "JWS" and "JWE". 3061 -37 3062 o Restricted algorithm names to using only ASCII characters. 3064 o Added language about ignoring private keys with an "oth" parameter 3065 when the implementation does not support private keys with more 3066 than two primes. 3068 o Updated the example IANA registration request subject line. 3070 -36 3072 o Moved the normative "alg":"none" security considerations text into 3073 the algorithm definition. 3075 o Specified that registration reviews occur on the 3076 jose-reg-review@ietf.org mailing list. 3078 -35 3080 o Addressed AppsDir reviews by Carsten Bormann. 3082 o Adjusted some table column widths. 3084 -34 3086 o Addressed IESG review comments by Barry Leiba, Alissa Cooper, Pete 3087 Resnick, Stephen Farrell, and Richard Barnes. 3089 -33 3091 o Changed the registration review period to three weeks. 3093 o Acknowledged additional contributors. 3095 -32 3097 o Added a note to implementers about libraries that prefix an extra 3098 zero-valued octet to RSA modulus representations returned. 3100 o Addressed secdir review comments by Charlie Kaufman, Scott Kelly, 3101 and Stephen Kent. 3103 o Addressed Gen-ART review comments by Roni Even. 3105 o Replaced the term Plaintext JWS with Unsecured JWS. 3107 -31 3108 o Referenced NIST SP 800-57 for guidance on key lifetimes. 3110 o Updated the reference to draft-mcgrew-aead-aes-cbc-hmac-sha2. 3112 -30 3114 o Cleaned up the reference syntax in a few places. 3116 o Applied minor wording changes to the Security Considerations 3117 section. 3119 -29 3121 o Replaced the terms JWS Header, JWE Header, and JWT Header with a 3122 single JOSE Header term defined in the JWS specification. This 3123 also enabled a single Header Parameter definition to be used and 3124 reduced other areas of duplication between specifications. 3126 -28 3128 o Specified the use of PKCS #7 padding with AES CBC, rather than 3129 PKCS #5. (PKCS #7 is a superset of PKCS #5, and is appropriate 3130 for the 16 octet blocks used by AES CBC.) 3132 o Revised the introduction to the Security Considerations section. 3133 Also introduced additional subsection headings for security 3134 considerations items and moved a few security consideration items 3135 from here to the JWS and JWE drafts. 3137 -27 3139 o Described additional security considerations. 3141 o Updated the JCA and XMLENC parameters for "RSA-OAEP-256" and the 3142 JCA parameters for "A128KW", "A192KW", "A256KW", and "ECDH-ES". 3144 -26 3146 o Added algorithm identifier "RSA-OAEP-256" for RSAES OAEP using 3147 SHA-256 and MGF1 with SHA-256. 3149 o Clarified that the ECDSA signature values R and S are represented 3150 as octet sequences as defined in Section 2.3.7 of SEC1 [SEC1]. 3152 o Noted that octet sequences are depicted using JSON array notation. 3154 o Updated references, including to W3C specifications. 3156 -25 3158 o Corrected an external section number reference that had changed. 3160 -24 3162 o Replaced uses of the term "associated data" wherever it was used 3163 to refer to a data value with "additional authenticated data", 3164 since both terms were being used as synonyms, causing confusion. 3166 o Updated the JSON reference to RFC 7159. 3168 -23 3170 o No changes were made, other than to the version number and date. 3172 -22 3174 o Corrected RFC 2119 terminology usage. 3176 o Replaced references to draft-ietf-json-rfc4627bis with RFC 7158. 3178 -21 3180 o Compute the PBES2 salt parameter as (UTF8(Alg) || 0x00 || Salt 3181 Input), where the "p2s" Header Parameter encodes the Salt Input 3182 value and Alg is the "alg" Header Parameter value. 3184 o Changed some references from being normative to informative, 3185 addressing issue #90. 3187 -20 3189 o Replaced references to RFC 4627 with draft-ietf-json-rfc4627bis, 3190 addressing issue #90. 3192 -19 3194 o Used tables to show the correspondence between algorithm 3195 identifiers and algorithm descriptions and parameters in the 3196 algorithm definition sections, addressing issue #183. 3198 o Changed the "Implementation Requirements" registry field names to 3199 "JOSE Implementation Requirements" to make it clear that these 3200 implementation requirements apply only to JWS and JWE 3201 implementations. 3203 -18 3204 o Changes to address editorial and minor issues #129, #134, #135, 3205 #158, #161, #185, #186, and #187. 3207 o Added and used Description registry fields. 3209 -17 3211 o Explicitly named all the logical components of a JWS and JWE and 3212 defined the processing rules and serializations in terms of those 3213 components, addressing issues #60, #61, and #62. 3215 o Removed processing steps in algorithm definitions that duplicated 3216 processing steps in JWS or JWE, addressing issue #56. 3218 o Replaced verbose repetitive phases such as "base64url encode the 3219 octets of the UTF-8 representation of X" with mathematical 3220 notation such as "BASE64URL(UTF8(X))". 3222 o Terms used in multiple documents are now defined in one place and 3223 incorporated by reference. Some lightly used or obvious terms 3224 were also removed. This addresses issue #58. 3226 o Changes to address minor issue #53. 3228 -16 3230 o Added a DataLen prefix to the AlgorithmID value in the Concat KDF 3231 computation. 3233 o Added OIDs for encryption algorithms, additional signature 3234 algorithm OIDs, and additional XML DSIG/ENC URIs in the algorithm 3235 cross-reference tables. 3237 o Changes to address editorial and minor issues #28, #36, #39, #52, 3238 #53, #55, #127, #128, #136, #137, #141, #150, #151, #152, and 3239 #155. 3241 -15 3243 o Changed statements about rejecting JWSs to statements about 3244 validation failing, addressing issue #35. 3246 o Stated that changes of implementation requirements are only 3247 permitted on a Specification Required basis, addressing issue #38. 3249 o Made "oct" a required key type, addressing issue #40. 3251 o Updated the example ECDH-ES key agreement values. 3253 o Changes to address editorial and minor issues #34, #37, #49, #63, 3254 #123, #124, #125, #130, #132, #133, #138, #139, #140, #142, #143, 3255 #144, #145, #148, #149, #150, and #162. 3257 -14 3259 o Removed "PBKDF2" key type and added "p2s" and "p2c" header 3260 parameters for use with the PBES2 algorithms. 3262 o Made the RSA private key parameters that are there to enable 3263 optimizations be RECOMMENDED rather than REQUIRED. 3265 o Added algorithm identifiers for AES algorithms using 192 bit keys 3266 and for RSASSA-PSS using HMAC SHA-384. 3268 o Added security considerations about key lifetimes, addressing 3269 issue #18. 3271 o Added an example ECDH-ES key agreement computation. 3273 -13 3275 o Added key encryption with AES GCM as specified in 3276 draft-jones-jose-aes-gcm-key-wrap-01, addressing issue #13. 3278 o Added security considerations text limiting the number of times 3279 that an AES GCM key can be used for key encryption or direct 3280 encryption, per Section 8.3 of NIST SP 800-38D, addressing issue 3281 #28. 3283 o Added password-based key encryption as specified in 3284 draft-miller-jose-jwe-protected-jwk-02. 3286 -12 3288 o In the Direct Key Agreement case, the Concat KDF AlgorithmID is 3289 set to the octets of the UTF-8 representation of the "enc" header 3290 parameter value. 3292 o Restored the "apv" (agreement PartyVInfo) parameter. 3294 o Moved the "epk", "apu", and "apv" Header Parameter definitions to 3295 be with the algorithm descriptions that use them. 3297 o Changed terminology from "block encryption" to "content 3298 encryption". 3300 -11 3302 o Removed the Encrypted Key value from the AAD computation since it 3303 is already effectively integrity protected by the encryption 3304 process. The AAD value now only contains the representation of 3305 the JWE Encrypted Header. 3307 o Removed "apv" (agreement PartyVInfo) since it is no longer used. 3309 o Added more information about the use of PartyUInfo during key 3310 agreement. 3312 o Use the keydatalen as the SuppPubInfo value for the Concat KDF 3313 when doing key agreement, as RFC 2631 does. 3315 o Added algorithm identifiers for RSASSA-PSS with SHA-256 and SHA- 3316 512. 3318 o Added a Parameter Information Class value to the JSON Web Key 3319 Parameters registry, which registers whether the parameter conveys 3320 public or private information. 3322 -10 3324 o Changed the JWE processing rules for multiple recipients so that a 3325 single AAD value contains the header parameters and encrypted key 3326 values for all the recipients, enabling AES GCM to be safely used 3327 for multiple recipients. 3329 -09 3331 o Expanded the scope of the JWK parameters to include private and 3332 symmetric key representations, as specified by 3333 draft-jones-jose-json-private-and-symmetric-key-00. 3335 o Changed term "JWS Secured Input" to "JWS Signing Input". 3337 o Changed from using the term "byte" to "octet" when referring to 8 3338 bit values. 3340 o Specified that AES Key Wrap uses the default initial value 3341 specified in Section 2.2.3.1 of RFC 3394. This addressed issue 3342 #19. 3344 o Added Key Management Mode definitions to terminology section and 3345 used the defined terms to provide clearer key management 3346 instructions. This addressed issue #5. 3348 o Replaced "A128CBC+HS256" and "A256CBC+HS512" with "A128CBC-HS256" 3349 and "A256CBC-HS512". The new algorithms perform the same 3350 cryptographic computations as [I-D.mcgrew-aead-aes-cbc-hmac-sha2], 3351 but with the Initialization Vector and Authentication Tag values 3352 remaining separate from the Ciphertext value in the output 3353 representation. Also deleted the header parameters "epu" 3354 (encryption PartyUInfo) and "epv" (encryption PartyVInfo), since 3355 they are no longer used. 3357 o Changed from using the term "Integrity Value" to "Authentication 3358 Tag". 3360 -08 3362 o Changed the name of the JWK key type parameter from "alg" to 3363 "kty". 3365 o Replaced uses of the term "AEAD" with "Authenticated Encryption", 3366 since the term AEAD in the RFC 5116 sense implied the use of a 3367 particular data representation, rather than just referring to the 3368 class of algorithms that perform authenticated encryption with 3369 associated data. 3371 o Applied editorial improvements suggested by Jeff Hodges. Many of 3372 these simplified the terminology used. 3374 o Added seriesInfo information to Internet Draft references. 3376 -07 3378 o Added a data length prefix to PartyUInfo and PartyVInfo values. 3380 o Changed the name of the JWK RSA modulus parameter from "mod" to 3381 "n" and the name of the JWK RSA exponent parameter from "xpo" to 3382 "e", so that the identifiers are the same as those used in RFC 3383 3447. 3385 o Made several local editorial changes to clean up loose ends left 3386 over from to the decision to only support block encryption methods 3387 providing integrity. 3389 -06 3391 o Removed the "int" and "kdf" parameters and defined the new 3392 composite Authenticated Encryption algorithms "A128CBC+HS256" and 3393 "A256CBC+HS512" to replace the former uses of AES CBC, which 3394 required the use of separate integrity and key derivation 3395 functions. 3397 o Included additional values in the Concat KDF calculation -- the 3398 desired output size and the algorithm value, and optionally 3399 PartyUInfo and PartyVInfo values. Added the optional header 3400 parameters "apu" (agreement PartyUInfo), "apv" (agreement 3401 PartyVInfo), "epu" (encryption PartyUInfo), and "epv" (encryption 3402 PartyVInfo). 3404 o Changed the name of the JWK RSA exponent parameter from "exp" to 3405 "xpo" so as to allow the potential use of the name "exp" for a 3406 future extension that might define an expiration parameter for 3407 keys. (The "exp" name is already used for this purpose in the JWT 3408 specification.) 3410 o Applied changes made by the RFC Editor to RFC 6749's registry 3411 language to this specification. 3413 -05 3415 o Support both direct encryption using a shared or agreed upon 3416 symmetric key, and the use of a shared or agreed upon symmetric 3417 key to key wrap the CMK. Specifically, added the "alg" values 3418 "dir", "ECDH-ES+A128KW", and "ECDH-ES+A256KW" to finish filling in 3419 this set of capabilities. 3421 o Updated open issues. 3423 -04 3425 o Added text requiring that any leading zero bytes be retained in 3426 base64url encoded key value representations for fixed-length 3427 values. 3429 o Added this language to Registration Templates: "This name is case 3430 sensitive. Names that match other registered names in a case 3431 insensitive manner SHOULD NOT be accepted." 3433 o Described additional open issues. 3435 o Applied editorial suggestions. 3437 -03 3439 o Always use a 128 bit "authentication tag" size for AES GCM, 3440 regardless of the key size. 3442 o Specified that use of a 128 bit IV is REQUIRED with AES CBC. It 3443 was previously RECOMMENDED. 3445 o Removed key size language for ECDSA algorithms, since the key size 3446 is implied by the algorithm being used. 3448 o Stated that the "int" key size must be the same as the hash output 3449 size (and not larger, as was previously allowed) so that its size 3450 is defined for key generation purposes. 3452 o Added the "kdf" (key derivation function) header parameter to 3453 provide crypto agility for key derivation. The default KDF 3454 remains the Concat KDF with the SHA-256 digest function. 3456 o Clarified that the "mod" and "exp" values are unsigned. 3458 o Added Implementation Requirements columns to algorithm tables and 3459 Implementation Requirements entries to algorithm registries. 3461 o Changed AES Key Wrap to RECOMMENDED. 3463 o Moved registries JSON Web Signature and Encryption Header 3464 Parameters and JSON Web Signature and Encryption Type Values to 3465 the JWS specification. 3467 o Moved JSON Web Key Parameters registry to the JWK specification. 3469 o Changed registration requirements from RFC Required to 3470 Specification Required with Expert Review. 3472 o Added Registration Template sections for defined registries. 3474 o Added Registry Contents sections to populate registry values. 3476 o No longer say "the UTF-8 representation of the JWS Secured Input 3477 (which is the same as the ASCII representation)". Just call it 3478 "the ASCII representation of the JWS Secured Input". 3480 o Added "Collision Resistant Namespace" to the terminology section. 3482 o Numerous editorial improvements. 3484 -02 3486 o For AES GCM, use the "additional authenticated data" parameter to 3487 provide integrity for the header, encrypted key, and ciphertext 3488 and use the resulting "authentication tag" value as the JWE 3489 Authentication Tag. 3491 o Defined minimum required key sizes for algorithms without 3492 specified key sizes. 3494 o Defined KDF output key sizes. 3496 o Specified the use of PKCS #5 padding with AES CBC. 3498 o Generalized text to allow key agreement to be employed as an 3499 alternative to key wrapping or key encryption. 3501 o Clarified that ECDH-ES is a key agreement algorithm. 3503 o Required implementation of AES-128-KW and AES-256-KW. 3505 o Removed the use of "A128GCM" and "A256GCM" for key wrapping. 3507 o Removed "A512KW" since it turns out that it's not a standard 3508 algorithm. 3510 o Clarified the relationship between "typ" header parameter values 3511 and MIME types. 3513 o Generalized language to refer to Message Authentication Codes 3514 (MACs) rather than Hash-based Message Authentication Codes (HMACs) 3515 unless in a context specific to HMAC algorithms. 3517 o Established registries: JSON Web Signature and Encryption Header 3518 Parameters, JSON Web Signature and Encryption Algorithms, JSON Web 3519 Signature and Encryption "typ" Values, JSON Web Key Parameters, 3520 and JSON Web Key Algorithm Families. 3522 o Moved algorithm-specific definitions from JWK to JWA. 3524 o Reformatted to give each member definition its own section 3525 heading. 3527 -01 3529 o Moved definition of "alg":"none" for JWSs here from the JWT 3530 specification since this functionality is likely to be useful in 3531 more contexts that just for JWTs. 3533 o Added Advanced Encryption Standard (AES) Key Wrap Algorithm using 3534 512 bit keys ("A512KW"). 3536 o Added text "Alternatively, the Encoded JWS Signature MAY be 3537 base64url decoded to produce the JWS Signature and this value can 3538 be compared with the computed HMAC value, as this comparison 3539 produces the same result as comparing the encoded values". 3541 o Corrected the Magic Signatures reference. 3543 o Made other editorial improvements suggested by JOSE working group 3544 participants. 3546 -00 3548 o Created the initial IETF draft based upon 3549 draft-jones-json-web-signature-04 and 3550 draft-jones-json-web-encryption-02 with no normative changes. 3552 o Changed terminology to no longer call both digital signatures and 3553 HMACs "signatures". 3555 Author's Address 3557 Michael B. Jones 3558 Microsoft 3560 Email: mbj@microsoft.com 3561 URI: http://self-issued.info/