Re: [jose] WebCrypto feedback on key wrapping

Mike Jones <Michael.Jones@microsoft.com> Tue, 19 March 2013 03:38 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 2FFA021F85D6 for <jose@ietfa.amsl.com>; Mon, 18 Mar 2013 20:38:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.498
X-Spam-Level:
X-Spam-Status: No, score=-2.498 tagged_above=-999 required=5 tests=[AWL=0.100, BAYES_00=-2.599, HTML_MESSAGE=0.001]
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 ymcpNoRx2xOu for <jose@ietfa.amsl.com>; Mon, 18 Mar 2013 20:38:34 -0700 (PDT)
Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2lp0244.outbound.protection.outlook.com [207.46.163.244]) by ietfa.amsl.com (Postfix) with ESMTP id 1740B21F85AD for <jose@ietf.org>; Mon, 18 Mar 2013 20:38:33 -0700 (PDT)
Received: from BN1AFFO11FD018.protection.gbl (10.58.52.202) by BN1BFFO11HUB002.protection.gbl (10.58.53.112) with Microsoft SMTP Server (TLS) id 15.0.641.9; Tue, 19 Mar 2013 03:28:46 +0000
Received: from TK5EX14HUBC103.redmond.corp.microsoft.com (131.107.125.37) by BN1AFFO11FD018.mail.protection.outlook.com (10.58.52.78) with Microsoft SMTP Server (TLS) id 15.0.641.9 via Frontend Transport; Tue, 19 Mar 2013 03:28:45 +0000
Received: from TK5EX14MBXC283.redmond.corp.microsoft.com ([169.254.2.224]) by TK5EX14HUBC103.redmond.corp.microsoft.com ([157.54.86.9]) with mapi id 14.02.0318.003; Tue, 19 Mar 2013 03:28:43 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: Richard Barnes <rlb@ipv.sx>
Thread-Topic: [jose] WebCrypto feedback on key wrapping
Thread-Index: Ac4kUdrmb0UrhnxpB0CL7KQe/F+ugg==
Date: Tue, 19 Mar 2013 03:28:42 +0000
Message-ID: <4E1F6AAD24975D4BA5B16804296739436755CE48@TK5EX14MBXC283.redmond.corp.microsoft.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Content-Type: multipart/alternative; boundary="_000_4E1F6AAD24975D4BA5B16804296739436755CE48TK5EX14MBXC283r_"
MIME-Version: 1.0
X-Forefront-Antispam-Report: CIP:131.107.125.37; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(189002)(199002)(51856001)(512874001)(77982001)(4396001)(74502001)(33656001)(47446002)(76482001)(55846006)(56816002)(79102001)(46102001)(47736001)(74662001)(53806001)(54356001)(59766001)(50986001)(63696002)(47976001)(20776003)(80022001)(31966008)(65816001)(16406001)(69226001)(5343635001)(54316002)(56776001)(49866001); DIR:OUT; SFP:; SCL:1; SRVR:BN1BFFO11HUB002; H:TK5EX14HUBC103.redmond.corp.microsoft.com; RD:InfoDomainNonexistent; MX:1; A:1; LANG:en;
X-OriginatorOrg: microsoft.onmicrosoft.com
X-Forefront-PRVS: 0790FB1F33
Cc: "jose@ietf.org" <jose@ietf.org>
Subject: Re: [jose] WebCrypto feedback on key wrapping
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: Tue, 19 Mar 2013 03:38:35 -0000

I believe that the 2048 restriction was motivated by a NIST evaluation on acceptable key lengths in which the use of 1024 bit RSA keys has already been deprecated.  Eric Rescorla’s presentation to the working group several IETFs ago specifically recommended this, as well as the other key size restrictions in JWA.

At the time, the working group felt that requiring that people use keys of acceptable lengths for the current cryptographic client for new applications was a good thing - especially since JWS and JWE have no legacy applications to support.

-- Mike

From: Richard Barnes
Sent: ‎March‎ ‎18‎, ‎2013 ‎7‎:‎31‎ ‎PM
To: Mike Jones
CC: jose@ietf.org
Subject: Re: [jose] WebCrypto feedback on key wrapping

ISSUE-(n+1): Remove silly restriction on key sizes.  We're a formatting working group, not a crypto parameters working group.

--Richard


On Mon, Mar 18, 2013 at 8:02 PM, Mike Jones <Michael.Jones@microsoft.com<mailto:Michael.Jones@microsoft.com>> wrote:
Given that we require RSA keys to be a minimum of 2048 bits in length, there’s no problem wrapping 768 bit keys with OAEP in practice.

                                                                -- Mike

From: jose-bounces@ietf.org<mailto:jose-bounces@ietf.org> [mailto:jose-bounces@ietf.org<mailto:jose-bounces@ietf.org>] On Behalf Of Richard Barnes
Sent: Monday, March 18, 2013 4:25 PM
To: jose@ietf.org<mailto:jose@ietf.org>
Subject: [jose] WebCrypto feedback on key wrapping

On today's call with the W3C WebCrypto working  group, I reported on the discussion of JOSE key wrapping at the last IETF.  I was asked to relay a few bits of feedback:

1. Vijay Bharadwaj (Microsoft) observed that AES key wrap has fallen out of favor with some parts of the cryptographic community.  People prefer to be able to use AEAD algorithms for key wrapping, since they are perceived to be faster and offer a higher level of security than AES-KW. He gave the example that IEEE 802.1 uses AES CCM.

2. Mark Watson (Netflix) noted that if we use RSA directly to encrypt wrapped key objects, then we would need something other than OAEP in order to carry arbitrary-length payloads.  I agreed, and suggested that something like RSA-KEM would be necessary.  Ryan Sleevi (Google) and Vijay observed that KEM is troublesome due to the lack of support by native crypto libraries.

It seems to me that these comments have impacts on JWE and JWS (pending ISSUE-2), as well as the wrapping discussion.  The former has more impact than the latter.

Point number 1 implies that we should offer AEAD for key wrapping in JWE as well as for wrapped keys.  It seems to me that the simplest approach to this would be to make the "alg" field contain an object that is semantically equivalent to an AlgorithmIdentifier in CMS/PKCS8.  For example, { name: "A128GCM", iv: "PCIGJe0DjunuM7s0" }.  This syntax, incidentally, is roughly the same form that algorithm identifiers have in the WebCrypto API.  Note that this type of key wrapping is supported in CMS by the use of an AEAD AlgorithmIdentifier in the KEKRecipientInfo structure.

Point number 2 likely applies for some scenarios of JWE, especially if we adopt the McGrew approach.  For example, if using HMAC-SHA1 and AES with a 256-bit key, the total key length is 788 bits, which is too long to be encrypted with OAEP under a 1,024-bit RSA key.  I'm not sure how to resolve it.  The best idea I've got is to allow wrapped keys to nest, so that you can wrap a key inside of another wrapped key.

I will try to take these points into account in my forthcoming key wrapping draft, and I've filed two issues against JWE to track them.

--Richard