 1/draftietfjosejsonwebalgorithms00.txt 20120313 00:14:18.842670758 +0100
+++ 2/draftietfjosejsonwebalgorithms01.txt 20120313 00:14:18.886671213 +0100
@@ 1,18 +1,18 @@
JOSE Working Group M. Jones
InternetDraft Microsoft
Intended status: Standards Track January 16, 2012
Expires: July 19, 2012
+Intended status: Standards Track March 12, 2012
+Expires: September 13, 2012
JSON Web Algorithms (JWA)
 draftietfjosejsonwebalgorithms00
+ draftietfjosejsonwebalgorithms01
Abstract
The JSON Web Algorithms (JWA) specification enumerates cryptographic
algorithms and identifiers to be used with the JSON Web Signature
(JWS) and JSON Web Encryption (JWE) specifications.
Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
@@ 27,21 +27,21 @@
InternetDrafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as InternetDrafts. The list of current Internet
Drafts is at http://datatracker.ietf.org/drafts/current/.
InternetDrafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use InternetDrafts as reference
material or to cite them other than as "work in progress."
 This InternetDraft will expire on July 19, 2012.
+ This InternetDraft will expire on September 13, 2012.
Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/licenseinfo) in effect on the date of
publication of this document. Please review these documents
@@ 55,36 +55,37 @@
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Cryptographic Algorithms for JWS . . . . . . . . . . . . . . . 3
3.1. Creating a JWS with HMAC SHA256, HMAC SHA384, or
HMAC SHA512 . . . . . . . . . . . . . . . . . . . . . . . 4
3.2. Creating a JWS with RSA SHA256, RSA SHA384, or RSA
SHA512 . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3. Creating a JWS with ECDSA P256 SHA256, ECDSA P384
SHA384, or ECDSA P521 SHA512 . . . . . . . . . . . . . 6
 3.4. Additional Digital Signature/HMAC Algorithms . . . . . . . 7
 4. Cryptographic Algorithms for JWE . . . . . . . . . . . . . . . 7
+ 3.4. Creating a Plaintext JWS . . . . . . . . . . . . . . . . . 7
+ 3.5. Additional Digital Signature/HMAC Algorithms . . . . . . . 7
+ 4. Cryptographic Algorithms for JWE . . . . . . . . . . . . . . . 8
4.1. Encrypting a JWE with TBD . . . . . . . . . . . . . . . . 9
4.2. Additional Encryption Algorithms . . . . . . . . . . . . . 9
 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9
+ 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10
6. Security Considerations . . . . . . . . . . . . . . . . . . . 10
7. Open Issues and Things To Be Done (TBD) . . . . . . . . . . . 10
8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 11
8.1. Normative References . . . . . . . . . . . . . . . . . . . 11
8.2. Informative References . . . . . . . . . . . . . . . . . . 12
Appendix A. Digital Signature/HMAC Algorithm Identifier
CrossReference . . . . . . . . . . . . . . . . . . . 13
Appendix B. Encryption Algorithm Identifier CrossReference . . . 15
 Appendix C. Acknowledgements . . . . . . . . . . . . . . . . . . 18
 Appendix D. Document History . . . . . . . . . . . . . . . . . . 18
 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 18
+ Appendix C. Acknowledgements . . . . . . . . . . . . . . . . . . 19
+ Appendix D. Document History . . . . . . . . . . . . . . . . . . 19
+ Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 19
1. Introduction
The JSON Web Algorithms (JWA) specification enumerates cryptographic
algorithms and identifiers to be used with the JSON Web Signature
(JWS) [JWS] and JSON Web Encryption (JWE) [JWE] specifications.
Enumerating the algorithms and identifiers for them in this
specification, rather than in the JWS and JWE specifications, is
intended to allow them to remain unchanged in the face of changes in
the set of required, recommended, optional, and deprecated algorithms
@@ 117,29 +118,31 @@
 HS512  HMAC using SHA512 hash algorithm 
 RS256  RSA using SHA256 hash algorithm 
 RS384  RSA using SHA384 hash algorithm 
 RS512  RSA using SHA512 hash algorithm 
 ES256  ECDSA using P256 curve and SHA256 hash 
  algorithm 
 ES384  ECDSA using P384 curve and SHA384 hash 
  algorithm 
 ES512  ECDSA using P521 curve and SHA512 hash 
  algorithm 
+  none  No digital signature or HMAC value included 
+++
+
Table 1: JWS Defined "alg" Parameter Values
See Appendix A for a table crossreferencing the digital signature
and HMAC "alg" (algorithm) values used in this specification with the
equivalent identifiers used by other standards and software packages.
 Of these algorithms, only HMAC SHA256 MUST be implemented by
 conforming JWS implementations. It is RECOMMENDED that
+ Of these algorithms, only HMAC SHA256 and "none" MUST be implemented
+ by conforming JWS implementations. It is RECOMMENDED that
implementations also support the RSA SHA256 and ECDSA P256 SHA256
algorithms. Support for other algorithms and key sizes is OPTIONAL.
3.1. Creating a JWS with HMAC SHA256, HMAC SHA384, or HMAC SHA512
Hash based Message Authentication Codes (HMACs) enable one to use a
secret plus a cryptographic hash function to generate a Message
Authentication Code (MAC). This can be used to demonstrate that the
MAC matches the hashed content, in this case the JWS Secured Input,
which therefore demonstrates that whoever generated the MAC was in
@@ 164,30 +167,35 @@
The output is the Encoded JWS Signature for that JWS.
The HMAC SHA256 MAC for a JWS is validated as follows:
1. Apply the HMAC SHA256 algorithm to the UTF8 representation of
the JWS Secured Input of the JWS using the shared key.
2. Base64url encode the resulting HMAC value.
 3. If the JWS Signature and the base64url encoded HMAC value exactly
 match, then one has confirmation that the shared key was used to
 generate the HMAC on the JWS and that the contents of the JWS
 have not be tampered with.
+ 3. If the Encoded JWS Signature and the base64url encoded HMAC value
+ exactly match, then one has confirmation that the shared key was
+ used to generate the HMAC on the JWS and that the contents of the
+ JWS have not be tampered with.
4. If the validation fails, the JWS MUST be rejected.
+ Alternatively, the Encoded JWS Signature MAY be base64url decoded to
+ produce the JWS Signature and this value can be compared with the
+ computed HMAC value, as this comparison produces the same result as
+ comparing the encoded values.
+
Securing content with the HMAC SHA384 and HMAC SHA512 algorithms is
performed identically to the procedure for HMAC SHA256  just with
 correspondingly longer key and result values.
+ correspondingly longer minimum key sizes and result values.
3.2. Creating a JWS with RSA SHA256, RSA SHA384, or RSA SHA512
This section defines the use of the RSASSAPKCS1v1_5 digital
signature algorithm as defined in RFC 3447 [RFC3447], Section 8.2
(commonly known as PKCS#1), using SHA256, SHA384, or SHA512 as the
hash function. The RSASSAPKCS1v1_5 algorithm is described in FIPS
1863 [FIPS.1863], Section 5.5, and the SHA256, SHA384, and SHA
512 cryptographic hash functions are defined in FIPS 1803
[FIPS.1803]. The "alg" (algorithm) header parameter values "RS256",
@@ 215,21 +223,21 @@
2. Submit the UTF8 representation of the JWS Secured Input and the
public key corresponding to the private key used by the signer to
the RSASSAPKCS1V1_5VERIFY algorithm using SHA256 as the hash
function.
3. If the validation fails, the JWS MUST be rejected.
Signing with the RSA SHA384 and RSA SHA512 algorithms is performed
identically to the procedure for RSA SHA256  just with
 correspondingly longer key and result values.
+ correspondingly longer minimum key sizes and result values.
3.3. Creating a JWS with ECDSA P256 SHA256, ECDSA P384 SHA384, or
ECDSA P521 SHA512
The Elliptic Curve Digital Signature Algorithm (ECDSA) is defined by
FIPS 1863 [FIPS.1863]. ECDSA provides for the use of Elliptic
Curve cryptography, which is able to provide equivalent security to
RSA cryptography but using shorter key lengths and with greater
processing speed. This means that ECDSA digital signatures will be
substantially smaller in terms of length than equivalently strong RSA
@@ 284,23 +292,32 @@
a value referred to as K, which is a random number generated for each
digital signature instance. This means that two ECDSA digital
signatures using exactly the same input parameters will output
different signature values because their K values will be different.
The consequence of this is that one must validate an ECDSA digital
signature by submitting the previously specified inputs to an ECDSA
validator.
Signing with the ECDSA P384 SHA384 and ECDSA P521 SHA512
algorithms is performed identically to the procedure for ECDSA P256
 SHA256  just with correspondingly longer key and result values.
+ SHA256  just with correspondingly longer minimum key sizes and
+ result values.
3.4. Additional Digital Signature/HMAC Algorithms
+3.4. Creating a Plaintext JWS
+
+ To support use cases where the content is secured by a means other
+ than a digital signature or HMAC value, JWSs MAY also be created
+ without them. These are called "Plaintext JWSs". Plaintext JWSs
+ MUST use the "alg" value "none", and are formatted identically to
+ other JWSs, but with an empty JWS Signature value.
+
+3.5. Additional Digital Signature/HMAC Algorithms
Additional algorithms MAY be used to protect JWSs with corresponding
"alg" (algorithm) header parameter values being defined to refer to
them. New "alg" header parameter values SHOULD either be defined in
the IANA JSON Web Signature Algorithms registry or be a URI that
contains a collision resistant namespace. In particular, it is
permissible to use the algorithm identifiers defined in XML DSIG
[RFC3275] and related specifications as "alg" values.
4. Cryptographic Algorithms for JWE
@@ 319,25 +336,28 @@
 Parameter  
 Value  
+++
 RSA1_5  RSA using RSAPKCS11.5 padding, as defined in RFC 
  3447 [RFC3447] 
 RSAOAEP  RSA using Optimal Asymmetric Encryption Padding 
  (OAEP), as defined in RFC 3447 [RFC3447] 
 ECDHES  Elliptic Curve DiffieHellman Ephemeral Static, as 
  defined in RFC 6090 [RFC6090], and using the Concat 
  KDF, as defined in [NIST80056A], where the Digest 
   Method is SHA256 
+   Method is SHA256 and all OtherInfo parameters are 
+   the empty bit string 
 A128KW  Advanced Encryption Standard (AES) Key Wrap Algorithm 
  using 128 bit keys, as defined in RFC 3394 [RFC3394] 
 A256KW  Advanced Encryption Standard (AES) Key Wrap Algorithm 
  using 256 bit keys, as defined in RFC 3394 [RFC3394] 
+  A512KW  Advanced Encryption Standard (AES) Key Wrap Algorithm 
+   using 512 bit keys, as defined in RFC 3394 [RFC3394] 
 A128GCM  Advanced Encryption Standard (AES) using 128 bit keys 
  in Galois/Counter Mode, as defined in [FIPS197] and 
  [NIST80038D] 
 A256GCM  Advanced Encryption Standard (AES) using 256 bit keys 
  in Galois/Counter Mode, as defined in [FIPS197] and 
  [NIST80038D] 
+++
Table 2: JWE Defined "alg" Parameter Values
@@ 361,21 +381,21 @@
  in Galois/Counter Mode, as defined in [FIPS197] and 
  [NIST80038D] 
 A256GCM  Advanced Encryption Standard (AES) using 256 bit keys 
  in Galois/Counter Mode, as defined in [FIPS197] and 
  [NIST80038D] 
+++
Table 3: JWE Defined "enc" Parameter Values
See Appendix B for a table crossreferencing the encryption "alg"
 (algorithm) and "alg" (encryption method) values used in this
+ (algorithm) and "enc" (encryption method) values used in this
specification with the equivalent identifiers used by other standards
and software packages.
Of these algorithms, only RSAPKCS11.5 with 2048 bit keys, AES128
CBC, and AES256CBC MUST be implemented by conforming JWE
implementations. It is RECOMMENDED that implementations also support
ECDHES with 256 bit keys, AES128GCM, and AES256GCM. Support for
other algorithms and key sizes is OPTIONAL.
4.1. Encrypting a JWE with TBD
@@ 395,21 +416,21 @@
[W3C.RECxmlenccore20021210], XML Encryption 1.1
[W3C.CRxmlenccore120110303], and related specifications as "alg"
and "enc" values.
5. IANA Considerations
This specification calls for:
o A new IANA registry entitled "JSON Web Signature Algorithms" for
values of the JWS "alg" (algorithm) header parameter is defined in
 Section 3.4. Inclusion in the registry is RFC Required in the RFC
+ Section 3.5. Inclusion in the registry is RFC Required in the RFC
5226 [RFC5226] sense. The registry will just record the "alg"
value and a pointer to the RFC that defines it. This
specification defines inclusion of the algorithm values defined in
Table 1.
o A new IANA registry entitled "JSON Web Encryption Algorithms" for
values used with the JWE "alg" (algorithm) and "enc" (encryption
method) header parameters is defined in Section 4.2. Inclusion in
the registry is RFC Required in the RFC 5226 [RFC5226] sense. The
registry will record the "alg" or "enc" value and a pointer to the
@@ 417,36 +438,32 @@
algorithm values defined in Table 2 and Table 3.
6. Security Considerations
TBD
7. Open Issues and Things To Be Done (TBD)
The following items remain to be done in this draft:
+ o Specify minimum required key sizes for all algorithms.
+
+ o Specify which algorithms require Initialization Vectors (IVs) and
+ minimum required lengths for those IVs.
+
o Since RFC 3447 Section 8 explicitly calls for people NOT to adopt
RSASSAPKCS1 for new applications and instead requests that people
transition to RSASSAPSS, we probably need some Security
Considerations text explaining why RSASSAPKCS1 is being used
(it's what's commonly implemented) and what the potential
consequences are.
 o Consider having an algorithm that is a MAC using SHA256 that
 provides content integrity but for which there is no associated
 secret. This would be like the JWT "alg":"none", in that no
 validation of the authenticity content is performed but a checksum
 is provided.

 o Consider whether to define "alg":"none" here, rather than in the
 JWT spec.

o Should we define the use of RFC 5649 key wrapping functions, which
allow arbitrary key sizes, in addition to the current use of RFC
3394 key wrapping functions, which require that keys be multiples
of 64 bits? Is this needed in practice?
o Decide whether to move the JWK algorithm family definitions "EC"
and "RSA" here. This would likely result in all the family
specific parameter definitions also moving here ("crv", "x", "y",
"mod", "exp"), leaving very little normative text in the JWK spec
itself. This seems like it would reduce spec readability and so
@@ 471,24 +488,24 @@
[FIPS.1803]
National Institute of Standards and Technology, "Secure
Hash Standard (SHS)", FIPS PUB 1803, October 2008.
[FIPS.1863]
National Institute of Standards and Technology, "Digital
Signature Standard (DSS)", FIPS PUB 1863, June 2009.
[JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web
 Encryption (JWE)", January 2012.
+ Encryption (JWE)", March 2012.
[JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web
 Signature (JWS)", January 2012.
+ Signature (JWS)", March 2012.
[NIST80038A]
National Institute of Standards and Technology (NIST),
"Recommendation for Block Cipher Modes of Operation",
NIST PUB 80038A, December 2001.
[NIST80038D]
National Institute of Standards and Technology (NIST),
"Recommendation for Block Cipher Modes of Operation:
Galois/Counter Mode (GCM) and GMAC", NIST PUB 80038D,
@@ 534,21 +551,21 @@
[JCA] Oracle, "Java Cryptography Architecture", 2011.
[JSE] Bradley, J. and N. Sakimura (editor), "JSON Simple
Encryption", September 2010.
[JSS] Bradley, J. and N. Sakimura (editor), "JSON Simple Sign",
September 2010.
[MagicSignatures]
Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic
 Signatures", August 2010.
+ Signatures", January 2011.
[RFC3275] Eastlake, D., Reagle, J., and D. Solo, "(Extensible Markup
Language) XMLSignature Syntax and Processing", RFC 3275,
March 2002.
[W3C.CRxmlenccore120110303]
Hirsch, F., Roessler, T., Reagle, J., and D. Eastlake,
"XML Encryption Syntax and Processing Version 1.1", World
Wide Web Consortium CR CRxmlenccore120110303,
March 2011,
@@ 713,20 +730,36 @@
 ) Key    
 Wrap    
 Algo    
 rithm R    
 FC 339    
 4 [RF    
 C3394]    
 using25    
 6 bitke    
 ys    
+  Advance  A512K  http://www.w3.org/2001/04  TBD 
+  d  W  /xmlenc#kwaes512  
+  Encryp    
+  tion    
+  Stand    
+  ard(AES    
+  ) Key    
+  Wrap    
+  Algo    
+  rithm R    
+  FC 339    
+  4 [RF    
+  C3394]    
+  using51    
+  2 bitke    
+  ys    
 Advance  A128C  http://www.w3.org/2001/04  AES/CBC/PKCS5Paddin 
 d  BC  /xmlenc#aes128cbc  g 
 Encryp    
 tion    
 Stand    
 ard(AES    
 ) usin    
 g 128    
 bitkeys    
 inCiph    
@@ 784,20 +817,39 @@
explored by Magic Signatures [MagicSignatures], JSON Simple Sign
[JSS], Canvas Applications [CanvasApp], JSON Simple Encryption [JSE],
and JavaScript Message Security Format [ID.rescorlajsms], all of
which influenced this draft. Dirk Balfanz, John Bradley, Yaron Y.
Goland, John Panzer, Nat Sakimura, and Paul Tarjan all made
significant contributions to the design of this specification and its
related specifications.
Appendix D. Document History
+ 01
+
+ o Moved definition of "alg":"none" for JWSs here from the JWT
+ specification since this functionality is likely to be useful in
+ more contexts that just for JWTs.
+
+ o Added Advanced Encryption Standard (AES) Key Wrap Algorithm using
+ 512 bit keys ("A512KW").
+
+ o Added text "Alternatively, the Encoded JWS Signature MAY be
+ base64url decoded to produce the JWS Signature and this value can
+ be compared with the computed HMAC value, as this comparison
+ produces the same result as comparing the encoded values".
+
+ o Corrected the Magic Signatures reference.
+
+ o Made other editorial improvements suggested by JOSE working group
+ participants.
+
00
o Created the initial IETF draft based upon
draftjonesjsonwebsignature04 and
draftjonesjsonwebencryption02 with no normative changes.
o Changed terminology to no longer call both digital signatures and
HMACs "signatures".
Author's Address