Subject: Re: [jose] order of step for encryption. JWE section 5

From: Mike Jones <[email-masked]>
Date: Tue, 11 Dec 2012 01:34:25 +0000

Hi Axel,

I'm sure that you probably saw this already, but in the -06 version of the spec, this ordering was cleaned up, as you suggested.  Thanks for your detailed and useful input on the specs.

				-- Mike

-----Original Message-----
From: [email-masked] [mailto:[email-masked]] On Behalf Of Mike Jones
Sent: Sunday, August 05, 2012 5:20 AM
To: [email-masked]; [email-masked]
Subject: Re: [jose] order of step for encryption. JWE section 5

Thanks for the careful read, Axel.  I'll work to make the write-up of the steps clearer, using your input.  In particular, I'll look for ways to better structure the steps.  (Unfortunately, the xml2rfc tool doesn't do a particularly good job of structuring lists with sub-lists.)

Answering your point 2c, a random CMK is not used in this case.  Instead, the agreed-upon key is used directly to perform the encryption.  I also plan to add a key agreement example in the next draft.  I expect that this will help make this case clearer.

				Thanks again,
				-- Mike
 
-----Original Message-----
From: [email-masked] [mailto:[email-masked]] On Behalf Of [email-masked]
Sent: Saturday, August 04, 2012 11:55 PM
To: [email-masked]
Subject: [jose] order of step for encryption. JWE section 5

Hi,

I have two issues with section 5 of
http://tools.ietf.org/html/draft-ietf-jose-json-web-encryption-05.html

1)
I would prefer it if the order of the steps 1 and 2 were reversed in section 5.

Currently we have:
Message Encryption

   The message encryption process is as follows.  The order of the steps
   is not significant in cases where there are no dependencies between
   the inputs and outputs of the steps.

   1.   When key agreement is employed, use the key agreement algorithm
        to compute the value of the agreed upon key.  When key agreement
        without key wrapping is employed, let the Content Master Key
        (CMK) be the agreed upon key.  When key agreement with key
        wrapping is employed, the agreed upon key will be used to wrap
        the CMK.

   2.   When key wrapping, key encryption, or key agreement with key
        wrapping are employed, generate a random Content Master Key
        (CMK).  See RFC 4086 [RFC4086] for considerations on generating
        random values.  The CMK MUST have a length equal to that of the
        larger of the required encryption and integrity keys.

Step 1 refers to the CMK that might be randomly created in step 2. I think it is better to have the CMK generation .

2) I find the text of the current step 1 confusing.
 2a) The first sentence is nearly a tautology
 2b) All sentences begin with When but the sentences two and three are alternative choices and the first is not.
 2c) Does "When key agreement without key wrapping is employed, let the Content Master Key
        (CMK) be the agreed upon key." make sense?
       What is the key agreement good for then?
       Should this read: "When key agreement without key wrapping is employed, let the agreed upon key be the CMK" ? There SHOULD be some randomness e.g. through the epk.

Could we structure these steps more? I) determine the CEK, generate random values like IVs and epks II) build the jweHeaderSegment (e.g.
put the IV there) III) build the jweKeySegment (e.g. key wrapping) IV) build the jweCryptoSegment V) build the jweIntegritySegment VI) base64url encode and concatenate the segments _______________________________________________
jose mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/jose

_______________________________________________
jose mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/jose