Re: [jose] Open Issue: Representing the JWE IV as a dot-separated element

"Manger, James H" <James.H.Manger@team.telstra.com> Mon, 30 July 2012 01:49 UTC

Return-Path: <James.H.Manger@team.telstra.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 1D2D211E80F6 for <jose@ietfa.amsl.com>; Sun, 29 Jul 2012 18:49:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.172
X-Spam-Level:
X-Spam-Status: No, score=-1.172 tagged_above=-999 required=5 tests=[AWL=-0.272, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, HTML_MESSAGE=0.001, RELAY_IS_203=0.994]
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 zbnptjNkALKS for <jose@ietfa.amsl.com>; Sun, 29 Jul 2012 18:49:39 -0700 (PDT)
Received: from ipxavo.tcif.telstra.com.au (ipxavo.tcif.telstra.com.au [203.35.135.200]) by ietfa.amsl.com (Postfix) with ESMTP id C022311E80E6 for <jose@ietf.org>; Sun, 29 Jul 2012 18:49:36 -0700 (PDT)
X-IronPort-AV: E=Sophos; i="4.77,676,1336312800"; d="scan'208,217"; a="84342263"
Received: from unknown (HELO ipccvi.tcif.telstra.com.au) ([10.97.217.208]) by ipoavi.tcif.telstra.com.au with ESMTP; 30 Jul 2012 11:49:34 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,6787"; a="78222982"
Received: from wsmsg3757.srv.dir.telstra.com ([172.49.40.85]) by ipccvi.tcif.telstra.com.au with ESMTP; 30 Jul 2012 11:49:33 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by wsmsg3757.srv.dir.telstra.com ([172.49.40.85]) with mapi; Mon, 30 Jul 2012 11:49:33 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: "jose@ietf.org" <jose@ietf.org>
Date: Mon, 30 Jul 2012 11:49:32 +1000
Thread-Topic: [jose] Open Issue: Representing the JWE IV as a dot-separated element
Thread-Index: Ac1sShLZvlTbc+2LTtW27U8yfEpgwgBqe/uAAABfDFA=
Message-ID: <255B9BB34FB7D647A506DC292726F6E114F97B728F@WSMSG3153V.srv.dir.telstra.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: multipart/alternative; boundary="_000_255B9BB34FB7D647A506DC292726F6E114F97B728FWSMSG3153Vsrv_"
MIME-Version: 1.0
Subject: Re: [jose] Open Issue: Representing the JWE IV as a dot-separated element
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: Mon, 30 Jul 2012 01:49:40 -0000

Make the IV a prefix of the ciphertext and you save another couple of bytes. Plus the IV length would no longer be defined twice (firstly by the alg definition; secondly by the length of the IV field in the message), which avoids a potential inconsistency.

While we are doing that, may as well make the AEAD authentication tag a suffix of the ciphertext.

--
James Manger

From: jose-bounces@ietf.org [mailto:jose-bounces@ietf.org] On Behalf Of Mike Jones
Sent: Saturday, 28 July 2012 8:49 AM
To: jose@ietf.org
Subject: [jose] Open Issue: Representing the JWE IV as a dot-separated element

All the JWE block encryption algorithms we’re using require an Initialization Vector.  I’d originally put the IV in the JWE header because I thought it would be optional, but in practice, it’s not.  As a result, we’re always double base64url encoding required content.

I did an investigation and we could save 15 characters in the GCM example at http://tools.ietf.org/html/draft-ietf-jose-json-web-encryption-04#section-3.1 and 17 characters in the CBC example at http://tools.ietf.org/html/draft-ietf-jose-json-web-encryption-04#section-3.2 if we were to represent the IV as another dot-separated element rather than putting it in the header and double base64url encoding it.

Since size matters a lot in some use cases, we should consider whether to do this.

I’ll add it to the open issues list for us to discuss in Vancouver.

                                                                -- Mike