Re: [Cfrg] draft-irtf-cfrg-eddsa -- one final proposal for domain separation (context labels) for ed25519

Watson Ladd <watsonbladd@gmail.com> Wed, 20 April 2016 22:36 UTC

Return-Path: <watsonbladd@gmail.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 83E7B12E426; Wed, 20 Apr 2016 15:36:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 76_bjjN1YGLx; Wed, 20 Apr 2016 15:36:20 -0700 (PDT)
Received: from mail-vk0-x22e.google.com (mail-vk0-x22e.google.com [IPv6:2607:f8b0:400c:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BF2C412E7EF; Wed, 20 Apr 2016 15:36:07 -0700 (PDT)
Received: by mail-vk0-x22e.google.com with SMTP id t129so77391115vkg.2; Wed, 20 Apr 2016 15:36:07 -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; bh=phjtetQQfPveie6Pe0f+NRr6teBmOlXUxFRh+KmBOvQ=; b=QX7v4yZgILiAylMhFbjf4vWt/sWljW8TSVmTefEEUx3eVyAFb0YogTOHP0NMcMB64g Gg92wQIOnmbSt7A36dN7gFy6GeUhTT/vacBFrwO5Zf5yh6G1u2q7Akh7dSfr48z/8nBD Rvk6sMuvZXucUUd6SGdVbpbphYO26iOFnk9+UBRzC472aUHTHkjxYbVrVww33rlbsEWM ZnuoR8gUijwR3NiMxFQpF81Mj9l4h73r1aEK7t8anitNrFem4kve1CYlEVtvkf3KEdxm op4RXdXt85sGwRv9zaORsSitLZy6mcD7DaAzawdjuVTZ7VMU1jDz6dmDQACV5lt6yDB+ yqMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=phjtetQQfPveie6Pe0f+NRr6teBmOlXUxFRh+KmBOvQ=; b=TlI9Y8k3mfrU9YMC7WGKfUYB3Novj4S3+20XOAiZwcY+mfdWpLWqypm10lrvyFzxLf q7BBuDY93uf+0gGpAfEmAdiaKDTeQn3KPFYs6VB6dpCJz5iu9f2jhuFtnpxcNc40hRnA 22cL/jsH33h2+jKRuEihoONq2NtTjFl9xKZHiF30xpPnd/8XwFmTy9BVenxQeaBkHARK Uo9JnnuJEUmL+5Eet2rON89HKPyzeA9IG+KXr3Ytt6uBQf3Q+SDUYCbymNSWPanLSgug O4tZdBmY4fpcNgItsYRvSKBPqmm8ZkvImEww6dv0rFLpwLWZ0I/iqCd0tJ/fNTB4hgcf XDWw==
X-Gm-Message-State: AOPr4FUB6z23EkQCrg58naV4gGcc3nrlyhlagS9oxHoWjdhZ9Xmhx5s1AHEyw1rmrB4cNeSmTwXJQM7zLdHDgw==
MIME-Version: 1.0
X-Received: by 10.176.1.74 with SMTP id 68mr5230180uak.56.1461191766708; Wed, 20 Apr 2016 15:36:06 -0700 (PDT)
Received: by 10.176.64.68 with HTTP; Wed, 20 Apr 2016 15:36:06 -0700 (PDT)
Received: by 10.176.64.68 with HTTP; Wed, 20 Apr 2016 15:36:06 -0700 (PDT)
In-Reply-To: <CACsn0cnJxmG5ZNj1VWG3fs-KAo1g7-5Ug5-6qeD3GHT4o9QLgg@mail.gmail.com>
References: <87bn543id1.fsf@alice.fifthhorseman.net> <D33CFF00.6A70D%kenny.paterson@rhul.ac.uk> <11c960b5f1fa42aaaf4cd0a6961332ec@usma1ex-dag1mb1.msg.corp.akamai.com> <87ziso1m0l.fsf@alice.fifthhorseman.net> <20160420142953.GA23528@LK-Perkele-V2.elisa-laajakaista.fi> <87potk1de7.fsf@alice.fifthhorseman.net> <20160420182617.GA23652@LK-Perkele-V2.elisa-laajakaista.fi> <87bn540xh3.fsf@alice.fifthhorseman.net> <CACsn0cm0=Ms2aVpU3QZ_2NZx3BA_pBT-643-m8JzdXTiABH+KA@mail.gmail.com> <CACsn0cnJxmG5ZNj1VWG3fs-KAo1g7-5Ug5-6qeD3GHT4o9QLgg@mail.gmail.com>
Date: Wed, 20 Apr 2016 15:36:06 -0700
Message-ID: <CACsn0ck5EQkxwTtTOfPLSo6Lo30Jv9D-0kJsEQb60NacdyD2yg@mail.gmail.com>
From: Watson Ladd <watsonbladd@gmail.com>
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Content-Type: multipart/alternative; boundary="001a113e213e341a8c0530f238e5"
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/n_U-8qg236K8auFiXplw8aPcXZE>
Cc: "draft-irtf-cfrg-eddsa.all@ietf.org" <draft-irtf-cfrg-eddsa.all@ietf.org>, "cfrg@ietf.org" <cfrg@ietf.org>, Robert Edmonds <edmonds@debian.org>, Ondřej Surý <ondrej@sury.org>, Benjamin Kaduk <bkaduk@akamai.com>, Martin Thomson <martin.thomson@gmail.com>
Subject: Re: [Cfrg] draft-irtf-cfrg-eddsa -- one final proposal for domain separation (context labels) for ed25519
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Apr 2016 22:36:22 -0000

On Apr 20, 2016 2:41 PM, "Daniel Kahn Gillmor" <dkg@fifthhorseman.net>
wrote:
>
> On Wed 2016-04-20 14:26:17 -0400, Ilari Liusvaara wrote:
> > On Wed, Apr 20, 2016 at 11:57:36AM -0400, Daniel Kahn Gillmor wrote:
> >> On Wed 2016-04-20 10:29:53 -0400, Ilari Liusvaara wrote:
> >> > Also, anyone up to some quick analysis to show that doesn't interact
> >> > harmfully with Ed25519 when using the same keys?
> >>
> >> eh?  this is specifically and only about how to apply a context label
in
> >> Ed25519 and Ed25519ph, since it's already defined for Ed448 -- what do
> >> you mean "interact harmfully with Ed25519" ?
> >
> > Suppose attacker can get signatures for arbitrary (context,message)
pairs
> > under some key, can he forge a signature for some (context',message')
under
> > that key that he didn't see?
>
> sure, by definition if context' is a prefix of context, and message' is
> just the concatenation of (context - context' || message), then it's a
> viable forgery.
>
> This is the price we pay for backward compatibility, but it's actually a
> *better* situation than we have without a recommended way to use a
> context label.
>
> Without a context label, any arbitrary message can be treated as a
> "forgery" by simply replaying it in a different context. (e.g. i sign
> an ASN.1 sequence of two integers, and you understand it as signed
> finite-field DHE params, but i wanted you to understand it as an RSA
> public key)

Cryptographers have understood since the 1990s the importance of not using
keys across protocols and signing all information affecting interpretation
of signed data.

Protocols which rely on a context cannot work with RSA - PSS or ECDSA. They
can simply specify preappending the context to work with all signature
schemes.

>
> With a context label, for every domain that defines a sane context
> (e.g. the guidance i suggested of printable-ascii followed by '\0'), we
> can rule out inter-domain replay as a successful forgery because no
> context will be a prefix of any other context.
>
> Furthermore, in practice, if we don't specify a standard way to use a
> context label for domain separation in Ed25519, different schemes may
> apply the context label in different ways, potentially allowing for some
> message collision.
>
> >> > Also, that wouldn't solve the troublesome interaction between Ed25519
> >> > and Ed25519ph...
> >>
> >> That's true, this proposal doesn't try to solve that problem.  I hope
it
> >> can be evaluated independently.
> >
> > I actually once implemented variant of Ed25519 with contexts done like
> > Ed448. Separate variant, so needed its own keys. It would be very easy
> > to build Ed25519ph-like scheme by just using SHA-512(msg) as prehash
> > and marking the message as prehashed (there is no need for context in
> > inner hash).
>
> i'm sure we could propose an entirely new variant that has the same
> robustness as Ed448, but it would fail the backward compatibility goals
> that i thought the group (including you) had previously identified. In
> my proposal here, i am trying to work within those constraints.  Are you
> saying that Ed25519ph doesn't need the backward compatibility?
>
> If you're proposing a fix to a separate problem, is it something we can
> consider separately?
>
>    --dkg
>
> _______________________________________________
> Cfrg mailing list
> Cfrg@irtf.org
> https://www.irtf.org/mailman/listinfo/cfrg