Re: [jose] JWK Elliptic Curve key representations and new curves
Daniel Holth <dholth@gmail.com> Thu, 14 August 2014 02:20 UTC
Return-Path: <dholth@gmail.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D1D5E1A0726 for <jose@ietfa.amsl.com>; Wed, 13 Aug 2014 19:20:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E15x6uU-VOt5 for <jose@ietfa.amsl.com>; Wed, 13 Aug 2014 19:20:37 -0700 (PDT)
Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 885561A0725 for <jose@ietf.org>; Wed, 13 Aug 2014 19:20:37 -0700 (PDT)
Received: by mail-wi0-f174.google.com with SMTP id d1so8261870wiv.1 for <jose@ietf.org>; Wed, 13 Aug 2014 19:20:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=X746AXwPYtwig6w4GpOTtRmXNu42eJoXomeSVrymMFs=; b=yYyNwlbokjey68ol4/nCyLon/iNqPJgqmtj5WcVK4xAxrcnfmBAwz9mYQku8vlzgbz H0ZZfLeYXAq/jvDexemUepo9X8mvmBJcyFXtUYTr1I1yCzLA7jbyf5Z1wTiHFHp82lnV UH2QXPnOzvkBSJve+kmWqhVVAi0EwPeqN6uxUgevL6Xn+4wETz39YvCIHocA2GXR1YS6 3eLWADIeoh1MwC5gyKaCOiwJFQ77une5Ra29VMYwavva/hzNr2dCSCiO7W/T+ZxqEfXW XP3WpxxaxloKx7IWKSyD2clBMhiEYoX/NzX5OkJNXx1jcQzzwXlp5zRmbk4tGRVljPuG NMIg==
MIME-Version: 1.0
X-Received: by 10.180.14.5 with SMTP id l5mr8602470wic.50.1407982836218; Wed, 13 Aug 2014 19:20:36 -0700 (PDT)
Received: by 10.194.58.166 with HTTP; Wed, 13 Aug 2014 19:20:36 -0700 (PDT)
In-Reply-To: <4E1F6AAD24975D4BA5B16804296739439AE1989B@TK5EX14MBXC293.redmond.corp.microsoft.com>
References: <4E1F6AAD24975D4BA5B16804296739439AE1989B@TK5EX14MBXC293.redmond.corp.microsoft.com>
Date: Wed, 13 Aug 2014 22:20:36 -0400
Message-ID: <CAG8k2+4rBnaZ4U4N49AgceAcNXeXcxjCzg+PgEy4woREAg=SmA@mail.gmail.com>
From: Daniel Holth <dholth@gmail.com>
To: Mike Jones <Michael.Jones@microsoft.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: http://mailarchive.ietf.org/arch/msg/jose/fsKuF9F5eEA24ggObQtc_cozFxg
Cc: Trevor Perrin <trevp@trevp.net>, "jose@ietf.org" <jose@ietf.org>
Subject: Re: [jose] JWK Elliptic Curve key representations and new curves
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.15
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: Thu, 14 Aug 2014 02:20:41 -0000
On Wed, Aug 13, 2014 at 9:39 PM, Mike Jones <Michael.Jones@microsoft.com> wrote:
> It has come up in recent discussions in the CRFG, the W3C WebCrypto working
> group, and the TLS working group that not all elliptic curves or curve
> protocols use two coordinates (x and y) in their public key representations.
> For instance, a Curve25519 public key is a single 32-byte value. Especially
> in light of the request by TLS to the CRFG to recommend new curves, and that
> some of the curves in consideration use only a single value in their public
> key representation, I believe that JOSE should consider how to represent
> such keys as JWKs.
>
>
>
> I see there being two logical ways to address this:
>
>
>
> CHOICE 1 – MAKE THE “EC” KEY TYPE MORE FLEXIBLE: One obvious possibility is
> to make it a property of the “crv” parameter for JWKs with “kty”: “EC” what
> fields are required. So for instance, when “crv” is “P-256”, “P-384”, or
> “P-521”, both “x” and “y” members would be used, but other curves might use
> a different set of members, such as just “x” for public keys.
>
>
>
> CHOICE 2 – USE A DIFFERENT KEY TYPE: Another possibility is to leave the
> “kty”: “EC” definition as it is but to define a related “kty”: “EC1” value
> to be used by elliptic curves for which only one value “x” is used in the
> public key representation and an additional value “d” is used in the private
> key representation.
>
>
>
> Within choice 2, there are actually two sub-choices available to us:
>
>
>
> CHOICE 2A – DEFINE A NEW KEY TYPE VALUE IN JWA NOW: If we think that there
> are only two kinds of elliptic curve key representations that we will ever
> care about, we could define the second one in JWA now. However, this would
> almost certainly start a debate within JOSE about whether we should add any
> additional curve definitions using this new key type. If we do, it should
> almost certainly be because we have followed the CFRG’s and TLS’s lead in
> the new curve choices, although doing so would almost certainly further
> delay our completion.
>
> CHOICE 2B – DEFINE THE NEW KEY TYPE IN A NEW SPEC: This could be done by
> writing an individual draft that registers “kty”: “EC1” and later possibly
> adopting it as a working group item. This would allow our current specs to
> proceed as-is, while giving us time to sync with CFRG and TLS as their curve
> choices move forwards.
>
>
>
> One additional pesky detail worth noting is that the normal Curve25519 key
> representation uses little-endian 32-bit numbers whereas SEC1 (which we use
> for “x”, “y”, and “d”) uses big-endian numbers. So for any of these choices
> above, we’d also have to decide whether to allow different curves to specify
> different endianness, require all to use big-endian representations, or to
> say that for some curves, the value is an octet array of a given size and be
> silent on endianness.
>
>
>
> While I’m reluctant to even bring this up at this point in the development
> of our specs, I also don’t want those designing potential applications of
> JWKs to believe that their choices of curves are limited by decisions that
> JOSE has made. It’s clear that JWK can be extended to accommodate curves
> using only a single value in their public key representations.
>
>
>
> How do you think we should do that?
>
>
>
> -- Mike
>
>
>
> P.S. Thanks to Trevor Perrin for private discussions that informed some of
> the contents of this note.
I didn't find the existing spec a burden. My JWK-derived system uses {
"kty" : "Ed25519", vk : "the base64url-encoded verifying key" } and
uses "Ed25519" as alg as well. (In the less necessary JWK private key
representation "sk" : "..." is used for the secret part).
Is there some economy that makes it desirable to have a Ed25519 JWK
look similar to any other elliptic curve key that only uses one
(opaque?) parameter? The constant-time implementation (no secret
branching) is monolithic, specialized to that curve and is not built
out of reconfigurable pieces.
Curve1174 "Elligator" is another elliptic curve system by DJB etc.
that looks like it shares some of the attributes of Ed25519.
Daniel Holth
- Re: [jose] The role of JWK Justin Richer
- [jose] JWK Elliptic Curve key representations and… Mike Jones
- Re: [jose] JWK Elliptic Curve key representations… Daniel Holth
- Re: [jose] JWK Elliptic Curve key representations… Mike Scott
- [jose] The role of JWK Sergey Beryozkin
- Re: [jose] The role of JWK Richard Barnes
- Re: [jose] JWK Elliptic Curve key representations… Richard Barnes
- Re: [jose] JWK Elliptic Curve key representations… Stephen Farrell
- Re: [jose] The role of JWK Justin Richer
- Re: [jose] JWK Elliptic Curve key representations… Mike Jones
- Re: [jose] The role of JWK Sergey Beryozkin
- Re: [jose] The role of JWK Justin Richer
- Re: [jose] The role of JWK Sergey Beryozkin
- Re: [jose] The role of JWK Brian Campbell
- Re: [jose] JWK Elliptic Curve key representations… Kathleen Moriarty
- Re: [jose] JWK Elliptic Curve key representations… Mike Jones
- Re: [jose] JWK Elliptic Curve key representations… Justin Richer
- Re: [jose] JWK Elliptic Curve key representations… Richard Barnes
- Re: [jose] JWK Elliptic Curve key representations… Brian Campbell
- Re: [jose] The role of JWK Sergey Beryozkin
- Re: [jose] The role of JWK Sergey Beryozkin
- Re: [jose] The role of JWK Anders Rundgren
- Re: [jose] The role of JWK Sergey Beryozkin
- [jose] Does A128GCMKW qualify as key wrap or encr… Sergey Beryozkin
- Re: [jose] Does A128GCMKW qualify as key wrap or … Mike Jones