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

Mike Jones <Michael.Jones@microsoft.com> Sun, 05 August 2012 12:20 UTC

Return-Path: <Michael.Jones@microsoft.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 58DFB21F84C2 for <jose@ietfa.amsl.com>; Sun, 5 Aug 2012 05:20:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.793
X-Spam-Level:
X-Spam-Status: No, score=-3.793 tagged_above=-999 required=5 tests=[AWL=-0.194, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xD5pJS1lTvAu for <jose@ietfa.amsl.com>; Sun, 5 Aug 2012 05:20:13 -0700 (PDT)
Received: from db3outboundpool.messaging.microsoft.com (db3ehsobe006.messaging.microsoft.com [213.199.154.144]) by ietfa.amsl.com (Postfix) with ESMTP id 7557E21F84A7 for <jose@ietf.org>; Sun, 5 Aug 2012 05:20:12 -0700 (PDT)
Received: from mail59-db3-R.bigfish.com (10.3.81.251) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 14.1.225.23; Sun, 5 Aug 2012 12:20:11 +0000
Received: from mail59-db3 (localhost [127.0.0.1]) by mail59-db3-R.bigfish.com (Postfix) with ESMTP id 4C0341C01FF; Sun, 5 Aug 2012 12:20:11 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:131.107.125.8; KIP:(null); UIP:(null); IPV:NLI; H:TK5EX14MLTC101.redmond.corp.microsoft.com; RD:none; EFVD:NLI
X-SpamScore: -28
X-BigFish: VS-28(zz9371I542M111aI1447Izz1202hzz1033IL8275dhz2fh2a8h668h839h944hd25hf0ah107ah)
Received-SPF: pass (mail59-db3: domain of microsoft.com designates 131.107.125.8 as permitted sender) client-ip=131.107.125.8; envelope-from=Michael.Jones@microsoft.com; helo=TK5EX14MLTC101.redmond.corp.microsoft.com ; icrosoft.com ;
Received: from mail59-db3 (localhost.localdomain [127.0.0.1]) by mail59-db3 (MessageSwitch) id 1344169210192911_10134; Sun, 5 Aug 2012 12:20:10 +0000 (UTC)
Received: from DB3EHSMHS015.bigfish.com (unknown [10.3.81.236]) by mail59-db3.bigfish.com (Postfix) with ESMTP id 23D223000C0; Sun, 5 Aug 2012 12:20:10 +0000 (UTC)
Received: from TK5EX14MLTC101.redmond.corp.microsoft.com (131.107.125.8) by DB3EHSMHS015.bigfish.com (10.3.87.115) with Microsoft SMTP Server (TLS) id 14.1.225.23; Sun, 5 Aug 2012 12:20:09 +0000
Received: from TK5EX14MBXC285.redmond.corp.microsoft.com ([169.254.3.222]) by TK5EX14MLTC101.redmond.corp.microsoft.com ([157.54.79.178]) with mapi id 14.02.0298.005; Sun, 5 Aug 2012 12:20:07 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: "Axel.Nennker@telekom.de" <Axel.Nennker@telekom.de>, "jose@ietf.org" <jose@ietf.org>
Thread-Topic: order of step for encryption. JWE section 5
Thread-Index: Ac1y1wQPutAF2XyLQPOP3bTnOMCRMwALGibg
Date: Sun, 05 Aug 2012 12:20:06 +0000
Message-ID: <4E1F6AAD24975D4BA5B1680429673943667537AF@TK5EX14MBXC285.redmond.corp.microsoft.com>
References: <CE8995AB5D178F44A2154F5C9A97CAF402517DB698C5@HE111541.emea1.cds.t-internal.com>
In-Reply-To: <CE8995AB5D178F44A2154F5C9A97CAF402517DB698C5@HE111541.emea1.cds.t-internal.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [157.54.51.33]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
Subject: Re: [jose] order of step for encryption. JWE section 5
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/jose>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 05 Aug 2012 12:20:14 -0000

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: jose-bounces@ietf.org [mailto:jose-bounces@ietf.org] On Behalf Of Axel.Nennker@telekom.de
Sent: Saturday, August 04, 2012 11:55 PM
To: jose@ietf.org
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
jose@ietf.org
https://www.ietf.org/mailman/listinfo/jose