Subject: [jose] Second compute JWE computation example

From: Mike Jones <[email-masked]>
Date: Fri, 29 Jun 2012 15:20:50 +0000

Dear working group members,

A second complete JWE computation example is included below.  As I'd previously written, I'm adding example encryption computations to the JWE spec to aid implementers.  These values have been verified by two independent implementations.

This example uses the header values:
    {"alg":"RSA-OAEP","enc":"A256GCM","iv":"48V1_ALb6US04U3b"}

This example verifies both the use of RSA-OAEP and the use of AES-GCM - including the use of the Additional Authenticated Data parameter and the Authentication Tag output.

Note that because the RSA-OAEP computation uses random values, the encrypted key computation will not be repeatable, although all resulting values will be decryptable to retrieve the original key value.

I'd be interested in hearing results from any of you who also try this JWE with your implementation.

                                                            Enjoy,
                                                            -- Mike

CMK (CEK)
[177, 161, 244, 128, 84, 143, 225, 115, 63, 180, 3, 255, 107, 154, 212, 246,
138, 7, 110, 91, 112, 46, 34, 105, 47, 130, 203, 46, 122, 234, 64, 252]
IV
[227, 197, 117, 252, 2, 219, 233, 68, 180, 225, 77, 219]
Plaintext
[76, 105, 118, 101, 32, 108, 111, 110, 103, 32, 97, 110, 100, 32, 112, 114,
111, 115, 112, 101, 114, 46]
Header
{"alg":"RSA-OAEP","enc":"A256GCM","iv":"48V1_ALb6US04U3b"}
Header Bytes
[123, 34, 97, 108, 103, 34, 58, 34, 82, 83, 65, 45, 79, 65, 69, 80,
34, 44, 34, 101, 110, 99, 34, 58, 34, 65, 50, 53, 54, 71, 67, 77,
34, 44, 34, 105, 118, 34, 58, 34, 52, 56, 86, 49, 95, 65, 76, 98,
54, 85, 83, 48, 52, 85, 51, 98, 34, 125]
Encoded Header
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00iLCJpdiI6IjQ4VjFfQUxiNlVTMDRVM2IifQ
BEGIN RSA KEY PARAMETERS
Exponent
[1, 0, 1]
Modulus
[161, 168, 84, 34, 133, 176, 208, 173, 46, 176, 163, 110, 57, 30, 135, 227,
9, 31, 226, 128, 84, 92, 116, 241, 70, 248, 27, 227, 193, 62, 5, 91,
241, 145, 224, 205, 141, 176, 184, 133, 239, 43, 81, 103, 9, 161, 153, 157,
179, 104, 123, 51, 189, 34, 152, 69, 97, 69, 78, 93, 140, 131, 87, 182,
169, 101, 92, 142, 3, 22, 167, 8, 212, 56, 35, 79, 210, 222, 192, 208,
252, 49, 109, 138, 173, 253, 210, 166, 201, 63, 102, 74, 5, 158, 41, 90,
144, 108, 160, 79, 10, 89, 222, 231, 172, 31, 227, 197, 0, 19, 72, 81,
138, 78, 136, 221, 121, 118, 196, 17, 146, 10, 244, 188, 72, 113, 55, 221,
162, 217, 171, 27, 57, 233, 210, 101, 236, 154, 199, 56, 138, 239, 101, 48,
198, 186, 202, 160, 76, 111, 234, 71, 57, 183, 5, 211, 171, 136, 126, 64,
40, 75, 58, 89, 244, 254, 107, 84, 103, 7, 236, 69, 163, 18, 180, 251,
58, 153, 46, 151, 174, 12, 103, 197, 181, 161, 162, 55, 250, 235, 123, 110,
17, 11, 158, 24, 47, 133, 8, 199, 235, 107, 126, 130, 246, 73, 195, 20,
108, 202, 176, 214, 187, 45, 146, 182, 118, 54, 32, 200, 61, 201, 71, 243,
1, 255, 131, 84, 37, 111, 211, 168, 228, 45, 192, 118, 27, 197, 235, 232,
36, 10, 230, 248, 190, 82, 182, 140, 35, 204, 108, 190, 253, 186, 186, 27]
D (private key exponent)
[144, 183, 109, 34, 62, 134, 108, 57, 44, 252, 10, 66, 73, 54, 16, 181,
233, 92, 54, 219, 101, 42, 35, 178, 63, 51, 43, 92, 119, 136, 251, 41,
53, 23, 191, 164, 164, 60, 88, 227, 229, 152, 228, 213, 149, 228, 169, 237,
104, 71, 151, 75, 88, 252, 216, 77, 251, 231, 28, 97, 88, 193, 215, 202,
248, 216, 121, 195, 211, 245, 250, 112, 71, 243, 61, 129, 95, 39, 244, 122,
225, 217, 169, 211, 165, 48, 253, 220, 59, 122, 219, 42, 86, 223, 32, 236,
39, 48, 103, 78, 122, 216, 187, 88, 176, 89, 24, 1, 42, 177, 24, 99,
142, 170, 1, 146, 43, 3, 108, 64, 194, 121, 182, 95, 187, 134, 71, 88,
96, 134, 74, 131, 167, 69, 106, 143, 121, 27, 72, 44, 245, 95, 39, 194,
179, 175, 203, 122, 16, 112, 183, 17, 200, 202, 31, 17, 138, 156, 184, 210,
157, 184, 154, 131, 128, 110, 12, 85, 195, 122, 241, 79, 251, 229, 183, 117,
21, 123, 133, 142, 220, 153, 9, 59, 57, 105, 81, 255, 138, 77, 82, 54,
62, 216, 38, 249, 208, 17, 197, 49, 45, 19, 232, 157, 251, 131, 137, 175,
72, 126, 43, 229, 69, 179, 117, 82, 157, 213, 83, 35, 57, 210, 197, 252,
171, 143, 194, 11, 47, 163, 6, 253, 75, 252, 96, 11, 187, 84, 130, 210,
7, 121, 78, 91, 79, 57, 251, 138, 132, 220, 60, 224, 173, 56, 224, 201]
The remaining RSA key parameters are included for completeness, but should not be needed
DP
[100, 175, 152, 192, 78, 221, 137, 72, 116, 169, 29, 109, 71, 188, 60, 88,
123, 104, 148, 60, 119, 49, 159, 206, 78, 140, 34, 22, 248, 31, 121, 13,
210, 138, 183, 172, 94, 57, 189, 129, 158, 74, 46, 19, 23, 190, 143, 174,
207, 226, 148, 37, 96, 241, 75, 154, 69, 67, 243, 52, 122, 247, 104, 213,
210, 162, 69, 56, 213, 195, 252, 120, 55, 42, 178, 92, 243, 57, 157, 66,
207, 145, 202, 84, 243, 110, 235, 158, 150, 115, 0, 146, 169, 118, 21, 128,
130, 170, 215, 24, 160, 4, 9, 1, 244, 94, 222, 45, 107, 57, 227, 157,
223, 243, 86, 144, 38, 101, 154, 186, 209, 99, 204, 4, 199, 202, 114, 225]
DQ
[14, 173, 32, 126, 2, 117, 13, 209, 70, 94, 34, 239, 64, 70, 103, 184,
161, 13, 209, 69, 38, 176, 144, 113, 146, 60, 157, 115, 120, 248, 101, 135,
65, 136, 196, 64, 203, 206, 177, 210, 241, 194, 143, 44, 28, 50, 86, 24,
131, 140, 168, 11, 134, 25, 107, 216, 77, 85, 203, 35, 168, 13, 197, 122,
34, 245, 246, 185, 60, 131, 164, 39, 219, 212, 237, 209, 200, 252, 170, 172,
133, 167, 63, 111, 52, 48, 84, 124, 32, 34, 37, 87, 132, 72, 232, 201,
13, 147, 216, 29, 209, 216, 242, 253, 91, 250, 143, 153, 217, 126, 109, 188,
188, 126, 76, 39, 164, 127, 186, 49, 201, 226, 131, 82, 162, 150, 142, 43]
InverseQ
[84, 131, 41, 49, 134, 207, 127, 142, 221, 79, 92, 63, 204, 53, 23, 124,
248, 166, 177, 39, 160, 156, 195, 128, 215, 52, 218, 95, 182, 134, 147, 255,
46, 173, 142, 145, 243, 230, 86, 212, 92, 84, 236, 9, 86, 3, 34, 214,
201, 186, 170, 234, 221, 122, 84, 87, 123, 133, 7, 116, 203, 167, 229, 80,
174, 18, 148, 236, 157, 7, 173, 96, 193, 169, 206, 177, 113, 142, 0, 235,
252, 217, 193, 234, 208, 77, 222, 47, 129, 235, 181, 153, 20, 184, 171, 231,
62, 179, 39, 177, 69, 5, 149, 245, 29, 201, 181, 115, 199, 40, 243, 244,
145, 127, 95, 38, 152, 215, 134, 171, 116, 180, 163, 127, 130, 255, 20, 214]
P
[214, 190, 118, 94, 78, 58, 115, 226, 236, 124, 30, 79, 227, 141, 169, 237,
171, 93, 61, 74, 241, 65, 44, 184, 154, 216, 191, 181, 146, 55, 50, 7,
246, 18, 225, 85, 109, 74, 3, 6, 246, 145, 67, 228, 150, 198, 70, 228,
154, 129, 51, 47, 178, 87, 174, 132, 129, 141, 42, 202, 221, 130, 16, 129,
135, 76, 131, 32, 4, 61, 51, 227, 94, 255, 225, 35, 111, 245, 121, 52,
143, 85, 151, 243, 47, 73, 95, 124, 217, 244, 220, 133, 234, 88, 94, 76,
12, 91, 168, 81, 129, 52, 135, 54, 246, 190, 26, 229, 55, 250, 202, 173,
183, 195, 35, 5, 27, 78, 184, 227, 130, 39, 145, 111, 0, 186, 10, 93]
Q
[192, 182, 247, 231, 30, 225, 153, 5, 153, 177, 98, 102, 7, 251, 229, 123,
206, 226, 134, 6, 117, 245, 47, 37, 4, 68, 78, 44, 139, 25, 27, 134,
178, 101, 87, 189, 30, 47, 96, 13, 80, 142, 6, 101, 3, 117, 160, 216,
85, 52, 141, 199, 255, 5, 203, 13, 88, 97, 175, 87, 26, 177, 167, 13,
236, 52, 208, 157, 188, 113, 21, 40, 120, 16, 127, 140, 162, 53, 162, 102,
180, 58, 187, 245, 79, 214, 151, 33, 108, 74, 193, 222, 32, 191, 17, 72,
152, 229, 171, 221, 4, 75, 244, 161, 1, 71, 57, 54, 69, 171, 84, 6,
121, 131, 100, 148, 200, 1, 252, 19, 179, 72, 58, 241, 70, 71, 190, 215]
END RSA KEY PARAMETERS
Encrypted Key
[142, 252, 40, 202, 21, 177, 56, 198, 232, 7, 151, 49, 95, 169, 220, 2,
46, 214, 167, 116, 57, 20, 164, 109, 150, 98, 49, 223, 154, 95, 71, 209,
233, 17, 174, 142, 203, 232, 132, 167, 17, 42, 51, 125, 22, 221, 135, 17,
67, 197, 148, 246, 139, 145, 160, 238, 99, 119, 171, 95, 117, 202, 87, 251,
101, 254, 58, 215, 135, 195, 135, 103, 49, 119, 76, 46, 49, 198, 27, 31,
58, 44, 192, 222, 21, 16, 13, 216, 161, 179, 236, 65, 143, 38, 43, 218,
195, 76, 140, 243, 71, 243, 79, 124, 216, 208, 242, 171, 34, 245, 57, 154,
93, 76, 230, 204, 234, 82, 117, 248, 39, 13, 62, 60, 215, 8, 51, 248,
254, 47, 150, 36, 46, 27, 247, 98, 77, 56, 92, 44, 19, 39, 12, 77,
54, 101, 194, 126, 86, 0, 64, 239, 95, 211, 64, 26, 219, 93, 211, 36,
154, 250, 117, 177, 213, 232, 142, 184, 216, 92, 20, 248, 69, 175, 180, 71,
205, 221, 235, 224, 95, 113, 5, 33, 86, 18, 157, 61, 199, 8, 121, 0,
0, 135, 65, 67, 220, 164, 15, 230, 155, 71, 53, 64, 253, 209, 169, 255,
34, 64, 101, 7, 43, 102, 227, 83, 171, 52, 225, 119, 253, 182, 96, 195,
225, 34, 156, 211, 202, 7, 194, 255, 137, 59, 170, 172, 72, 234, 222, 203,
123, 249, 121, 254, 143, 173, 105, 65, 187, 189, 163, 64, 151, 145, 99, 17]
Encoded Encrypted Key
jvwoyhWxOMboB5cxX6ncAi7Wp3Q5FKRtlmIx35pfR9HpEa6Oy-iEpxEqM30W3YcRQ8WU9ouRoO5jd6tfdcpX-2X-OteHw4dnMXdMLjHGGx86LMDeFRAN2KGz7EGPJivaw0yM80fzT3zY0PKrIvU5ml1M5szqUnX4Jw0-PNcIM_j-L5YkLhv3Yk04XCwTJwxNNmXCflYAQO9f00Aa213TJJr6dbHV6I642FwU-EWvtEfN3evgX3EFIVYSnT3HCHkAAIdBQ9ykD-abRzVA_dGp_yJAZQcrZuNTqzThd_22YMPhIpzTygfC_4k7qqxI6t7Le_l5_o-taUG7vaNAl5FjEQ
Additional Authenticated Data
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00iLCJpdiI6IjQ4VjFfQUxiNlVTMDRVM2IifQ.jvwoyhWxOMboB5cxX6ncAi7Wp3Q5FKRtlmIx35pfR9HpEa6Oy-iEpxEqM30W3YcRQ8WU9ouRoO5jd6tfdcpX-2X-OteHw4dnMXdMLjHGGx86LMDeFRAN2KGz7EGPJivaw0yM80fzT3zY0PKrIvU5ml1M5szqUnX4Jw0-PNcIM_j-L5YkLhv3Yk04XCwTJwxNNmXCflYAQO9f00Aa213TJJr6dbHV6I642FwU-EWvtEfN3evgX3EFIVYSnT3HCHkAAIdBQ9ykD-abRzVA_dGp_yJAZQcrZuNTqzThd_22YMPhIpzTygfC_4k7qqxI6t7Le_l5_o-taUG7vaNAl5FjEQ
Additional Authenticated Data Bytes
[101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 83, 85, 48, 69, 116,
84, 48, 70, 70, 85, 67, 73, 115, 73, 109, 86, 117, 89, 121, 73, 54,
73, 107, 69, 121, 78, 84, 90, 72, 81, 48, 48, 105, 76, 67, 74, 112,
100, 105, 73, 54, 73, 106, 81, 52, 86, 106, 70, 102, 81, 85, 120, 105,
78, 108, 86, 84, 77, 68, 82, 86, 77, 50, 73, 105, 102, 81, 46, 106,
118, 119, 111, 121, 104, 87, 120, 79, 77, 98, 111, 66, 53, 99, 120, 88,
54, 110, 99, 65, 105, 55, 87, 112, 51, 81, 53, 70, 75, 82, 116, 108,
109, 73, 120, 51, 53, 112, 102, 82, 57, 72, 112, 69, 97, 54, 79, 121,
45, 105, 69, 112, 120, 69, 113, 77, 51, 48, 87, 51, 89, 99, 82, 81,
56, 87, 85, 57, 111, 117, 82, 111, 79, 53, 106, 100, 54, 116, 102, 100,
99, 112, 88, 45, 50, 88, 45, 79, 116, 101, 72, 119, 52, 100, 110, 77,
88, 100, 77, 76, 106, 72, 71, 71, 120, 56, 54, 76, 77, 68, 101, 70,
82, 65, 78, 50, 75, 71, 122, 55, 69, 71, 80, 74, 105, 118, 97, 119,
48, 121, 77, 56, 48, 102, 122, 84, 51, 122, 89, 48, 80, 75, 114, 73,
118, 85, 53, 109, 108, 49, 77, 53, 115, 122, 113, 85, 110, 88, 52, 74,
119, 48, 45, 80, 78, 99, 73, 77, 95, 106, 45, 76, 53, 89, 107, 76,
104, 118, 51, 89, 107, 48, 52, 88, 67, 119, 84, 74, 119, 120, 78, 78,
109, 88, 67, 102, 108, 89, 65, 81, 79, 57, 102, 48, 48, 65, 97, 50,
49, 51, 84, 74, 74, 114, 54, 100, 98, 72, 86, 54, 73, 54, 52, 50,
70, 119, 85, 45, 69, 87, 118, 116, 69, 102, 78, 51, 101, 118, 103, 88,
51, 69, 70, 73, 86, 89, 83, 110, 84, 51, 72, 67, 72, 107, 65, 65,
73, 100, 66, 81, 57, 121, 107, 68, 45, 97, 98, 82, 122, 86, 65, 95,
100, 71, 112, 95, 121, 74, 65, 90, 81, 99, 114, 90, 117, 78, 84, 113,
122, 84, 104, 100, 95, 50, 50, 89, 77, 80, 104, 73, 112, 122, 84, 121,
103, 102, 67, 95, 52, 107, 55, 113, 113, 120, 73, 54, 116, 55, 76, 101,
95, 108, 53, 95, 111, 45, 116, 97, 85, 71, 55, 118, 97, 78, 65, 108,
53, 70, 106, 69, 81]
Ciphertext
[253, 237, 181, 180, 97, 161, 105, 207, 233, 120, 65, 100, 45, 122, 246, 116,
195, 212, 102, 37, 36, 175]
Encoded Ciphertext
_e21tGGhac_peEFkLXr2dMPUZiUkrw
Authentication Tag (Integrity Value)
[97, 182, 82, 120, 112, 141, 13, 144, 106, 1, 220, 233, 68, 233, 114, 139]
Encoded Authentication Tag (Encoded Integrity Value)
YbZSeHCNDZBqAdzpROlyiw
JWE
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00iLCJpdiI6IjQ4VjFfQUxiNlVTMDRVM2IifQ.jvwoyhWxOMboB5cxX6ncAi7Wp3Q5FKRtlmIx35pfR9HpEa6Oy-iEpxEqM30W3YcRQ8WU9ouRoO5jd6tfdcpX-2X-OteHw4dnMXdMLjHGGx86LMDeFRAN2KGz7EGPJivaw0yM80fzT3zY0PKrIvU5ml1M5szqUnX4Jw0-PNcIM_j-L5YkLhv3Yk04XCwTJwxNNmXCflYAQO9f00Aa213TJJr6dbHV6I642FwU-EWvtEfN3evgX3EFIVYSnT3HCHkAAIdBQ9ykD-abRzVA_dGp_yJAZQcrZuNTqzThd_22YMPhIpzTygfC_4k7qqxI6t7Le_l5_o-taUG7vaNAl5FjEQ._e21tGGhac_peEFkLXr2dMPUZiUkrw.YbZSeHCNDZBqAdzpROlyiw

---

From: "Richard L. Barnes" <[email-masked]>
Date: Fri, 29 Jun 2012 13:20:00 -0400

This seems underspecified.  What parameters are you using for OAEP?  IIRC, it requires a digest algorithm and a masking generation function.  I don't see either of those specified in JWS or JWA.

On Jun 29, 2012, at 11:20 AM, Mike Jones wrote:

> A second complete JWE computation example is included below.  As I’d previously written, I’m adding example encryption computations to the JWE spec to aid implementers.  These values have been verified by two independent implementations.
>  
> This example verifies both the use of RSA-OAEP and the use of AES-GCM – including the use of the Additional Authenticated Data parameter and the Authentication Tag output.
>  
> I’d be interested in hearing results from any of you who also try this JWE with your implementation.
>  
>                                                             Enjoy,
>                                                             -- Mike
>  
> CMK (CEK)
> <JWE2.log>_______________________________________________
> jose mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/jose

---

From: Mike Jones <[email-masked]>
Date: Fri, 29 Jun 2012 17:48:06 +0000

Good catch.  I'll add to the JWA spec that RSA-OAEP specifies the use of OAEP padding with the default parameters defined by PKCS #1 v2.1 (RFC 3447) in Section A.2.1.

				-- Mike

-----Original Message-----
From: Richard L. Barnes [mailto:[email-masked]] 
Sent: Friday, June 29, 2012 10:20 AM
To: Mike Jones
Cc: [email-masked]
Subject: Re: [jose] Second compute JWE computation example

On Jun 29, 2012, at 11:20 AM, Mike Jones wrote:

> [177, 161, 244, 128, 84, 143, 225, 115, 63, 180, 3, 255, 107, 154, 
> 212, 246, 138, 7, 110, 91, 112, 46, 34, 105, 47, 130, 203, 46, 122, 
> 234, 64, 252] IV [227, 197, 117, 252, 2, 219, 233, 68, 180, 225, 77, 
> 219] Plaintext [76, 105, 118, 101, 32, 108, 111, 110, 103, 32, 97, 
> 110, 100, 32, 112, 114, 111, 115, 112, 101, 114, 46] Header 
> 34, 44, 34, 101, 110, 99, 34, 58, 34, 65, 50, 53, 54, 71, 67, 77, 34, 
> 44, 34, 105, 118, 34, 58, 34, 52, 56, 86, 49, 95, 65, 76, 98, 54, 85, 
> 83, 48, 52, 85, 51, 98, 34, 125] Encoded Header 
> [161, 168, 84, 34, 133, 176, 208, 173, 46, 176, 163, 110, 57, 30, 135, 
> 227, 9, 31, 226, 128, 84, 92, 116, 241, 70, 248, 27, 227, 193, 62, 5, 
> 91, 241, 145, 224, 205, 141, 176, 184, 133, 239, 43, 81, 103, 9, 161, 
> 153, 157, 179, 104, 123, 51, 189, 34, 152, 69, 97, 69, 78, 93, 140, 
> 131, 87, 182, 169, 101, 92, 142, 3, 22, 167, 8, 212, 56, 35, 79, 210, 
> 222, 192, 208, 252, 49, 109, 138, 173, 253, 210, 166, 201, 63, 102, 
> 74, 5, 158, 41, 90, 144, 108, 160, 79, 10, 89, 222, 231, 172, 31, 227, 
> 197, 0, 19, 72, 81, 138, 78, 136, 221, 121, 118, 196, 17, 146, 10, 
> 244, 188, 72, 113, 55, 221, 162, 217, 171, 27, 57, 233, 210, 101, 236, 
> 154, 199, 56, 138, 239, 101, 48, 198, 186, 202, 160, 76, 111, 234, 71, 
> 57, 183, 5, 211, 171, 136, 126, 64, 40, 75, 58, 89, 244, 254, 107, 84, 
> 103, 7, 236, 69, 163, 18, 180, 251, 58, 153, 46, 151, 174, 12, 103, 
> 197, 181, 161, 162, 55, 250, 235, 123, 110, 17, 11, 158, 24, 47, 133, 
> 8, 199, 235, 107, 126, 130, 246, 73, 195, 20, 108, 202, 176, 214, 187, 
> 45, 146, 182, 118, 54, 32, 200, 61, 201, 71, 243, 1, 255, 131, 84, 37, 
> 111, 211, 168, 228, 45, 192, 118, 27, 197, 235, 232, 36, 10, 230, 248, 
> 190, 82, 182, 140, 35, 204, 108, 190, 253, 186, 186, 27] D (private 
> key exponent) [144, 183, 109, 34, 62, 134, 108, 57, 44, 252, 10, 66, 
> 73, 54, 16, 181, 233, 92, 54, 219, 101, 42, 35, 178, 63, 51, 43, 92, 
> 119, 136, 251, 41, 53, 23, 191, 164, 164, 60, 88, 227, 229, 152, 228, 
> 213, 149, 228, 169, 237, 104, 71, 151, 75, 88, 252, 216, 77, 251, 231, 
> 28, 97, 88, 193, 215, 202, 248, 216, 121, 195, 211, 245, 250, 112, 71, 
> 243, 61, 129, 95, 39, 244, 122, 225, 217, 169, 211, 165, 48, 253, 220, 
> 59, 122, 219, 42, 86, 223, 32, 236, 39, 48, 103, 78, 122, 216, 187, 
> 88, 176, 89, 24, 1, 42, 177, 24, 99, 142, 170, 1, 146, 43, 3, 108, 64, 
> 194, 121, 182, 95, 187, 134, 71, 88, 96, 134, 74, 131, 167, 69, 106, 
> 143, 121, 27, 72, 44, 245, 95, 39, 194, 179, 175, 203, 122, 16, 112, 
> 183, 17, 200, 202, 31, 17, 138, 156, 184, 210, 157, 184, 154, 131, 
> 128, 110, 12, 85, 195, 122, 241, 79, 251, 229, 183, 117, 21, 123, 133, 
> 142, 220, 153, 9, 59, 57, 105, 81, 255, 138, 77, 82, 54, 62, 216, 38, 
> 249, 208, 17, 197, 49, 45, 19, 232, 157, 251, 131, 137, 175, 72, 126, 
> 43, 229, 69, 179, 117, 82, 157, 213, 83, 35, 57, 210, 197, 252, 171, 
> 143, 194, 11, 47, 163, 6, 253, 75, 252, 96, 11, 187, 84, 130, 210, 7, 
> 121, 78, 91, 79, 57, 251, 138, 132, 220, 60, 224, 173, 56, 224, 201] 
> The remaining RSA key parameters are included for completeness, but 
> should not be needed DP [100, 175, 152, 192, 78, 221, 137, 72, 116, 
> 169, 29, 109, 71, 188, 60, 88, 123, 104, 148, 60, 119, 49, 159, 206, 
> 78, 140, 34, 22, 248, 31, 121, 13, 210, 138, 183, 172, 94, 57, 189, 
> 129, 158, 74, 46, 19, 23, 190, 143, 174, 207, 226, 148, 37, 96, 241, 
> 75, 154, 69, 67, 243, 52, 122, 247, 104, 213, 210, 162, 69, 56, 213, 
> 195, 252, 120, 55, 42, 178, 92, 243, 57, 157, 66, 207, 145, 202, 84, 
> 243, 110, 235, 158, 150, 115, 0, 146, 169, 118, 21, 128, 130, 170, 
> 215, 24, 160, 4, 9, 1, 244, 94, 222, 45, 107, 57, 227, 157, 223, 243, 
> 86, 144, 38, 101, 154, 186, 209, 99, 204, 4, 199, 202, 114, 225] DQ 
> 161, 13, 209, 69, 38, 176, 144, 113, 146, 60, 157, 115, 120, 248, 101, 
> 135, 65, 136, 196, 64, 203, 206, 177, 210, 241, 194, 143, 44, 28, 50, 
> 86, 24, 131, 140, 168, 11, 134, 25, 107, 216, 77, 85, 203, 35, 168, 
> 13, 197, 122, 34, 245, 246, 185, 60, 131, 164, 39, 219, 212, 237, 209, 
> 200, 252, 170, 172, 133, 167, 63, 111, 52, 48, 84, 124, 32, 34, 37, 
> 87, 132, 72, 232, 201, 13, 147, 216, 29, 209, 216, 242, 253, 91, 250, 
> 143, 153, 217, 126, 109, 188, 188, 126, 76, 39, 164, 127, 186, 49, 
> 201, 226, 131, 82, 162, 150, 142, 43] InverseQ [84, 131, 41, 49, 134, 
> 207, 127, 142, 221, 79, 92, 63, 204, 53, 23, 124, 248, 166, 177, 39, 
> 160, 156, 195, 128, 215, 52, 218, 95, 182, 134, 147, 255, 46, 173, 
> 142, 145, 243, 230, 86, 212, 92, 84, 236, 9, 86, 3, 34, 214, 201, 186, 
> 170, 234, 221, 122, 84, 87, 123, 133, 7, 116, 203, 167, 229, 80, 174, 
> 18, 148, 236, 157, 7, 173, 96, 193, 169, 206, 177, 113, 142, 0, 235, 
> 252, 217, 193, 234, 208, 77, 222, 47, 129, 235, 181, 153, 20, 184, 
> 171, 231, 62, 179, 39, 177, 69, 5, 149, 245, 29, 201, 181, 115, 199, 
> 40, 243, 244, 145, 127, 95, 38, 152, 215, 134, 171, 116, 180, 163, 
> 127, 130, 255, 20, 214] P [214, 190, 118, 94, 78, 58, 115, 226, 236, 
> 124, 30, 79, 227, 141, 169, 237, 171, 93, 61, 74, 241, 65, 44, 184, 
> 154, 216, 191, 181, 146, 55, 50, 7, 246, 18, 225, 85, 109, 74, 3, 6, 
> 246, 145, 67, 228, 150, 198, 70, 228, 154, 129, 51, 47, 178, 87, 174, 
> 132, 129, 141, 42, 202, 221, 130, 16, 129, 135, 76, 131, 32, 4, 61, 
> 51, 227, 94, 255, 225, 35, 111, 245, 121, 52, 143, 85, 151, 243, 47, 
> 73, 95, 124, 217, 244, 220, 133, 234, 88, 94, 76, 12, 91, 168, 81, 
> 129, 52, 135, 54, 246, 190, 26, 229, 55, 250, 202, 173, 183, 195, 35, 
> 5, 27, 78, 184, 227, 130, 39, 145, 111, 0, 186, 10, 93] Q [192, 182, 
> 247, 231, 30, 225, 153, 5, 153, 177, 98, 102, 7, 251, 229, 123, 206, 
> 226, 134, 6, 117, 245, 47, 37, 4, 68, 78, 44, 139, 25, 27, 134, 178, 
> 101, 87, 189, 30, 47, 96, 13, 80, 142, 6, 101, 3, 117, 160, 216, 85, 
> 52, 141, 199, 255, 5, 203, 13, 88, 97, 175, 87, 26, 177, 167, 13, 236, 
> 52, 208, 157, 188, 113, 21, 40, 120, 16, 127, 140, 162, 53, 162, 102, 
> 180, 58, 187, 245, 79, 214, 151, 33, 108, 74, 193, 222, 32, 191, 17, 
> 72, 152, 229, 171, 221, 4, 75, 244, 161, 1, 71, 57, 54, 69, 171, 84, 
> 6, 121, 131, 100, 148, 200, 1, 252, 19, 179, 72, 58, 241, 70, 71, 190, 
> 215] END RSA KEY PARAMETERS Encrypted Key [142, 252, 40, 202, 21, 177, 
> 56, 198, 232, 7, 151, 49, 95, 169, 220, 2, 46, 214, 167, 116, 57, 20, 
> 164, 109, 150, 98, 49, 223, 154, 95, 71, 209, 233, 17, 174, 142, 203, 
> 232, 132, 167, 17, 42, 51, 125, 22, 221, 135, 17, 67, 197, 148, 246, 
> 139, 145, 160, 238, 99, 119, 171, 95, 117, 202, 87, 251, 101, 254, 58, 
> 215, 135, 195, 135, 103, 49, 119, 76, 46, 49, 198, 27, 31, 58, 44, 
> 192, 222, 21, 16, 13, 216, 161, 179, 236, 65, 143, 38, 43, 218, 195, 
> 76, 140, 243, 71, 243, 79, 124, 216, 208, 242, 171, 34, 245, 57, 154, 
> 254, 47, 150, 36, 46, 27, 247, 98, 77, 56, 92, 44, 19, 39, 12, 77, 54, 
> 101, 194, 126, 86, 0, 64, 239, 95, 211, 64, 26, 219, 93, 211, 36, 154, 
> 250, 117, 177, 213, 232, 142, 184, 216, 92, 20, 248, 69, 175, 180, 71, 
> 0, 135, 65, 67, 220, 164, 15, 230, 155, 71, 53, 64, 253, 209, 169, 
> 255, 34, 64, 101, 7, 43, 102, 227, 83, 171, 52, 225, 119, 253, 182, 
> 96, 195, 225, 34, 156, 211, 202, 7, 194, 255, 137, 59, 170, 172, 72, 
> 234, 222, 203, 123, 249, 121, 254, 143, 173, 105, 65, 187, 189, 163, 
> 64, 151, 145, 99, 17] Encoded Encrypted Key 
> jvwoyhWxOMboB5cxX6ncAi7Wp3Q5FKRtlmIx35pfR9HpEa6Oy-iEpxEqM30W3YcRQ8WU9o
> uRoO5jd6tfdcpX-2X-OteHw4dnMXdMLjHGGx86LMDeFRAN2KGz7EGPJivaw0yM80fzT3zY
> 0PKrIvU5ml1M5szqUnX4Jw0-PNcIM_j-L5YkLhv3Yk04XCwTJwxNNmXCflYAQO9f00Aa21
> 3TJJr6dbHV6I642FwU-EWvtEfN3evgX3EFIVYSnT3HCHkAAIdBQ9ykD-abRzVA_dGp_yJA
> ZQcrZuNTqzThd_22YMPhIpzTygfC_4k7qqxI6t7Le_l5_o-taUG7vaNAl5FjEQ
> eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00iLCJpdiI6IjQ4VjFfQUxiNlVTMD
> RVM2IifQ.jvwoyhWxOMboB5cxX6ncAi7Wp3Q5FKRtlmIx35pfR9HpEa6Oy-iEpxEqM30W3
> YcRQ8WU9ouRoO5jd6tfdcpX-2X-OteHw4dnMXdMLjHGGx86LMDeFRAN2KGz7EGPJivaw0y
> M80fzT3zY0PKrIvU5ml1M5szqUnX4Jw0-PNcIM_j-L5YkLhv3Yk04XCwTJwxNNmXCflYAQ
> O9f00Aa213TJJr6dbHV6I642FwU-EWvtEfN3evgX3EFIVYSnT3HCHkAAIdBQ9ykD-abRzV
> A_dGp_yJAZQcrZuNTqzThd_22YMPhIpzTygfC_4k7qqxI6t7Le_l5_o-taUG7vaNAl5FjE
> Q
> 118, 119, 111, 121, 104, 87, 120, 79, 77, 98, 111, 66, 53, 99, 120, 
> 88, 54, 110, 99, 65, 105, 55, 87, 112, 51, 81, 53, 70, 75, 82, 116, 
> 108, 109, 73, 120, 51, 53, 112, 102, 82, 57, 72, 112, 69, 97, 54, 79, 
> 121, 45, 105, 69, 112, 120, 69, 113, 77, 51, 48, 87, 51, 89, 99, 82, 
> 81, 56, 87, 85, 57, 111, 117, 82, 111, 79, 53, 106, 100, 54, 116, 102, 
> 100, 99, 112, 88, 45, 50, 88, 45, 79, 116, 101, 72, 119, 52, 100, 110, 
> 77, 88, 100, 77, 76, 106, 72, 71, 71, 120, 56, 54, 76, 77, 68, 101, 
> 70, 82, 65, 78, 50, 75, 71, 122, 55, 69, 71, 80, 74, 105, 118, 97, 
> 119, 48, 121, 77, 56, 48, 102, 122, 84, 51, 122, 89, 48, 80, 75, 114, 
> 73, 118, 85, 53, 109, 108, 49, 77, 53, 115, 122, 113, 85, 110, 88, 52, 
> 74, 119, 48, 45, 80, 78, 99, 73, 77, 95, 106, 45, 76, 53, 89, 107, 76, 
> 49, 51, 84, 74, 74, 114, 54, 100, 98, 72, 86, 54, 73, 54, 52, 50, 70, 
> 119, 85, 45, 69, 87, 118, 116, 69, 102, 78, 51, 101, 118, 103, 88, 51, 
> 69, 70, 73, 86, 89, 83, 110, 84, 51, 72, 67, 72, 107, 65, 65, 73, 100, 
> 66, 81, 57, 121, 107, 68, 45, 97, 98, 82, 122, 86, 65, 95, 100, 71, 
> 112, 95, 121, 74, 65, 90, 81, 99, 114, 90, 117, 78, 84, 113, 122, 84, 
> 104, 100, 95, 50, 50, 89, 77, 80, 104, 73, 112, 122, 84, 121, 103, 
> 102, 67, 95, 52, 107, 55, 113, 113, 120, 73, 54, 116, 55, 76, 101, 95, 
> 108, 53, 95, 111, 45, 116, 97, 85, 71, 55, 118, 97, 78, 65, 108, 53, 
> 70, 106, 69, 81] Ciphertext [253, 237, 181, 180, 97, 161, 105, 207, 
> 233, 120, 65, 100, 45, 122, 246, 116, 195, 212, 102, 37, 36, 175] 
> Encoded Ciphertext _e21tGGhac_peEFkLXr2dMPUZiUkrw Authentication Tag 
> (Integrity Value) [97, 182, 82, 120, 112, 141, 13, 144, 106, 1, 220, 
> 233, 68, 233, 114, 139] Encoded Authentication Tag (Encoded Integrity 
> Value) YbZSeHCNDZBqAdzpROlyiw JWE

---

From: "Richard L. Barnes" <[email-masked]>
Date: Fri, 29 Jun 2012 13:58:20 -0400

(Changed subject line to reflect topic change)

Might be nice to have a way to specify the parameters, but fall back to the default if the parameters are missing.  

As an aside: This is why in JSMS all the crypto stuff gets bound up in the AlgorithmIdentifier structure.  Using that design pattern, you could have:
"rsa-oaep" == Default parameters
{"name": "rsa-oaep", ...} == Specified parameters

Likewise, for symmetric algorithms, having the crypto parameters (IV, nonce, etc.) in the AlgorithmIdentifier helps remove the ambiguities that JWE/JWS currently have with regard to things like what happens if an algorithm doesn't require an IV.

--Richard

On Jun 29, 2012, at 1:48 PM, Mike Jones wrote:

>> RVM2IifQ
> _______________________________________________
> jose mailing list
> [email-masked]

---

From: Mike Jones <[email-masked]>
Date: Fri, 29 Jun 2012 18:05:44 +0000

As a design principle, the working group decided early on to specify small sets of algorithm combinations that are actually deployed in the wild.  This aids both interoperability and reduces implementation complexity.

There is a way to specify parameters - registering new "alg" values in JWA that specify new algorithms and/or parameter combinations.  If your application needs different OAEP parameter choices than the defaults, then by all means, make the case to the working group that that combination should be added to the JWA spec.

				Best wishes,
				-- Mike

-----Original Message-----
From: Richard L. Barnes [mailto:[email-masked]] 
Sent: Friday, June 29, 2012 10:58 AM
To: Mike Jones
Cc: [email-masked]
Subject: Algorithm parameters (was Re: [jose] Second compute JWE computation example)

--Richard

On Jun 29, 2012, at 1:48 PM, Mike Jones wrote:

>> [161, 168, 84, 34, 133, 176, 208, 173, 46, 176, 163, 110, 57, 30, 
>> 135, 227, 9, 31, 226, 128, 84, 92, 116, 241, 70, 248, 27, 227, 193, 
>> 62, 5, 91, 241, 145, 224, 205, 141, 176, 184, 133, 239, 43, 81, 103, 
>> 9, 161, 153, 157, 179, 104, 123, 51, 189, 34, 152, 69, 97, 69, 78, 
>> 93, 140, 131, 87, 182, 169, 101, 92, 142, 3, 22, 167, 8, 212, 56, 35, 
>> 79, 210, 222, 192, 208, 252, 49, 109, 138, 173, 253, 210, 166, 201, 
>> 63, 102, 74, 5, 158, 41, 90, 144, 108, 160, 79, 10, 89, 222, 231, 
>> 172, 31, 227, 197, 0, 19, 72, 81, 138, 78, 136, 221, 121, 118, 196, 
>> 17, 146, 10, 244, 188, 72, 113, 55, 221, 162, 217, 171, 27, 57, 233, 
>> 210, 101, 236, 154, 199, 56, 138, 239, 101, 48, 198, 186, 202, 160, 
>> 76, 111, 234, 71, 57, 183, 5, 211, 171, 136, 126, 64, 40, 75, 58, 89, 
>> 244, 254, 107, 84, 103, 7, 236, 69, 163, 18, 180, 251, 58, 153, 46, 
>> 151, 174, 12, 103, 197, 181, 161, 162, 55, 250, 235, 123, 110, 17, 
>> 11, 158, 24, 47, 133, 8, 199, 235, 107, 126, 130, 246, 73, 195, 20, 
>> 108, 202, 176, 214, 187, 45, 146, 182, 118, 54, 32, 200, 61, 201, 71, 
>> 243, 1, 255, 131, 84, 37, 111, 211, 168, 228, 45, 192, 118, 27, 197, 
>> 235, 232, 36, 10, 230, 248, 190, 82, 182, 140, 35, 204, 108, 190, 
>> 253, 186, 186, 27] D (private key exponent) [144, 183, 109, 34, 62, 
>> 134, 108, 57, 44, 252, 10, 66, 73, 54, 16, 181, 233, 92, 54, 219, 
>> 101, 42, 35, 178, 63, 51, 43, 92, 119, 136, 251, 41, 53, 23, 191, 
>> 164, 164, 60, 88, 227, 229, 152, 228, 213, 149, 228, 169, 237, 104, 
>> 71, 151, 75, 88, 252, 216, 77, 251, 231, 28, 97, 88, 193, 215, 202, 
>> 248, 216, 121, 195, 211, 245, 250, 112, 71, 243, 61, 129, 95, 39, 
>> 244, 122, 225, 217, 169, 211, 165, 48, 253, 220, 59, 122, 219, 42, 
>> 86, 223, 32, 236, 39, 48, 103, 78, 122, 216, 187, 88, 176, 89, 24, 1, 
>> 42, 177, 24, 99, 142, 170, 1, 146, 43, 3, 108, 64, 194, 121, 182, 95, 
>> 187, 134, 71, 88, 96, 134, 74, 131, 167, 69, 106, 143, 121, 27, 72, 
>> 44, 245, 95, 39, 194, 179, 175, 203, 122, 16, 112, 183, 17, 200, 202, 
>> 31, 17, 138, 156, 184, 210, 157, 184, 154, 131, 128, 110, 12, 85, 
>> 195, 122, 241, 79, 251, 229, 183, 117, 21, 123, 133, 142, 220, 153, 
>> 9, 59, 57, 105, 81, 255, 138, 77, 82, 54, 62, 216, 38, 249, 208, 17, 
>> 197, 49, 45, 19, 232, 157, 251, 131, 137, 175, 72, 126, 43, 229, 69, 
>> 179, 117, 82, 157, 213, 83, 35, 57, 210, 197, 252, 171, 143, 194, 11, 
>> 47, 163, 6, 253, 75, 252, 96, 11, 187, 84, 130, 210, 7, 121, 78, 91, 
>> 79, 57, 251, 138, 132, 220, 60, 224, 173, 56, 224, 201] The remaining 
>> RSA key parameters are included for completeness, but should not be 
>> needed DP [100, 175, 152, 192, 78, 221, 137, 72, 116, 169, 29, 109, 
>> 71, 188, 60, 88, 123, 104, 148, 60, 119, 49, 159, 206, 78, 140, 34, 
>> 22, 248, 31, 121, 13, 210, 138, 183, 172, 94, 57, 189, 129, 158, 74, 
>> 46, 19, 23, 190, 143, 174, 207, 226, 148, 37, 96, 241, 75, 154, 69, 
>> 67, 243, 52, 122, 247, 104, 213, 210, 162, 69, 56, 213, 195, 252, 
>> 120, 55, 42, 178, 92, 243, 57, 157, 66, 207, 145, 202, 84, 243, 110, 
>> 235, 158, 150, 115, 0, 146, 169, 118, 21, 128, 130, 170, 215, 24, 
>> 160, 4, 9, 1, 244, 94, 222, 45, 107, 57, 227, 157, 223, 243, 86, 144, 
>> 38, 101, 154, 186, 209, 99, 204, 4, 199, 202, 114, 225] DQ [14, 173, 
>> 32, 126, 2, 117, 13, 209, 70, 94, 34, 239, 64, 70, 103, 184, 161, 13, 
>> 209, 69, 38, 176, 144, 113, 146, 60, 157, 115, 120, 248, 101, 135, 
>> 65, 136, 196, 64, 203, 206, 177, 210, 241, 194, 143, 44, 28, 50, 86, 
>> 24, 131, 140, 168, 11, 134, 25, 107, 216, 77, 85, 203, 35, 168, 13, 
>> 197, 122, 34, 245, 246, 185, 60, 131, 164, 39, 219, 212, 237, 209, 
>> 142, 145, 243, 230, 86, 212, 92, 84, 236, 9, 86, 3, 34, 214, 201, 
>> 186, 170, 234, 221, 122, 84, 87, 123, 133, 7, 116, 203, 167, 229, 80, 
>> 174, 18, 148, 236, 157, 7, 173, 96, 193, 169, 206, 177, 113, 142, 0, 
>> 235, 252, 217, 193, 234, 208, 77, 222, 47, 129, 235, 181, 153, 20, 
>> 184, 171, 231, 62, 179, 39, 177, 69, 5, 149, 245, 29, 201, 181, 115, 
>> 199, 40, 243, 244, 145, 127, 95, 38, 152, 215, 134, 171, 116, 180, 
>> 163, 127, 130, 255, 20, 214] P [214, 190, 118, 94, 78, 58, 115, 226, 
>> 236, 124, 30, 79, 227, 141, 169, 237, 171, 93, 61, 74, 241, 65, 44, 
>> 184, 154, 216, 191, 181, 146, 55, 50, 7, 246, 18, 225, 85, 109, 74, 
>> 3, 6, 246, 145, 67, 228, 150, 198, 70, 228, 154, 129, 51, 47, 178, 
>> 87, 174, 132, 129, 141, 42, 202, 221, 130, 16, 129, 135, 76, 131, 32, 
>> 4, 61, 51, 227, 94, 255, 225, 35, 111, 245, 121, 52, 143, 85, 151, 
>> 243, 47, 73, 95, 124, 217, 244, 220, 133, 234, 88, 94, 76, 12, 91, 
>> 168, 81, 129, 52, 135, 54, 246, 190, 26, 229, 55, 250, 202, 173, 183, 
>> 195, 35, 5, 27, 78, 184, 227, 130, 39, 145, 111, 0, 186, 10, 93] Q 
>> [192, 182, 247, 231, 30, 225, 153, 5, 153, 177, 98, 102, 7, 251, 229, 
>> 123, 206, 226, 134, 6, 117, 245, 47, 37, 4, 68, 78, 44, 139, 25, 27, 
>> 134, 178, 101, 87, 189, 30, 47, 96, 13, 80, 142, 6, 101, 3, 117, 160, 
>> 216, 85, 52, 141, 199, 255, 5, 203, 13, 88, 97, 175, 87, 26, 177, 
>> 167, 13, 236, 52, 208, 157, 188, 113, 21, 40, 120, 16, 127, 140, 162, 
>> 53, 162, 102, 180, 58, 187, 245, 79, 214, 151, 33, 108, 74, 193, 222, 
>> 32, 191, 17, 72, 152, 229, 171, 221, 4, 75, 244, 161, 1, 71, 57, 54, 
>> 69, 171, 84, 6, 121, 131, 100, 148, 200, 1, 252, 19, 179, 72, 58, 
>> 241, 70, 71, 190, 215] END RSA KEY PARAMETERS Encrypted Key [142, 
>> 252, 40, 202, 21, 177, 56, 198, 232, 7, 151, 49, 95, 169, 220, 2, 46, 
>> 214, 167, 116, 57, 20, 164, 109, 150, 98, 49, 223, 154, 95, 71, 209, 
>> 233, 17, 174, 142, 203, 232, 132, 167, 17, 42, 51, 125, 22, 221, 135, 
>> 17, 67, 197, 148, 246, 139, 145, 160, 238, 99, 119, 171, 95, 117, 
>> 202, 87, 251, 101, 254, 58, 215, 135, 195, 135, 103, 49, 119, 76, 46, 
>> 49, 198, 27, 31, 58, 44, 192, 222, 21, 16, 13, 216, 161, 179, 236, 
>> 65, 143, 38, 43, 218, 195, 76, 140, 243, 71, 243, 79, 124, 216, 208, 
>> 242, 171, 34, 245, 57, 154, 93, 76, 230, 204, 234, 82, 117, 248, 39, 
>> 13, 62, 60, 215, 8, 51, 248, 254, 47, 150, 36, 46, 27, 247, 98, 77, 
>> 56, 92, 44, 19, 39, 12, 77, 54, 101, 194, 126, 86, 0, 64, 239, 95, 
>> 211, 64, 26, 219, 93, 211, 36, 154, 250, 117, 177, 213, 232, 142, 
>> 184, 216, 92, 20, 248, 69, 175, 180, 71, 205, 221, 235, 224, 95, 113, 
>> 5, 33, 86, 18, 157, 61, 199, 8, 121, 0, 0, 135, 65, 67, 220, 164, 15, 
>> 230, 155, 71, 53, 64, 253, 209, 169, 255, 34, 64, 101, 7, 43, 102, 
>> 227, 83, 171, 52, 225, 119, 253, 182, 96, 195, 225, 34, 156, 211, 
>> 202, 7, 194, 255, 137, 59, 170, 172, 72, 234, 222, 203, 123, 249, 
>> 121, 254, 143, 173, 105, 65, 187, 189, 163, 64, 151, 145, 99, 17] 
>> Encoded Encrypted Key 
>> 3TJJr6dbHV6I642FwU-EWvtEfN3evgX3EFIVYSnT3HCHkAAIdBQ9ykD-abRzVA_dGp_yJ
>> A ZQcrZuNTqzThd_22YMPhIpzTygfC_4k7qqxI6t7Le_l5_o-taUG7vaNAl5FjEQ
>> [101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 83, 85, 48, 69, 
>> 116, 84, 48, 70, 70, 85, 67, 73, 115, 73, 109, 86, 117, 89, 121, 73, 
>> 54, 73, 107, 69, 121, 78, 84, 90, 72, 81, 48, 48, 105, 76, 67, 74, 
>> 112, 100, 105, 73, 54, 73, 106, 81, 52, 86, 106, 70, 102, 81, 85, 
>> 120, 105, 78, 108, 86, 84, 77, 68, 82, 86, 77, 50, 73, 105, 102, 81, 
>> 46, 106, 118, 119, 111, 121, 104, 87, 120, 79, 77, 98, 111, 66, 53, 
>> 99, 120, 88, 54, 110, 99, 65, 105, 55, 87, 112, 51, 81, 53, 70, 75, 
>> 82, 116, 108, 109, 73, 120, 51, 53, 112, 102, 82, 57, 72, 112, 69, 
>> 97, 54, 79, 121, 45, 105, 69, 112, 120, 69, 113, 77, 51, 48, 87, 51, 
>> 89, 99, 82, 81, 56, 87, 85, 57, 111, 117, 82, 111, 79, 53, 106, 100, 
>> 54, 116, 102, 100, 99, 112, 88, 45, 50, 88, 45, 79, 116, 101, 72, 
>> 119, 52, 100, 110, 77, 88, 100, 77, 76, 106, 72, 71, 71, 120, 56, 54, 
>> 76, 77, 68, 101, 70, 82, 65, 78, 50, 75, 71, 122, 55, 69, 71, 80, 74, 
>> 105, 118, 97, 119, 48, 121, 77, 56, 48, 102, 122, 84, 51, 122, 89, 
>> 48, 80, 75, 114, 73, 118, 85, 53, 109, 108, 49, 77, 53, 115, 122, 
>> 113, 85, 110, 88, 52, 74, 119, 48, 45, 80, 78, 99, 73, 77, 95, 106, 
>> 45, 76, 53, 89, 107, 76, 104, 118, 51, 89, 107, 48, 52, 88, 67, 119, 
>> 84, 74, 119, 120, 78, 78, 109, 88, 67, 102, 108, 89, 65, 81, 79, 57, 
>> 102, 48, 48, 65, 97, 50, 49, 51, 84, 74, 74, 114, 54, 100, 98, 72, 
>> 86, 54, 73, 54, 52, 50, 70, 119, 85, 45, 69, 87, 118, 116, 69, 102, 
>> 78, 51, 101, 118, 103, 88, 51, 69, 70, 73, 86, 89, 83, 110, 84, 51, 
>> 72, 67, 72, 107, 65, 65, 73, 100, 66, 81, 57, 121, 107, 68, 45, 97, 
>> 98, 82, 122, 86, 65, 95, 100, 71, 112, 95, 121, 74, 65, 90, 81, 99, 
>> 114, 90, 117, 78, 84, 113, 122, 84, 104, 100, 95, 50, 50, 89, 77, 80, 
>> 104, 73, 112, 122, 84, 121, 103, 102, 67, 95, 52, 107, 55, 113, 113, 
>> 120, 73, 54, 116, 55, 76, 101, 95, 108, 53, 95, 111, 45, 116, 97, 85, 
>> 71, 55, 118, 97, 78, 65, 108, 53, 70, 106, 69, 81] Ciphertext [253, 
>> 237, 181, 180, 97, 161, 105, 207, 233, 120, 65, 100, 45, 122, 246, 
>> 116, 195, 212, 102, 37, 36, 175] Encoded Ciphertext 
>> _e21tGGhac_peEFkLXr2dMPUZiUkrw Authentication Tag (Integrity Value) 
>> [97, 182, 82, 120, 112, 141, 13, 144, 106, 1, 220, 233, 68, 233, 114, 
>> 139] Encoded Authentication Tag (Encoded Integrity
>> eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00iLCJpdiI6IjQ4VjFfQUxiNlVTM
>> DRVM2IifQ.jvwoyhWxOMboB5cxX6ncAi7Wp3Q5FKRtlmIx35pfR9HpEa6Oy-iEpxEqM30
>> W3YcRQ8WU9ouRoO5jd6tfdcpX-2X-OteHw4dnMXdMLjHGGx86LMDeFRAN2KGz7EGPJiva
>> w0yM80fzT3zY0PKrIvU5ml1M5szqUnX4Jw0-PNcIM_j-L5YkLhv3Yk04XCwTJwxNNmXCf
>> lYAQO9f00Aa213TJJr6dbHV6I642FwU-EWvtEfN3evgX3EFIVYSnT3HCHkAAIdBQ9ykD-
>> abRzVA_dGp_yJAZQcrZuNTqzThd_22YMPhIpzTygfC_4k7qqxI6t7Le_l5_o-taUG7vaN
>> Al5FjEQ._e21tGGhac_peEFkLXr2dMPUZiUkrw.YbZSeHCNDZBqAdzpROlyiw
>>

---

From: "Richard L. Barnes" <[email-masked]>
Date: Fri, 29 Jun 2012 14:19:38 -0400

You're conflating a bunch of things here.  Obviously, the set of mandatory to implement algorithms should be small.  But the syntax does not need to enforce that constraint. 

Besides, requiring new tokens for different parameter sets doesn't prevent algorithm proliferation, it just makes it a bigger hassle.  If the parameters are explicitly specified (with defaults), then to add a new algorithm, my code just has to support the new algorithm -- the code paths to invoke it don't need to change.  With a "single-token" approach, I have to write a whole new handler for every combination of parameters.  And that's simpler?

And regardless, it still seems like a good idea to package more ephemeral things like nonces and IVs in this way, since the required parameters do vary from one algorithm to another.

--Richard

On Jun 29, 2012, at 2:05 PM, Mike Jones wrote:

>>> D
>>> D

---

From: John Bradley <[email-masked]>
Date: Fri, 29 Jun 2012 14:40:56 -0400

I think that you are both recommending the same thing, but not agreeing somehow.

Having large numbers of sub parameters that can be individually specified, is a mess for interoperability and testing.

If there is a reason to change a sub parameter then a new composite lag can be specified in JWA.

John B.

---

From: "Richard L. Barnes" <[email-masked]>
Date: Fri, 29 Jun 2012 15:04:29 -0400

No, I think we actually disagree :)

I'm saying that disallowing the specification of parameters makes extensibility much harder.  Let's do some side-by-side comparisons:

In terms of pseudo-code:
-----BEGIN-WithParams-----
alg = JSON.parse('{"name":"rsa-oaep", "hash": "foo", "mgf": "bar"}')
hash = default_hash
mgf = default_mgf
if (alg instanceof Object):
    hash = Crypto.algorithmByName(alg["hash"])
    mgf = Crypto.algorithmByName(alg["mgf"])
-----END-WithParams-----

-----BEGIN-WithoutParams-----
alg = "rsa-oaep-foo-bar"
### Table of sub-algorithms for every known combination
(hash, mgf) = Crypto.subAlgorithmsByName(alg)
-----END-WithoutParams-----

In terms of keeping state:
With parameters: I have to keep a table of cryptographic primitives.
Without parameters: I have to keep a table of all the possible combinations that are allowed.  

In terms of adding a new sub-algorithm combination:
With parameters: Just allow it.  The code doesn't have to change.
With parameters: Every implementation has to update their registry.

Don't overestimate the interoperability problems.  Allowing parameters to be specified doesn't prevent combinatorial growth. Just look at the TLS ciphersuite registry:
<http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-3>
In either case, you can limit the proliferation by policy, instead of by protocol.

--Richard

---

From: John Bradley <[email-masked]>
Date: Fri, 29 Jun 2012 15:54:56 -0400

I don't think we are trying to preclude parameters for new algorithms.

The question is if for the core ones we have to define configurable parameters for all possible parameters or if it is OK 
to have a lag that specifies a fixed set of parameters and requires no options.

They are not necessarily mutually exclusive.

John B.

---

From: "Richard L. Barnes" <[email-masked]>
Date: Fri, 29 Jun 2012 16:06:28 -0400

> to have a lag that specifies a fixed set of parameters and requires no options.

Ok.  I thought that's what I suggested at first: A default version, but also a syntax where you *can* specify parameters.  For example (copying and pasting from below):
"rsa-oaep" == Default parameters
{"name": "rsa-oaep", "hash": "...", "mgf": "..."} == Specified parameters

Is that what you mean?  

I agree that they're not mutually exclusive, given that they can be distinguished by type (string vs. object).

What I don't think we should do is multiple single-token options for the same algorithm.  For example, there shouldn't be have:
"rsa-oaep" // hash=sha1, mgf=mgf1(sha1)
"rsa-oaep-sha256" // hash=sha256, mgf=mgf1(sha256)
The second case should use specified parameters.

--Richard

---

From: John Bradley <[email-masked]>
Date: Fri, 29 Jun 2012 16:20:36 -0400

OK it wasn't initially clear to me that you were proposing alg itself be a JSON object.

I am not certain about having alg sometimes be a string and sometimes be a object.

I will think about it.

John B.

---

From: Mike Jones <[email-masked]>
Date: Fri, 29 Jun 2012 20:26:27 +0000

Having polymorphic parameters seems more complex than the alternatives

-----Original Message-----
From: John Bradley [mailto:[email-masked]] 
Sent: Friday, June 29, 2012 1:21 PM
To: Richard L. Barnes
Cc: Mike Jones; [email-masked]
Subject: Re: [jose] Algorithm parameters (was Re: Second compute JWE computation example)

I will think about it.

John B.

---

From: "Richard L. Barnes" <[email-masked]>
Date: Fri, 29 Jun 2012 16:28:39 -0400

FWIW, OAEP is a crappy example.

The specified parameter thing is a lot more useful for things like DSA, symmetric algorithms, and D-H algorithms:

{name:"dsa", p:1, q:2, g:3}
{name:"ecdsa", curve:"P-256"}
{name:"aes-ccm", n:"ZONce...lU-g", m:8}
{name:"dh-es", group: 14}
{name:"ecdh-es", curve:"P-256"}

Copied from:
<http://tools.ietf.org/html/draft-barnes-jose-jsms-00#section-4.6.1>

So in large part it's the same information that's already in a JWS/JWE, it just packages it all together as an algorithm description.

--Richard

---

From: "Richard L. Barnes" <[email-masked]>
Date: Fri, 29 Jun 2012 16:32:04 -0400

Complex how?

if (typeof(x) == "string") {
    // Use default parameters
} else if (typeof(x) == "object") {
    // Use specified parameters
}

Copied from:
<https://raw.github.com/bifurcation/jsms/master/jose.js>