idnits 2.17.1 draft-ietf-jose-json-web-algorithms-01.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 4 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 12, 2012) is 4427 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-197' -- Possible downref: Non-RFC (?) normative reference: ref. 'JWE' -- Possible downref: Non-RFC (?) normative reference: ref. 'JWS' -- Possible downref: Non-RFC (?) normative reference: ref. 'NIST-800-38A' -- Possible downref: Non-RFC (?) normative reference: ref. 'NIST-800-38D' -- Possible downref: Non-RFC (?) normative reference: ref. 'NIST-800-56A' ** Downref: Normative reference to an Informational RFC: RFC 2104 ** Downref: Normative reference to an Informational RFC: RFC 3394 ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Downref: Normative reference to an Informational RFC: RFC 6090 Summary: 5 errors (**), 0 flaws (~~), 2 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 JOSE Working Group M. Jones 3 Internet-Draft Microsoft 4 Intended status: Standards Track March 12, 2012 5 Expires: September 13, 2012 7 JSON Web Algorithms (JWA) 8 draft-ietf-jose-json-web-algorithms-01 10 Abstract 12 The JSON Web Algorithms (JWA) specification enumerates cryptographic 13 algorithms and identifiers to be used with the JSON Web Signature 14 (JWS) and JSON Web Encryption (JWE) specifications. 16 Requirements Language 18 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 19 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 20 document are to be interpreted as described in RFC 2119 [RFC2119]. 22 Status of this Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on September 13, 2012. 39 Copyright Notice 41 Copyright (c) 2012 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 57 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 58 3. Cryptographic Algorithms for JWS . . . . . . . . . . . . . . . 3 59 3.1. Creating a JWS with HMAC SHA-256, HMAC SHA-384, or 60 HMAC SHA-512 . . . . . . . . . . . . . . . . . . . . . . . 4 61 3.2. Creating a JWS with RSA SHA-256, RSA SHA-384, or RSA 62 SHA-512 . . . . . . . . . . . . . . . . . . . . . . . . . 5 63 3.3. Creating a JWS with ECDSA P-256 SHA-256, ECDSA P-384 64 SHA-384, or ECDSA P-521 SHA-512 . . . . . . . . . . . . . 6 65 3.4. Creating a Plaintext JWS . . . . . . . . . . . . . . . . . 7 66 3.5. Additional Digital Signature/HMAC Algorithms . . . . . . . 7 67 4. Cryptographic Algorithms for JWE . . . . . . . . . . . . . . . 8 68 4.1. Encrypting a JWE with TBD . . . . . . . . . . . . . . . . 9 69 4.2. Additional Encryption Algorithms . . . . . . . . . . . . . 9 70 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 71 6. Security Considerations . . . . . . . . . . . . . . . . . . . 10 72 7. Open Issues and Things To Be Done (TBD) . . . . . . . . . . . 10 73 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 11 74 8.1. Normative References . . . . . . . . . . . . . . . . . . . 11 75 8.2. Informative References . . . . . . . . . . . . . . . . . . 12 76 Appendix A. Digital Signature/HMAC Algorithm Identifier 77 Cross-Reference . . . . . . . . . . . . . . . . . . . 13 78 Appendix B. Encryption Algorithm Identifier Cross-Reference . . . 15 79 Appendix C. Acknowledgements . . . . . . . . . . . . . . . . . . 19 80 Appendix D. Document History . . . . . . . . . . . . . . . . . . 19 81 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 19 83 1. Introduction 85 The JSON Web Algorithms (JWA) specification enumerates cryptographic 86 algorithms and identifiers to be used with the JSON Web Signature 87 (JWS) [JWS] and JSON Web Encryption (JWE) [JWE] specifications. 88 Enumerating the algorithms and identifiers for them in this 89 specification, rather than in the JWS and JWE specifications, is 90 intended to allow them to remain unchanged in the face of changes in 91 the set of required, recommended, optional, and deprecated algorithms 92 over time. This specification also describes the semantics and 93 operations that are specific to these algorithms and algorithm 94 families. 96 2. Terminology 98 This specification uses the terminology defined by the JSON Web 99 Signature (JWS) [JWS] and JSON Web Encryption (JWE) [JWE] 100 specifications. 102 3. Cryptographic Algorithms for JWS 104 JWS uses cryptographic algorithms to sign the contents of the JWS 105 Header and the JWS Payload. The use of the following algorithms for 106 producing JWSs is defined in this section. 108 The table below Table 1 is the set of "alg" (algorithm) header 109 parameter values defined by this specification for use with JWS, each 110 of which is explained in more detail in the following sections: 112 +--------------------+----------------------------------------------+ 113 | Alg Parameter | Algorithm | 114 | Value | | 115 +--------------------+----------------------------------------------+ 116 | HS256 | HMAC using SHA-256 hash algorithm | 117 | HS384 | HMAC using SHA-384 hash algorithm | 118 | HS512 | HMAC using SHA-512 hash algorithm | 119 | RS256 | RSA using SHA-256 hash algorithm | 120 | RS384 | RSA using SHA-384 hash algorithm | 121 | RS512 | RSA using SHA-512 hash algorithm | 122 | ES256 | ECDSA using P-256 curve and SHA-256 hash | 123 | | algorithm | 124 | ES384 | ECDSA using P-384 curve and SHA-384 hash | 125 | | algorithm | 126 | ES512 | ECDSA using P-521 curve and SHA-512 hash | 127 | | algorithm | 128 | none | No digital signature or HMAC value included | 129 +--------------------+----------------------------------------------+ 131 Table 1: JWS Defined "alg" Parameter Values 133 See Appendix A for a table cross-referencing the digital signature 134 and HMAC "alg" (algorithm) values used in this specification with the 135 equivalent identifiers used by other standards and software packages. 137 Of these algorithms, only HMAC SHA-256 and "none" MUST be implemented 138 by conforming JWS implementations. It is RECOMMENDED that 139 implementations also support the RSA SHA-256 and ECDSA P-256 SHA-256 140 algorithms. Support for other algorithms and key sizes is OPTIONAL. 142 3.1. Creating a JWS with HMAC SHA-256, HMAC SHA-384, or HMAC SHA-512 144 Hash based Message Authentication Codes (HMACs) enable one to use a 145 secret plus a cryptographic hash function to generate a Message 146 Authentication Code (MAC). This can be used to demonstrate that the 147 MAC matches the hashed content, in this case the JWS Secured Input, 148 which therefore demonstrates that whoever generated the MAC was in 149 possession of the secret. The means of exchanging the shared key is 150 outside the scope of this specification. 152 The algorithm for implementing and validating HMACs is provided in 153 RFC 2104 [RFC2104]. This section defines the use of the HMAC SHA- 154 256, HMAC SHA-384, and HMAC SHA-512 cryptographic hash functions as 155 defined in FIPS 180-3 [FIPS.180-3]. The "alg" (algorithm) header 156 parameter values "HS256", "HS384", and "HS512" are used in the JWS 157 Header to indicate that the Encoded JWS Signature contains a 158 base64url encoded HMAC value using the respective hash function. 160 The HMAC SHA-256 MAC is generated as follows: 162 1. Apply the HMAC SHA-256 algorithm to the UTF-8 representation of 163 the JWS Secured Input using the shared key to produce an HMAC 164 value. 166 2. Base64url encode the resulting HMAC value. 168 The output is the Encoded JWS Signature for that JWS. 170 The HMAC SHA-256 MAC for a JWS is validated as follows: 172 1. Apply the HMAC SHA-256 algorithm to the UTF-8 representation of 173 the JWS Secured Input of the JWS using the shared key. 175 2. Base64url encode the resulting HMAC value. 177 3. If the Encoded JWS Signature and the base64url encoded HMAC value 178 exactly match, then one has confirmation that the shared key was 179 used to generate the HMAC on the JWS and that the contents of the 180 JWS have not be tampered with. 182 4. If the validation fails, the JWS MUST be rejected. 184 Alternatively, the Encoded JWS Signature MAY be base64url decoded to 185 produce the JWS Signature and this value can be compared with the 186 computed HMAC value, as this comparison produces the same result as 187 comparing the encoded values. 189 Securing content with the HMAC SHA-384 and HMAC SHA-512 algorithms is 190 performed identically to the procedure for HMAC SHA-256 - just with 191 correspondingly longer minimum key sizes and result values. 193 3.2. Creating a JWS with RSA SHA-256, RSA SHA-384, or RSA SHA-512 195 This section defines the use of the RSASSA-PKCS1-v1_5 digital 196 signature algorithm as defined in RFC 3447 [RFC3447], Section 8.2 197 (commonly known as PKCS#1), using SHA-256, SHA-384, or SHA-512 as the 198 hash function. The RSASSA-PKCS1-v1_5 algorithm is described in FIPS 199 186-3 [FIPS.186-3], Section 5.5, and the SHA-256, SHA-384, and SHA- 200 512 cryptographic hash functions are defined in FIPS 180-3 201 [FIPS.180-3]. The "alg" (algorithm) header parameter values "RS256", 202 "RS384", and "RS512" are used in the JWS Header to indicate that the 203 Encoded JWS Signature contains a base64url encoded RSA digital 204 signature using the respective hash function. 206 A 2048-bit or longer key length MUST be used with this algorithm. 208 The RSA SHA-256 digital signature is generated as follows: 210 1. Generate a digital signature of the UTF-8 representation of the 211 JWS Secured Input using RSASSA-PKCS1-V1_5-SIGN and the SHA-256 212 hash function with the desired private key. The output will be a 213 byte array. 215 2. Base64url encode the resulting byte array. 217 The output is the Encoded JWS Signature for that JWS. 219 The RSA SHA-256 digital signature for a JWS is validated as follows: 221 1. Take the Encoded JWS Signature and base64url decode it into a 222 byte array. If decoding fails, the JWS MUST be rejected. 224 2. Submit the UTF-8 representation of the JWS Secured Input and the 225 public key corresponding to the private key used by the signer to 226 the RSASSA-PKCS1-V1_5-VERIFY algorithm using SHA-256 as the hash 227 function. 229 3. If the validation fails, the JWS MUST be rejected. 231 Signing with the RSA SHA-384 and RSA SHA-512 algorithms is performed 232 identically to the procedure for RSA SHA-256 - just with 233 correspondingly longer minimum key sizes and result values. 235 3.3. Creating a JWS with ECDSA P-256 SHA-256, ECDSA P-384 SHA-384, or 236 ECDSA P-521 SHA-512 238 The Elliptic Curve Digital Signature Algorithm (ECDSA) is defined by 239 FIPS 186-3 [FIPS.186-3]. ECDSA provides for the use of Elliptic 240 Curve cryptography, which is able to provide equivalent security to 241 RSA cryptography but using shorter key lengths and with greater 242 processing speed. This means that ECDSA digital signatures will be 243 substantially smaller in terms of length than equivalently strong RSA 244 digital signatures. 246 This specification defines the use of ECDSA with the P-256 curve and 247 the SHA-256 cryptographic hash function, ECDSA with the P-384 curve 248 and the SHA-384 hash function, and ECDSA with the P-521 curve and the 249 SHA-512 hash function. The P-256, P-384, and P-521 curves are also 250 defined in FIPS 186-3. The "alg" (algorithm) header parameter values 251 "ES256", "ES384", and "ES512" are used in the JWS Header to indicate 252 that the Encoded JWS Signature contains a base64url encoded ECDSA 253 P-256 SHA-256, ECDSA P-384 SHA-384, or ECDSA P-521 SHA-512 digital 254 signature, respectively. 256 The ECDSA P-256 SHA-256 digital signature is generated as follows: 258 1. Generate a digital signature of the UTF-8 representation of the 259 JWS Secured Input using ECDSA P-256 SHA-256 with the desired 260 private key. The output will be the EC point (R, S), where R and 261 S are unsigned integers. 263 2. Turn R and S into byte arrays in big endian order. Each array 264 will be 32 bytes long. 266 3. Concatenate the two byte arrays in the order R and then S. 268 4. Base64url encode the resulting 64 byte array. 270 The output is the Encoded JWS Signature for the JWS. 272 The ECDSA P-256 SHA-256 digital signature for a JWS is validated as 273 follows: 275 1. Take the Encoded JWS Signature and base64url decode it into a 276 byte array. If decoding fails, the JWS MUST be rejected. 278 2. The output of the base64url decoding MUST be a 64 byte array. 280 3. Split the 64 byte array into two 32 byte arrays. The first array 281 will be R and the second S. Remember that the byte arrays are in 282 big endian byte order; please check the ECDSA validator in use to 283 see what byte order it requires. 285 4. Submit the UTF-8 representation of the JWS Secured Input, R, S 286 and the public key (x, y) to the ECDSA P-256 SHA-256 validator. 288 5. If the validation fails, the JWS MUST be rejected. 290 The ECDSA validator will then determine if the digital signature is 291 valid, given the inputs. Note that ECDSA digital signature contains 292 a value referred to as K, which is a random number generated for each 293 digital signature instance. This means that two ECDSA digital 294 signatures using exactly the same input parameters will output 295 different signature values because their K values will be different. 296 The consequence of this is that one must validate an ECDSA digital 297 signature by submitting the previously specified inputs to an ECDSA 298 validator. 300 Signing with the ECDSA P-384 SHA-384 and ECDSA P-521 SHA-512 301 algorithms is performed identically to the procedure for ECDSA P-256 302 SHA-256 - just with correspondingly longer minimum key sizes and 303 result values. 305 3.4. Creating a Plaintext JWS 307 To support use cases where the content is secured by a means other 308 than a digital signature or HMAC value, JWSs MAY also be created 309 without them. These are called "Plaintext JWSs". Plaintext JWSs 310 MUST use the "alg" value "none", and are formatted identically to 311 other JWSs, but with an empty JWS Signature value. 313 3.5. Additional Digital Signature/HMAC Algorithms 315 Additional algorithms MAY be used to protect JWSs with corresponding 316 "alg" (algorithm) header parameter values being defined to refer to 317 them. New "alg" header parameter values SHOULD either be defined in 318 the IANA JSON Web Signature Algorithms registry or be a URI that 319 contains a collision resistant namespace. In particular, it is 320 permissible to use the algorithm identifiers defined in XML DSIG 321 [RFC3275] and related specifications as "alg" values. 323 4. Cryptographic Algorithms for JWE 325 JWE uses cryptographic algorithms to encrypt the Content Encryption 326 Key (CEK) and the Plaintext. This section specifies a set of 327 specific algorithms for these purposes. 329 The table below Table 2 is the set of "alg" (algorithm) header 330 parameter values that are defined by this specification for use with 331 JWE. These algorithms are used to encrypt the CEK, which produces 332 the JWE Encrypted Key. 334 +-----------+-------------------------------------------------------+ 335 | alg | Encryption Algorithm | 336 | Parameter | | 337 | Value | | 338 +-----------+-------------------------------------------------------+ 339 | RSA1_5 | RSA using RSA-PKCS1-1.5 padding, as defined in RFC | 340 | | 3447 [RFC3447] | 341 | RSA-OAEP | RSA using Optimal Asymmetric Encryption Padding | 342 | | (OAEP), as defined in RFC 3447 [RFC3447] | 343 | ECDH-ES | Elliptic Curve Diffie-Hellman Ephemeral Static, as | 344 | | defined in RFC 6090 [RFC6090], and using the Concat | 345 | | KDF, as defined in [NIST-800-56A], where the Digest | 346 | | Method is SHA-256 and all OtherInfo parameters are | 347 | | the empty bit string | 348 | A128KW | Advanced Encryption Standard (AES) Key Wrap Algorithm | 349 | | using 128 bit keys, as defined in RFC 3394 [RFC3394] | 350 | A256KW | Advanced Encryption Standard (AES) Key Wrap Algorithm | 351 | | using 256 bit keys, as defined in RFC 3394 [RFC3394] | 352 | A512KW | Advanced Encryption Standard (AES) Key Wrap Algorithm | 353 | | using 512 bit keys, as defined in RFC 3394 [RFC3394] | 354 | A128GCM | Advanced Encryption Standard (AES) using 128 bit keys | 355 | | in Galois/Counter Mode, as defined in [FIPS-197] and | 356 | | [NIST-800-38D] | 357 | A256GCM | Advanced Encryption Standard (AES) using 256 bit keys | 358 | | in Galois/Counter Mode, as defined in [FIPS-197] and | 359 | | [NIST-800-38D] | 360 +-----------+-------------------------------------------------------+ 362 Table 2: JWE Defined "alg" Parameter Values 364 The table below Table 3 is the set of "enc" (encryption method) 365 header parameter values that are defined by this specification for 366 use with JWE. These algorithms are used to encrypt the Plaintext, 367 which produces the Ciphertext. 369 +-----------+-------------------------------------------------------+ 370 | enc | Symmetric Encryption Algorithm | 371 | Parameter | | 372 | Value | | 373 +-----------+-------------------------------------------------------+ 374 | A128CBC | Advanced Encryption Standard (AES) using 128 bit keys | 375 | | in Cipher Block Chaining mode, as defined in | 376 | | [FIPS-197] and [NIST-800-38A] | 377 | A256CBC | Advanced Encryption Standard (AES) using 256 bit keys | 378 | | in Cipher Block Chaining mode, as defined in | 379 | | [FIPS-197] and [NIST-800-38A] | 380 | A128GCM | Advanced Encryption Standard (AES) using 128 bit keys | 381 | | in Galois/Counter Mode, as defined in [FIPS-197] and | 382 | | [NIST-800-38D] | 383 | A256GCM | Advanced Encryption Standard (AES) using 256 bit keys | 384 | | in Galois/Counter Mode, as defined in [FIPS-197] and | 385 | | [NIST-800-38D] | 386 +-----------+-------------------------------------------------------+ 388 Table 3: JWE Defined "enc" Parameter Values 390 See Appendix B for a table cross-referencing the encryption "alg" 391 (algorithm) and "enc" (encryption method) values used in this 392 specification with the equivalent identifiers used by other standards 393 and software packages. 395 Of these algorithms, only RSA-PKCS1-1.5 with 2048 bit keys, AES-128- 396 CBC, and AES-256-CBC MUST be implemented by conforming JWE 397 implementations. It is RECOMMENDED that implementations also support 398 ECDH-ES with 256 bit keys, AES-128-GCM, and AES-256-GCM. Support for 399 other algorithms and key sizes is OPTIONAL. 401 4.1. Encrypting a JWE with TBD 403 TBD: Descriptions of the particulars of using each specified 404 encryption algorithm go here. 406 4.2. Additional Encryption Algorithms 408 Additional algorithms MAY be used to protect JWEs with corresponding 409 "alg" (algorithm) and "enc" (encryption method) header parameter 410 values being defined to refer to them. New "alg" and "enc" header 411 parameter values SHOULD either be defined in the IANA JSON Web 412 Encryption Algorithms registry or be a URI that contains a collision 413 resistant namespace. In particular, it is permissible to use the 414 algorithm identifiers defined in XML Encryption 416 [W3C.REC-xmlenc-core-20021210], XML Encryption 1.1 417 [W3C.CR-xmlenc-core1-20110303], and related specifications as "alg" 418 and "enc" values. 420 5. IANA Considerations 422 This specification calls for: 424 o A new IANA registry entitled "JSON Web Signature Algorithms" for 425 values of the JWS "alg" (algorithm) header parameter is defined in 426 Section 3.5. Inclusion in the registry is RFC Required in the RFC 427 5226 [RFC5226] sense. The registry will just record the "alg" 428 value and a pointer to the RFC that defines it. This 429 specification defines inclusion of the algorithm values defined in 430 Table 1. 432 o A new IANA registry entitled "JSON Web Encryption Algorithms" for 433 values used with the JWE "alg" (algorithm) and "enc" (encryption 434 method) header parameters is defined in Section 4.2. Inclusion in 435 the registry is RFC Required in the RFC 5226 [RFC5226] sense. The 436 registry will record the "alg" or "enc" value and a pointer to the 437 RFC that defines it. This specification defines inclusion of the 438 algorithm values defined in Table 2 and Table 3. 440 6. Security Considerations 442 TBD 444 7. Open Issues and Things To Be Done (TBD) 446 The following items remain to be done in this draft: 448 o Specify minimum required key sizes for all algorithms. 450 o Specify which algorithms require Initialization Vectors (IVs) and 451 minimum required lengths for those IVs. 453 o Since RFC 3447 Section 8 explicitly calls for people NOT to adopt 454 RSASSA-PKCS1 for new applications and instead requests that people 455 transition to RSASSA-PSS, we probably need some Security 456 Considerations text explaining why RSASSA-PKCS1 is being used 457 (it's what's commonly implemented) and what the potential 458 consequences are. 460 o Should we define the use of RFC 5649 key wrapping functions, which 461 allow arbitrary key sizes, in addition to the current use of RFC 462 3394 key wrapping functions, which require that keys be multiples 463 of 64 bits? Is this needed in practice? 465 o Decide whether to move the JWK algorithm family definitions "EC" 466 and "RSA" here. This would likely result in all the family- 467 specific parameter definitions also moving here ("crv", "x", "y", 468 "mod", "exp"), leaving very little normative text in the JWK spec 469 itself. This seems like it would reduce spec readability and so 470 was not done. 472 o It would be good to say somewhere, in normative language, that 473 eventually the algorithms and/or key sizes currently specified 474 will no longer be considered sufficiently secure and will be 475 removed. Therefore, implementers MUST be prepared for this 476 eventuality. 478 o Write the Security Considerations section. 480 8. References 482 8.1. Normative References 484 [FIPS-197] 485 National Institute of Standards and Technology (NIST), 486 "Advanced Encryption Standard (AES)", FIPS PUB 197, 487 November 2001. 489 [FIPS.180-3] 490 National Institute of Standards and Technology, "Secure 491 Hash Standard (SHS)", FIPS PUB 180-3, October 2008. 493 [FIPS.186-3] 494 National Institute of Standards and Technology, "Digital 495 Signature Standard (DSS)", FIPS PUB 186-3, June 2009. 497 [JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web 498 Encryption (JWE)", March 2012. 500 [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 501 Signature (JWS)", March 2012. 503 [NIST-800-38A] 504 National Institute of Standards and Technology (NIST), 505 "Recommendation for Block Cipher Modes of Operation", 506 NIST PUB 800-38A, December 2001. 508 [NIST-800-38D] 509 National Institute of Standards and Technology (NIST), 510 "Recommendation for Block Cipher Modes of Operation: 511 Galois/Counter Mode (GCM) and GMAC", NIST PUB 800-38D, 512 December 2001. 514 [NIST-800-56A] 515 National Institute of Standards and Technology (NIST), 516 "Recommendation for Pair-Wise Key Establishment Schemes 517 Using Discrete Logarithm Cryptography (Revised)", NIST PUB 518 800-56A, March 2007. 520 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 521 Hashing for Message Authentication", RFC 2104, 522 February 1997. 524 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 525 Requirement Levels", BCP 14, RFC 2119, March 1997. 527 [RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard 528 (AES) Key Wrap Algorithm", RFC 3394, September 2002. 530 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 531 Standards (PKCS) #1: RSA Cryptography Specifications 532 Version 2.1", RFC 3447, February 2003. 534 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 535 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 536 May 2008. 538 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 539 Curve Cryptography Algorithms", RFC 6090, February 2011. 541 8.2. Informative References 543 [CanvasApp] 544 Facebook, "Canvas Applications", 2010. 546 [I-D.rescorla-jsms] 547 Rescorla, E. and J. Hildebrand, "JavaScript Message 548 Security Format", draft-rescorla-jsms-00 (work in 549 progress), March 2011. 551 [JCA] Oracle, "Java Cryptography Architecture", 2011. 553 [JSE] Bradley, J. and N. Sakimura (editor), "JSON Simple 554 Encryption", September 2010. 556 [JSS] Bradley, J. and N. Sakimura (editor), "JSON Simple Sign", 557 September 2010. 559 [MagicSignatures] 560 Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic 561 Signatures", January 2011. 563 [RFC3275] Eastlake, D., Reagle, J., and D. Solo, "(Extensible Markup 564 Language) XML-Signature Syntax and Processing", RFC 3275, 565 March 2002. 567 [W3C.CR-xmlenc-core1-20110303] 568 Hirsch, F., Roessler, T., Reagle, J., and D. Eastlake, 569 "XML Encryption Syntax and Processing Version 1.1", World 570 Wide Web Consortium CR CR-xmlenc-core1-20110303, 571 March 2011, 572 . 574 [W3C.REC-xmlenc-core-20021210] 575 Eastlake, D. and J. Reagle, "XML Encryption Syntax and 576 Processing", World Wide Web Consortium Recommendation REC- 577 xmlenc-core-20021210, December 2002, 578 . 580 Appendix A. Digital Signature/HMAC Algorithm Identifier Cross-Reference 582 This appendix contains a table cross-referencing the digital 583 signature and HMAC "alg" (algorithm) values used in this 584 specification with the equivalent identifiers used by other standards 585 and software packages. See XML DSIG [RFC3275] and Java Cryptography 586 Architecture [JCA] for more information about the names defined by 587 those documents. 589 +-------+-----+----------------------------+----------+-------------+ 590 | Algor | JWS | XML DSIG | JCA | OID | 591 | ithm | | | | | 592 +-------+-----+----------------------------+----------+-------------+ 593 | HMAC | HS2 | http://www.w3.org/2001/04/ | HmacSHA2 | 1.2.840.113 | 594 | using | 56 | xmldsig-more#hmac-sha256 | 56 | 549.2.9 | 595 | SHA-2 | | | | | 596 | 56 | | | | | 597 | hash | | | | | 598 | algo | | | | | 599 | rithm | | | | | 600 | HMAC | HS3 | http://www.w3.org/2001/04/ | HmacSHA3 | 1.2.840.113 | 601 | using | 84 | xmldsig-more#hmac-sha384 | 84 | 549.2.10 | 602 | SHA-3 | | | | | 603 | 84 | | | | | 604 | hash | | | | | 605 | algo | | | | | 606 | rithm | | | | | 607 | HMAC | HS5 | http://www.w3.org/2001/04/ | HmacSHA5 | 1.2.840.113 | 608 | using | 12 | xmldsig-more#hmac-sha512 | 12 | 549.2.11 | 609 | SHA-5 | | | | | 610 | 12 | | | | | 611 | hash | | | | | 612 | algo | | | | | 613 | rithm | | | | | 614 | RSA | RS2 | http://www.w3.org/2001/04/ | SHA256wi | 1.2.840.113 | 615 | using | 56 | xmldsig-more#rsa-sha256 | thRSA | 549.1.1.11 | 616 | SHA-2 | | | | | 617 | 56 | | | | | 618 | hash | | | | | 619 | algo | | | | | 620 | rithm | | | | | 621 | RSA | RS3 | http://www.w3.org/2001/04/ | SHA384wi | 1.2.840.113 | 622 | using | 84 | xmldsig-more#rsa-sha384 | thRSA | 549.1.1.12 | 623 | SHA-3 | | | | | 624 | 84 | | | | | 625 | hash | | | | | 626 | algo | | | | | 627 | rithm | | | | | 628 | RSA | RS5 | http://www.w3.org/2001/04/ | SHA512wi | 1.2.840.113 | 629 | using | 12 | xmldsig-more#rsa-sha512 | thRSA | 549.1.1.13 | 630 | SHA-5 | | | | | 631 | 12 | | | | | 632 | hash | | | | | 633 | algo | | | | | 634 | rithm | | | | | 635 | ECDSA | ES2 | http://www.w3.org/2001/04/ | SHA256wi | 1.2.840.100 | 636 | using | 56 | xmldsig-more#ecdsa-sha256 | thECDSA | 45.4.3.2 | 637 | P-256 | | | | | 638 | curve | | | | | 639 | and | | | | | 640 | SHA-2 | | | | | 641 | 56 | | | | | 642 | hash | | | | | 643 | algo | | | | | 644 | rithm | | | | | 645 | ECDSA | ES3 | http://www.w3.org/2001/04/ | SHA384wi | 1.2.840.100 | 646 | using | 84 | xmldsig-more#ecdsa-sha384 | thECDSA | 45.4.3.3 | 647 | P-384 | | | | | 648 | curve | | | | | 649 | and | | | | | 650 | SHA-3 | | | | | 651 | 84 | | | | | 652 | hash | | | | | 653 | algo | | | | | 654 | rithm | | | | | 655 | ECDSA | ES5 | http://www.w3.org/2001/04/ | SHA512wi | 1.2.840.100 | 656 | using | 12 | xmldsig-more#ecdsa-sha512 | thECDSA | 45.4.3.4 | 657 | P-521 | | | | | 658 | curve | | | | | 659 | and | | | | | 660 | SHA-5 | | | | | 661 | 12 | | | | | 662 | hash | | | | | 663 | algo | | | | | 664 | rithm | | | | | 665 +-------+-----+----------------------------+----------+-------------+ 667 Table 4: Digital Signature/HMAC Algorithm Identifier Cross-Reference 669 Appendix B. Encryption Algorithm Identifier Cross-Reference 671 This appendix contains a table cross-referencing the "alg" 672 (algorithm) and "enc" (encryption method) values used in this 673 specification with the equivalent identifiers used by other standards 674 and software packages. See XML Encryption 675 [W3C.REC-xmlenc-core-20021210], XML Encryption 1.1 676 [W3C.CR-xmlenc-core1-20110303], and Java Cryptography Architecture 677 [JCA] for more information about the names defined by those 678 documents. 680 +---------+-------+---------------------------+---------------------+ 681 | Algorit | JWE | XML ENC | JCA | 682 | hm | | | | 683 +---------+-------+---------------------------+---------------------+ 684 | RSA | RSA1_ | http://www.w3.org/2001/04 | RSA/ECB/PKCS1Paddin | 685 | using | 5 | /xmlenc#rsa-1_5 | g | 686 | RSA-PKC | | | | 687 | S1-1.5 | | | | 688 | paddin | | | | 689 | g | | | | 690 | RSA | RSA-O | http://www.w3.org/2001/04 | RSA/ECB/OAEPWithSHA | 691 | using | AEP | /xmlenc#rsa-oaep-mgf1p | -1AndMGF1Padding | 692 | Optimal | | | | 693 | Asymmet | | | | 694 | ric | | | | 695 | Encryp | | | | 696 | tion | | | | 697 | Paddi | | | | 698 | ng(OAEP | | | | 699 | ) | | | | 700 | Ellipti | ECDH- | http://www.w3.org/2009/xm | TBD | 701 | cCurve | ES | lenc11#ECDH-ES | | 702 | Diffie | | | | 703 | -Hellma | | | | 704 | n Ephem | | | | 705 | eral | | | | 706 | Stat | | | | 707 | ic | | | | 708 | Advance | A128K | http://www.w3.org/2001/04 | TBD | 709 | d | W | /xmlenc#kw-aes128 | | 710 | Encryp | | | | 711 | tion | | | | 712 | Stand | | | | 713 | ard(AES | | | | 714 | ) Key | | | | 715 | Wrap | | | | 716 | Algo | | | | 717 | rithm R | | | | 718 | FC 339 | | | | 719 | 4 [RF | | | | 720 | C3394] | | | | 721 | using12 | | | | 722 | 8 bitke | | | | 723 | ys | | | | 724 | Advance | A256K | http://www.w3.org/2001/04 | TBD | 725 | d | W | /xmlenc#kw-aes256 | | 726 | Encryp | | | | 727 | tion | | | | 728 | Stand | | | | 729 | ard(AES | | | | 730 | ) Key | | | | 731 | Wrap | | | | 732 | Algo | | | | 733 | rithm R | | | | 734 | FC 339 | | | | 735 | 4 [RF | | | | 736 | C3394] | | | | 737 | using25 | | | | 738 | 6 bitke | | | | 739 | ys | | | | 740 | Advance | A512K | http://www.w3.org/2001/04 | TBD | 741 | d | W | /xmlenc#kw-aes512 | | 742 | Encryp | | | | 743 | tion | | | | 744 | Stand | | | | 745 | ard(AES | | | | 746 | ) Key | | | | 747 | Wrap | | | | 748 | Algo | | | | 749 | rithm R | | | | 750 | FC 339 | | | | 751 | 4 [RF | | | | 752 | C3394] | | | | 753 | using51 | | | | 754 | 2 bitke | | | | 755 | ys | | | | 756 | Advance | A128C | http://www.w3.org/2001/04 | AES/CBC/PKCS5Paddin | 757 | d | BC | /xmlenc#aes128-cbc | g | 758 | Encryp | | | | 759 | tion | | | | 760 | Stand | | | | 761 | ard(AES | | | | 762 | ) usin | | | | 763 | g 128 | | | | 764 | bitkeys | | | | 765 | inCiph | | | | 766 | er Bloc | | | | 767 | k Chai | | | | 768 | ningmod | | | | 769 | e | | | | 770 | Advance | A256C | http://www.w3.org/2001/04 | AES/CBC/PKCS5Paddin | 771 | d | BC | /xmlenc#aes256-cbc | g | 772 | Encryp | | | | 773 | tion | | | | 774 | Stand | | | | 775 | ard(AES | | | | 776 | ) usin | | | | 777 | g 256 | | | | 778 | bitkeys | | | | 779 | inCiph | | | | 780 | er Bloc | | | | 781 | k Chai | | | | 782 | ningmod | | | | 783 | e | | | | 784 | Advance | A128G | http://www.w3.org/2009/xm | AES/GCM/NoPadding | 785 | d | CM | lenc11#aes128-gcm | | 786 | Encryp | | | | 787 | tion | | | | 788 | Stand | | | | 789 | ard(AES | | | | 790 | ) usin | | | | 791 | g 128 | | | | 792 | bitkeys | | | | 793 | inGalo | | | | 794 | is/Coun | | | | 795 | ter Mod | | | | 796 | e | | | | 797 | Advance | A256G | http://www.w3.org/2009/xm | AES/GCM/NoPadding | 798 | d | CM | lenc11#aes256-gcm | | 799 | Encryp | | | | 800 | tion | | | | 801 | Stand | | | | 802 | ard(AES | | | | 803 | ) usin | | | | 804 | g 256 | | | | 805 | bitkeys | | | | 806 | inGalo | | | | 807 | is/Coun | | | | 808 | ter Mod | | | | 809 | e | | | | 810 +---------+-------+---------------------------+---------------------+ 812 Table 5: Encryption Algorithm Identifier Cross-Reference 814 Appendix C. Acknowledgements 816 Solutions for signing and encrypting JSON content were previously 817 explored by Magic Signatures [MagicSignatures], JSON Simple Sign 818 [JSS], Canvas Applications [CanvasApp], JSON Simple Encryption [JSE], 819 and JavaScript Message Security Format [I-D.rescorla-jsms], all of 820 which influenced this draft. Dirk Balfanz, John Bradley, Yaron Y. 821 Goland, John Panzer, Nat Sakimura, and Paul Tarjan all made 822 significant contributions to the design of this specification and its 823 related specifications. 825 Appendix D. Document History 827 -01 829 o Moved definition of "alg":"none" for JWSs here from the JWT 830 specification since this functionality is likely to be useful in 831 more contexts that just for JWTs. 833 o Added Advanced Encryption Standard (AES) Key Wrap Algorithm using 834 512 bit keys ("A512KW"). 836 o Added text "Alternatively, the Encoded JWS Signature MAY be 837 base64url decoded to produce the JWS Signature and this value can 838 be compared with the computed HMAC value, as this comparison 839 produces the same result as comparing the encoded values". 841 o Corrected the Magic Signatures reference. 843 o Made other editorial improvements suggested by JOSE working group 844 participants. 846 -00 848 o Created the initial IETF draft based upon 849 draft-jones-json-web-signature-04 and 850 draft-jones-json-web-encryption-02 with no normative changes. 852 o Changed terminology to no longer call both digital signatures and 853 HMACs "signatures". 855 Author's Address 857 Michael B. Jones 858 Microsoft 860 Email: mbj@microsoft.com 861 URI: http://self-issued.info/