Re: [Cfrg] draft-irtf-cfrg-randomness-improvements-00 vs currently-deployed alternatives

"Stanislav V. Smyshlyaev" <smyshsv@gmail.com> Fri, 08 June 2018 16:11 UTC

Return-Path: <smyshsv@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 3173F130F07 for <cfrg@ietfa.amsl.com>; Fri, 8 Jun 2018 09:11:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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_NONE=-0.0001, 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 1CNNxMMIQ7NB for <cfrg@ietfa.amsl.com>; Fri, 8 Jun 2018 09:11:46 -0700 (PDT)
Received: from mail-ua0-x230.google.com (mail-ua0-x230.google.com [IPv6:2607:f8b0:400c:c08::230]) (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 C2551130F08 for <cfrg@irtf.org>; Fri, 8 Jun 2018 09:11:45 -0700 (PDT)
Received: by mail-ua0-x230.google.com with SMTP id m21-v6so9270855uan.0 for <cfrg@irtf.org>; Fri, 08 Jun 2018 09:11:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zR7Yp6AiLn9IoLdshC69LTMH5Qt1NNUmVkwZ8dXrZqE=; b=htJVJSMoMbV8Yw8eoPNzyHRq9vEgcynSuQn0Ob7NMoCe8yIYZgi+2/4fkJVD4rjQJ+ rJntTaFwhSqS2zm8gUnNkH7ALZjkqmrTU8ixFrITzAtJvVAU8yo8HvYxLFyFHKmFspRv teC4TA0ThGZjN+0Vrvs71QxhUp3mzoZCOwo7am6Y4pi/rBehxP7polPiQH6EPm7rfRSO j8cj1gZKvjS/kG/1O414cJy+ga4EEdWQ4utqWEKX8ecPBiRat+0INd3YG0TQl13lJrf9 AqDnZ+KXkKEJsycOy83GOjvyELSS48a6TtUS/ch3fde468JuBgAOCamFuibPt4cpHQqu P38A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zR7Yp6AiLn9IoLdshC69LTMH5Qt1NNUmVkwZ8dXrZqE=; b=ZmDAC5woMGlfWCi4ZH+4TNXIT/IMiIQh9+YhHYywyDCBQ8iON6u3fBoPVZrpiVns42 aLtqCxE065DJarG3q591EgAkXB6O0Q+M+VfMplbunuRmYgCNH+T9OfLFl3OSIV0Xi90j wPgc/oQ6u9k3DN9qBY7n4KqptbNSTperLC5sw54TgKWs9y0dKTDJP/BAMdiK2RG+g2Jr OHA5758PruzxUHMEeyRW9GjBTZSL7+t0GVJ30Y362DSGkaAeBri959smyCzIPp39F6WS QfkPQxwRXz9W2NkDL8RUjqfJgodYTmqg4TqHyc7sdJ6aPP6LwHhZD8TaJZupH0SvAqVY UH/Q==
X-Gm-Message-State: APt69E07XIJf5jAiVqRvrZdiyfsKFQ0q1iXplY+DDWKpm9qvlCm0VsVE LE3mgm7CrwsdH53C9C5IFvoDlYiMRHJlyCvzjvk=
X-Google-Smtp-Source: ADUXVKJ2imcdIT+usox96pxayogIK3fTxrHn7E8oYchZwNBQPK65v4sJMudEYer+e7a+bNByVkq2rm6hpDRswtKVrHM=
X-Received: by 2002:ab0:5922:: with SMTP id n31-v6mr4919146uad.114.1528474304877; Fri, 08 Jun 2018 09:11:44 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a67:8712:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 09:11:44 -0700 (PDT)
In-Reply-To: <CAFewVt6E8Ft3vRKEs3vdvOhNr8JmOEDwQH8SU5rm_SkDdsi89A@mail.gmail.com>
References: <CAFewVt6E8Ft3vRKEs3vdvOhNr8JmOEDwQH8SU5rm_SkDdsi89A@mail.gmail.com>
From: "Stanislav V. Smyshlyaev" <smyshsv@gmail.com>
Date: Fri, 08 Jun 2018 19:11:44 +0300
Message-ID: <CAMr0u6=1WBmo_qHSOzT6HRQ1N3Qfsf49rN-F2uk9m9wSrYOi+w@mail.gmail.com>
To: Brian Smith <brian@briansmith.org>
Cc: cfrg@irtf.org, Luke Garratt <luke.garratt@wolfson.ox.ac.uk>, Cas Cremers <cas.cremers@gmail.com>, Cas Cremers <cas.cremers@cs.ox.ac.uk>, Christopher Wood <christopherwood07@gmail.com>, Nick Sullivan <nick@cloudflare.com>
Content-Type: multipart/alternative; boundary="000000000000fd9acd056e23a739"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/kACnlB_KirJKEO_SsChM_0U14qM>
Subject: Re: [Cfrg] draft-irtf-cfrg-randomness-improvements-00 vs currently-deployed alternatives
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.26
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: Fri, 08 Jun 2018 16:11:49 -0000

Dear Brian!

Sorry for the delay – all this time we've been discussing the issues you
raised in an off-list discussion among the authors of the draft.

First of all, thank you very much for your questions and comments. They
highlight the issues that haven't been discussed thoroughly enough in the
current version of the draft.


About deterministic signature functions.

Actually the worst case scenario we are defending against is a complete
breakdown of all existing entropy sources (say, because of failure of
hardware RNG) on a certain computer. In this case we don't have even the
initial randomness to feed a DRBG (say, HMAC-DRBG you mentioned), and DRBG
without initialization with good randomness of course does not provide any
pseudorandom properties of outputs. But, yes, if we use (non-deterministic)
ECDSA or, say, EC-RDSA implemented in a separate hardware with a separate
entropy source (say, an HSM with its own RNGs), we can use it. The problem
occurs in another case  - when a random value used in ECDSA/EC-RDSA is
obtained from the same potentially broken entropy source.

According to your comments, we believe that recommendations should be
stated more explicitly in the draft, and comments of what would occur if
one uses a non-deterministic signature scheme (with no additional separated
trusted entropy source) with our techniques. We'll try to address this
issue in the future versions of the draft.


About different tags.

Of course it would be better to mix-in entropy, but we'd like to stress
that the main reason of using the techniques described in our draft is to
address the possible worst-case scenarios of having no working entropy
sources – when we cannot rely on any mixed-in entropy at all.
You cite the following place of the draft: "one HSM with a private key is
used from several servers, or if virtual machines are cloned". In fact the
problem we're trying to address here is the following. If we do not have
any actual entropy, then, in case of using our techniques, we'll leverage
the security of such worst-case scenarios – but – if we also have two
equivalent environments (two cloned virtual machines, for example) and two
tags are equivalent, then we can do nothing at all: no entropy and no
differences between two environments would lead to completely equivalent
outputs.
It seems that we really need to add some explanations about it in the text,
since such questions remain after reading the current version.


Thank you again for your comments, Brian.

We'll try our best to address these issues in the future versions of the
document.


Best regards,
Stanislav



2018-06-03 7:00 GMT+03:00 Brian Smith <brian@briansmith.org>:

> Hi,
>
> Hi all,
>
> Here are the initial questions that came into my haed after my first
> skim of draft-irtf-cfrg-randomness-improvements-00 [0]. I'm probably
> stating the obvious, but I just thought I'd double-check.
>
> The document says "Sig MUST be a deterministic signature function,
> e.g., deterministic ECDSA [RFC6979]."
>
> Let's say you did use Determistic ECDSA as described in RFC 6979. Then
> really you've basically implemented a special case of NIST HMAC-DRBG,
> perhaps by literally using an HMAC-DRBG implementation as described in
> section 3.3 of that RFC [1]. Given that, why not just use your
> HMAC-DRBG implementation for the individual nonces too, instead of
> implementing draft-cremers-cfrg-randomness-improvements-00 on top of
> it? For example, why not use (a variant of) the scheme that Cisco
> documented at [2], which they claim is even FIPS-certifiable? It seems
> BoringSSL switched to a variant of that as well [3] during their FIPS
> certification. I think explicitly stating the advantages of
> draft-cremers-cfrg-randomness-improvements-00 over that technique
> would be very helpful for people evaluating both.
>
> More generally, it seems problematic to me to require that we seed
> this with a *deterministic* signature to start out with. I understand
> that we want to protect ourselves against the case where we have
> little to no secret entropy. However, isn't it going to be pretty
> likely that we have a pretty good amount of secret entropy available
> from the beginning? It seems bad to just ignore it when it is probably
> available. I think it would be good to reformulate the mechanism in a
> way that allowed a possibly-randomized computation to be used instead.
>
> The draft says "Both tags SHOULD be generated such that they never
> collide with another accessor or owner of the private key.  This can
> happen if, for example, one HSM with a private key is used from
> several servers, or if virtual machines are cloned." Isn't it highly
> likely that people will fail to follow this recommendation due to the
> fact that it's very easy to accidentally break this rule? In fact many
> crypto libraries have specific defenses built-in and enabled by
> default, based on the assumption that users cannot follow such
> recommendations. This seems like one reason why it would be good to
> mix in some entropy into the initial key. With that in mind, I think
> it would be good to reformulate the mechanism in a way where we feel
> comfortable removing this requirement.
>
> [0] https://tools.ietf.org/html/draft-irtf-cfrg-randomness-improvements-00
> [1] https://tools.ietf.org/html/rfc6979#section-3.3
> [2] https://blogs.cisco.com/security/fips-and-deterministic-
> ecdsa-achieving-robust-security-and-conformance
> [3] https://boringssl.googlesource.com/boringssl/+/783e0957875ac
> 62b35aa4f8741069e133695a3d4
>
> Cheers,
> Brian
> --
> https://briansmith.org/
>
> _______________________________________________
> Cfrg mailing list
> Cfrg@irtf.org
> https://www.irtf.org/mailman/listinfo/cfrg
>