Re: [TLS] 32 byte randoms in TLS1.3 hello's

Colm MacCárthaigh <colm@allcosts.net> Sat, 29 July 2017 18:04 UTC

Return-Path: <colm@allcosts.net>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B09B6131CEB for <tls@ietfa.amsl.com>; Sat, 29 Jul 2017 11:04:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.698
X-Spam-Level:
X-Spam-Status: No, score=-0.698 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=allcosts-net.20150623.gappssmtp.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 GfhqR1n3_niE for <tls@ietfa.amsl.com>; Sat, 29 Jul 2017 11:04:45 -0700 (PDT)
Received: from mail-yw0-x229.google.com (mail-yw0-x229.google.com [IPv6:2607:f8b0:4002:c05::229]) (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 419BB131C88 for <tls@ietf.org>; Sat, 29 Jul 2017 11:04:45 -0700 (PDT)
Received: by mail-yw0-x229.google.com with SMTP id p68so1554783ywg.0 for <tls@ietf.org>; Sat, 29 Jul 2017 11:04:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=allcosts-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aHvftLMTAom2oE2xcdS8279hpV7yBoqvMAUS2A756R4=; b=eBoE4Y9wgKn4ZcCbndr4a9meCkpNozDS3umaBXzqkmDxNoLGt6POiNjWL0T221hsMM Cnw8QJ3lbDO2nfj18GT1MeSPR0jCNML3i/0dOgHswvVjhSu0kZqhVgjSkBwLbOuz2wuz 0R/ZkDOyuR38FrIjcOOJVHYBdIDGIUEHQieeRv61KMtCmr1ownDvT4AZ/ES+j+e0RqZd 3vgmrw1xJyXhmi/CYm4U5fv9CGLNTVzS2jimMyqF8u/kJS+CT22oly1WGlcFNn8oG9D2 l//Y0GzT7SjO33iPjALiJHCEq3KWFHCRDpTnTobeRUSL54BL+NIgapNIewzpi5dB+MJd BChw==
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=aHvftLMTAom2oE2xcdS8279hpV7yBoqvMAUS2A756R4=; b=ROhQ9X/00wCcsGjNBhoVcjSl8rvUmAVMZBbBG0Lt1ZTJvobaasRF2UidRvyvuf5nUo eiPIlte/mgpSFW2qx6Vdb8P1WHakAzGxQ56ubU+tSWNtIYRfHtxkGzohbYQnSG+cbjXR Je34AHlFVXAbkGOPt8feyDhP0UdrorL5k8PuHyCAcuAKAatN/S5RUoemGJXNl/F0gN+L ygMsc8TyI9eaIA0Dxg6IRzetRb+4G4jNGTufdDfO6OyeW0xvXwqO2jMK8mQjqjVyHV2Z xEk3LhzFRl2NQL/eFqc7SeTb+eS0Fkzr+QqjsF9Er7rUC7aVVbpjgd01ra/2ItXfqYG9 17hA==
X-Gm-Message-State: AIVw112zWGU97pyZgwwTKMKOKGcT8ZcMmd7qjySiyudjGWbH/x4yKEgx l+NRw5Q8FBbwPD0CM1ybB3krf8LggYhP
X-Received: by 10.129.94.67 with SMTP id s64mr9292251ywb.83.1501351484259; Sat, 29 Jul 2017 11:04:44 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.129.154.71 with HTTP; Sat, 29 Jul 2017 11:04:43 -0700 (PDT)
In-Reply-To: <20170729155445.8573013.35196.16289@blackberry.com>
References: <CAAF6GDcSb3jqirTRW7_Udr4u6QJtFpmFug02pMuX-CjEiyNPfg@mail.gmail.com> <20170726205732.784F41A6CB@ld9781.wdf.sap.corp> <CAAF6GDcQCCeq1JosMTpQrh7MZLG1iN-xcOfsXC0LvSZRx+oQjQ@mail.gmail.com> <046ad800-351b-3a79-3f56-7883f5d9ceea@cs.tcd.ie> <CABcZeBMyY0f9D9VEmkKNkLB2OY3TRG7UO-B48xOrA3JSP5xRkw@mail.gmail.com> <20170727233335.8573013.91860.16216@blackberry.com> <2DB2CA47-5121-4B3E-BE0E-116A76F4870E@ll.mit.edu> <CABcZeBNF3WjY6AKoDY4drB+XjMS9LLZ5DmhR=DFX+-0YtKO71g@mail.gmail.com> <726e6666-8af4-384a-95f7-45cb68a331f7@cs.tcd.ie> <810C31990B57ED40B2062BA10D43FBF501B745D8@XMB116CNC.rim.net> <0698b5f7-3dd7-ee4f-5464-6a7e98a20240@cs.tcd.ie> <20170729155445.8573013.35196.16289@blackberry.com>
From: Colm MacCárthaigh <colm@allcosts.net>
Date: Sat, 29 Jul 2017 11:04:43 -0700
Message-ID: <CAAF6GDfwozYHhvarFcxqQj4z+X-6n_43RYvOY6awekixGQTDfA@mail.gmail.com>
To: Dan Brown <danibrown@blackberry.com>
Cc: Stephen Farrell <stephen.farrell@cs.tcd.ie>, Eric Rescorla <ekr@rtfm.com>, "Blumenthal, Uri - 0553 - MITLL" <uri@ll.mit.edu>, "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="001a114921d2e71ff1055578a16f"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/zTm4E6QjsJ89clOyDiF4W7QFJtk>
Subject: Re: [TLS] 32 byte randoms in TLS1.3 hello's
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 29 Jul 2017 18:04:48 -0000

I don't see anything relevant to the problem at hand in that paper. Did you
reference the right one? There are some mentions about not re-using random
secrets, but that applies no matter how many RNGs you use.

In your previous mail, even if an implementer were to seed two RNGs from
one CSPRNG, and all 3 are bad generator, this is still strictly better than
one broken generator; because the amount of work an attacker must do is far
greater.

On Sat, Jul 29, 2017 at 8:54 AM, Dan Brown <danibrown@blackberry.com> wrote:

> https://eprint.iacr.org/2012/064
> mentions the problem of generating multiple secrets instead of a single
> secret
>




>
>   Original Message
> From: Stephen Farrell
> Sent: Friday, July 28, 2017 11:48 AM
> To: Dan Brown; Eric Rescorla; Blumenthal, Uri - 0553 - MITLL
> Cc: tls@ietf.org
> Subject: Re: [TLS] 32 byte randoms in TLS1.3 hello's
>
>
> I don't think this is simply a case of multiple CSPRNGs.
>
> My guess is many TLS implementations don't have visibility
> into how the CSPRNG operates. That code does however, know
> which output values will be public and which not. For me,
> that implies that any good separation scheme applied within
> the TLS code that differentiates between public and non
> public outputs is a good plan. Yes, if an attacker can bork
> your CSPRNG, they may be able to get at the TLS code too
> sometimes, but I'd argue the defence in depth is worthwhile.
>
> Cheers,
> S.
>
> On 28/07/17 14:37, Dan Brown wrote:
> > I try below to better explain my points against separated public and
> private CSPRNG instances.
> >
> > Perhaps the easiest way to get "independent" seeds for the two instances
> of a CSPRNG, is to use a third CSPRNG instance to generate the seeds.  But
> then the problem arises again, if the 3 CSPRNGs are bad enough, (0=seeder,
> 1=public, 2=private), there is a risk that:
> >
> > Public_nonce=output1=>seed1=output0_for_1=>seed0=>output0_
> for_2=seed2=>output_2=private_key=TLS_insecurity.
> >
> > In short, generally speaking, three bad CSPRNGs do not combine easily
> into 1 good CSPRNG.
> >
> > (I'm not yet sure if this attack on three CSPRNGs combined applies to
> Dual_EC, since it may do something hash-like to the seed (I forgot
> details), and also output leaks the next state, not the previous state, as
> I recall, so that might break the chain above.)
> >
> > The alternative to a 3rd CSPRNG is to get the seeds from directly from a
> raw entropy source. In that case, keep in mind that one of the purposes of
> CSPRNGs is that raw entropy sources are unreliable (sometimes stall, etc.
> [references to be added]) and generally weak on the independence (they are
> non-uniform, hence have correlations).  CSPRNGs are supposed to correct
> these deficiencies, among other things.  So, if the 2 seeds are generated
> directly from a raw entropy sources (without a CSPRNG), two things may go
> wrong. First, deriving one seed from the other might be feasible because of
> non-uniformity. A bad CSPRNG might enable this this to be exploited, by
> finding one seed from the other.  Second, if the entropy source stalls
> (down a trickle of low entropy), between too close seed requests -
> accidentally - then even a good CSPRNG couldn't cope.
> >
> > Maybe, all this wouldn't be a problem on many higher end systems, with
> high entropy, so my concern is lower end systems, and also unnecessary
> complications of maintaining multiple bad CSPRNGs, potentially to no avail.
> >
> > Finally, on systems with a linux-style interface, /dev/urandom and
> /dev/random could be used as the two CSPRNGs on some systems (or seed
> sources), although I think one of these is now deprecated?
> >
> > -----Original Message-----
> > From: TLS [mailto:tls-bounces@ietf.org] On Behalf Of Stephen Farrell
> > Sent: Friday, July 28, 2017 4:47 AM
> > To: Eric Rescorla <ekr@rtfm.com>; Blumenthal, Uri - 0553 - MITLL <
> uri@ll.mit.edu>
> > Cc: tls@ietf.org
> > Subject: Re: [TLS] 32 byte randoms in TLS1.3 hello's
> >
> >
> > Hiya,
> >
> > On 28/07/17 00:50, Eric Rescorla wrote:
> >> I used the term "separate" here, which was intended to convey this,
> >> but if people think "independent" or something is better, happy to
> change.
> >
> > I think your change is a fine improvement over -21, thanks.
> > (And my suggested text was as imperfect as I usually manage:-)
> >
> > I'm not clear if implementers will or will not get the ramifications of
> "separate" (or "independent"), so I think we ought describe (or reference)
> at least one way in which that separation can be achieved.
> >
> > I also think we ought at least RECOMMEND separate CSPRNGs.
> > I'd prefer a MUST myself but since there's no one good way we can
> describe to achieve the effect that'd work in all cases, I don't think we
> can say MUST.
> >
> > Cheers,
> > S.
> >
> >
> >>
> >> -Ekr
> >>
> >>
> >> On Thu, Jul 27, 2017 at 4:43 PM, Blumenthal, Uri - 0553 - MITLL <
> >> uri@ll.mit.edu> wrote:
> >>
> >>> Respectfully disagree. Having two cryptographically independent
> >>> PRNGs, one for public data and one for key material, IMHO is a good
> >>> idea. Of course, both should be properly seeded - but that's a
> different issue.
> >>>
> >>> Regards,
> >>> Uri
> >>>
> >>> Sent from my iPhone
> >>>
> >>> On Jul 27, 2017, at 19:33, Dan Brown <danibrown@blackberry.com> wrote:
> >>>
> >>>
> >>> I don't think 2 CSPRNGs is a good idea.
> >>>
> >>> Wasn’t there a few years back some RSA keys with separate p and q,
> >>> generated independently leading to an attack...
> >>>
> >>> Here if the seeds to initialize the RNGS are related, or one is weak,
> >>> or worst if the seed is a raw source that doesn’t change in the
> >>> moments between the two CSPRNG inits, that'd be bad, even if the
> CSPRNGs were good.
> >>> *From: *Eric Rescorla
> >>> *Sent: *Thursday, July 27, 2017 6:34 PM
> >>> *To: *Stephen Farrell
> >>> *Cc: *tls@ietf.org
> >>> *Subject: *Re: [TLS] 32 byte randoms in TLS1.3 hello's
> >>>
> >>> Spec updated here;
> >>> https://github.com/tlswg/tls13-spec/commit/465de0e189b2b59090d0eac0ac
> >>> bc42
> >>> 942af9ca77
> >>>
> >>> -Ekr
> >>>
> >>>
> >>> On Wed, Jul 26, 2017 at 4:27 PM, Stephen Farrell <
> >>> stephen.farrell@cs.tcd.ie> wrote:
> >>>
> >>>>
> >>>> I've suggested some text for this in a PR [1] based on what people
> >>>> have said in this thread.
> >>>>
> >>>> I'm sure that can be further improved.
> >>>>
> >>>> It might be no harm to add more pointers to that appendix from
> >>>> elsewhere in the spec, and/or to add a list of the various
> >>>> public/private random numbers that are needed to that appendix. (I'd
> >>>> be happy to do a pass to identify those if folks basically like this
> >>>> kind of addition.)
> >>>>
> >>>> I also need to figure out how to handle the reference properly:-)
> >>>> Can do that tomorrow.
> >>>>
> >>>> Cheers,
> >>>> S.
> >>>>
> >>>> [1] https://github.com/tlswg/tls13-spec/pull/1068
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> TLS mailing list
> >>>> TLS@ietf.org
> >>>> https://www.ietf.org/mailman/listinfo/tls
> >>>>
> >>>>
> >>> _______________________________________________
> >>> TLS mailing list
> >>> TLS@ietf.org
> >>> https://www.ietf.org/mailman/listinfo/tls
> >>>
> >>>
> >>> _______________________________________________
> >>> TLS mailing list
> >>> TLS@ietf.org
> >>> https://www.ietf.org/mailman/listinfo/tls
> >>>
> >>>
> >>
> >>
> >>
> >> _______________________________________________
> >> TLS mailing list
> >> TLS@ietf.org
> >> https://www.ietf.org/mailman/listinfo/tls
> >>
> >
> >
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>



-- 
Colm