Re: [Cfrg] Elliptic Curves - signature scheme: randomised or not (ends on May 13th)

Watson Ladd <watsonbladd@gmail.com> Mon, 11 May 2015 13:42 UTC

Return-Path: <watsonbladd@gmail.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5F5691A8886 for <cfrg@ietfa.amsl.com>; Mon, 11 May 2015 06:42:18 -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 CNVg4IohRF00 for <cfrg@ietfa.amsl.com>; Mon, 11 May 2015 06:42:16 -0700 (PDT)
Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (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 E3CEC1A8869 for <cfrg@irtf.org>; Mon, 11 May 2015 06:42:15 -0700 (PDT)
Received: by wgbhc8 with SMTP id hc8so28341500wgb.2 for <cfrg@irtf.org>; Mon, 11 May 2015 06:42:14 -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; bh=ecHem52FKGzcbQ1lbGA0VQ60HujewCaovUSwNaYT2yQ=; b=f3qOgpiVBy1k7Mto9joQ1qKSdgaFWOqzJBzjcB9+nUIqVhqv7bDclmEOnHHxyj6uhD PLgbZhbAXMSn1Hpk6YMDh+Eefl5IMCgcIjqX1P2/E1VNls3wkJ4I/uGQsA20uZhks2Nb 9rg/UqVczCFN/Q0txa9AxlOPcefefRTtqVYhBFpZWILh13t/N8tUpH4fLuhMTce/P0De AlWKdnaYlv7HHN/hmijgm/70l21i1MQ6SnMqTwzUIdqiYPuRE+EHPW4/9Dk3W3zM+gfn aVpLFOq6h0e9GRhfPSQSRggWvfSKPsqtYrBcamZ29lZcHfpaPlNrNtj7uBwhexCxY3wG hNjA==
MIME-Version: 1.0
X-Received: by 10.180.105.233 with SMTP id gp9mr20947272wib.83.1431351734571; Mon, 11 May 2015 06:42:14 -0700 (PDT)
Received: by 10.194.20.97 with HTTP; Mon, 11 May 2015 06:42:14 -0700 (PDT)
In-Reply-To: <CAFewVt4OkBohtn34PcNWWtQG7riDK_MFeRQW_srXTx3Y7oD1PA@mail.gmail.com>
References: <810C31990B57ED40B2062BA10D43FBF5DCAEDC@XMB116CNC.rim.net> <20150505152258.31923.qmail@cr.yp.to> <810C31990B57ED40B2062BA10D43FBF5DCBA9C@XMB116CNC.rim.net> <CACsn0c=TWiNaCZC2O2CvRqO-tZgYnCwEzAsXqnX2FzutBFMi-w@mail.gmail.com> <810C31990B57ED40B2062BA10D43FBF5DCC801@XMB116CNC.rim.net> <CACsn0ck8Ni_wz-_BbD++UaagK5Oc7+hfm_S+hpRN+e3ZvneQXA@mail.gmail.com> <CAFewVt4OkBohtn34PcNWWtQG7riDK_MFeRQW_srXTx3Y7oD1PA@mail.gmail.com>
Date: Mon, 11 May 2015 06:42:14 -0700
Message-ID: <CACsn0c=-gZcnu8LPWWvqa5v+o4N6ybfWZxh4iH+3JSO=iLwkZA@mail.gmail.com>
From: Watson Ladd <watsonbladd@gmail.com>
To: Brian Smith <brian@briansmith.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/gvO_3ce8kkwiXKzj1RWAQbq3CUE>
Cc: Dan Brown <dbrown@certicom.com>, "cfrg@irtf.org" <cfrg@irtf.org>, "djb@cr.yp.to" <djb@cr.yp.to>
Subject: Re: [Cfrg] Elliptic Curves - signature scheme: randomised or not (ends on May 13th)
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <http://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <http://www.irtf.org/mail-archive/web/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <http://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Mon, 11 May 2015 13:42:18 -0000

On Mon, May 11, 2015 at 12:36 AM, Brian Smith <brian@briansmith.org> wrote:
> Watson Ladd <watsonbladd@gmail.com> wrote:
>> With your amended proposal, signatures remain secure even with bad
>> randomness (unless we have kleptographic bugs, induced by our good
>> friends at Fort Mead). So what exactly is the point of having all this
>> extra code lying around, and dependencies on randomness?
>
> As far as I understand Dan Brown's argument, he is saying that nobody should
> be *required to depend* on randomness (i.e. purely deterministic signatures
> should be allowed), but any implementation *should be allowed* to use
> randomness if the use of randomness helps prevent side channel attacks.

And no one has disagreed with that: as DJB noted randomized signatures
will still interoperate.

>
> (Quoted out of order):
>
>> 3a is actually a reasonable argument, but
>> there are quite a few cases where power analysis doesn't matter.
>
> The question is whether it is reasonable to assume that there are *no* cases
> where power analysis, EMI, or other side channel attacks matter, that are
> relevant to this decision.
>
> I've read in this thread some suggestions that such side channel attacks do
> not matter for TLS. I don't think that that assertion has been shown to be
> conclusively true, considering that we have to assume that the server doing
> the signing is co-located physically centimeters away from, or even on the
> same system as, systems that may be attacking them.
>
> Timing side channels and the *idea* of developing constant time signing
> implementations to guard against them, are well understood. Yet, even when
> people go out of their way to develop constant-time implementations, they
> frequently get it wrong. In particular, it is pretty common to see
> implementations making wrong assumptions about which C language constructs
> will result in constant-time execution. (This should be unsurprising, since
> C doesn't make any such guarantees.) Therefore, even if timing side channels
> are the only side channels that we are concerned with, it might *still* be
> useful to use randomization on top of a deterministic scheme as a
> defense-in-depth mechanism (as BoringSSL does, for example).
>
> After all, if we're designing under the assumption that implementers cannot
> follow even the most obvious and clear instructions regarding randomizing k
> in ECDSA, then it seems prudent to also assume that they cannot write
> constant-time code that is correct, considering that even incredibly
> well-informed implementers have had difficulties in doing so. (It is not
> hard to find code in major implementations claiming to be constant time that
> isn't actually constant time.)

You assume we're talking about implementors who "can't follow the most
obvious and clear instructions regarding randomizing k", and conclude
they can't protect against side channels. Could you have stopped the
Debian bug if you wrote the OpenSSL ECDSA code? Of course, Dan Brown's
proposal does stop that particular bug. But it doesn't stop you from
mistyping the size of an array, and thus opening the door to much more
effective attacks based on partially known nonces. The advantage of
deterministic schemes is increased testability. (Yes, one could inject
"random numbers" to create test vectors if the generation method was
specified. That involves exposing a function that shouldn't be used in
production).

Randomization alone is insufficient to protect against side channel
attacks. Developing side-channel protected implementations is a
significant effort, and requires knowledge of the side-channel
characteristics of the hardware that the software is running on.
Randomized implementations that have been vulnerable include:

-OpenSSL https://eprint.iacr.org/2014/161.pdf, several other papers
-Smart Cards https://eprint.iacr.org/2013/346.pdf



>
> That said, DJB said:
>> Standard defenses include blinding of each secret bit (splitting b into
>> r and r+b), blinding mod the group order (replacing k with k+rp), etc.;
>> these defenses work for deterministic signing systems too.
>
> I'm not disagreeing with DJB. However, I think it is worth spending time, at
> least, verifying whether this assertion that all relevant side channel
> attacks can be reasonably prevented for purely deterministic signature
> schemes is true. If so, then only a purely deterministic scheme should be
> specified. Otherwise, randomization should be permitted but not required.
>
> Cheers,
> Brian



-- 
"Man is born free, but everywhere he is in chains".
--Rousseau.