Re: [TLS] RNG vs. PRNG

Marsh Ray <marsh@extendedsubset.com> Wed, 28 April 2010 16:41 UTC

Return-Path: <marsh@extendedsubset.com>
X-Original-To: tls@core3.amsl.com
Delivered-To: tls@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id AFB473A6A48 for <tls@core3.amsl.com>; Wed, 28 Apr 2010 09:41:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.072
X-Spam-Level:
X-Spam-Status: No, score=0.072 tagged_above=-999 required=5 tests=[AWL=-0.529, BAYES_50=0.001, J_CHICKENPOX_56=0.6]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sQPiQyDrRpLT for <tls@core3.amsl.com>; Wed, 28 Apr 2010 09:41:50 -0700 (PDT)
Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) by core3.amsl.com (Postfix) with ESMTP id BC5533A659C for <tls@ietf.org>; Wed, 28 Apr 2010 09:41:50 -0700 (PDT)
Received: from xs01.extendedsubset.com ([69.164.193.58]) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.68) (envelope-from <marsh@extendedsubset.com>) id 1O7AKP-000BGz-8N; Wed, 28 Apr 2010 16:41:37 +0000
Received: from [127.0.0.1] (localhost [127.0.0.1]) by xs01.extendedsubset.com (Postfix) with ESMTP id DC59260B6; Wed, 28 Apr 2010 16:41:30 +0000 (UTC)
X-Mail-Handler: MailHop Outbound by DynDNS
X-Originating-IP: 69.164.193.58
X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX1+oQ6+IDUCZesvOdWXZhY1sC8GgBpNPpcg=
Message-ID: <4BD8653B.3060600@extendedsubset.com>
Date: Wed, 28 Apr 2010 11:41:31 -0500
From: Marsh Ray <marsh@extendedsubset.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.8) Gecko/20100216 Thunderbird/3.0.2
MIME-Version: 1.0
To: tls@ietf.org, Peter Gutmann <pgut001@cs.auckland.ac.nz>
References: <E1O6frf-0002jc-1X@wintermute02.cs.auckland.ac.nz>
In-Reply-To: <E1O6frf-0002jc-1X@wintermute02.cs.auckland.ac.nz>
X-Enigmail-Version: 1.0.1
OpenPGP: id=1E36DBF2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Subject: Re: [TLS] RNG vs. PRNG
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
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/listinfo/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/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: Wed, 28 Apr 2010 16:41:51 -0000

I'd emailed Peter offlist since it was out of scope for the final call
discussion, but we decided it was appropriate for [TLS].

On 4/27/2010 3:09 AM, Peter Gutmann wrote:
> Marsh Ray <marsh@extendedsubset.com> writes:
>> If you're worried about an attacker analyzing your RNG, fix the 
>> RNG!
> 
> ... and hope that you haven't got any detail wrong

One could say that about nearly anything in a security-critical context.

> (we can't even get agreement on what a good RNG should be),

Getting that agreement would be really worthwhile!

> and persuade everyone else to fix their RNGs, and get every user to
> operate all of the RNGs in a secure manner, and ...

What's broken is broken and needs to be fixed regardless of how the RFCs
were interpreted in the past. But if we nail down the real requirements
and lexicon, we can prevent problems going forward.

> This is straightforward attack surface reduction, there's no reason 
> to expose the output of your crypto RNG to the world at large.

Why not? If you have something to hide then perhaps you are doing
something wrong? (don't take that the wrong way)

> To use an analogy, you wouldn't leave all your cash and valuables
> lying on the windowsill by the front door no matter how good your
> door locks are.

That's a great analogy! For something. I'm not sure I agree that it fits
here.

At some point you have to show your bits to the network, but you
shouldn't be so shy about exposing your entropy that your nonces come
out weak!

A counter-analogy: A few years back it was considered important for
security to minimize "known plaintext". Plaintext had to be compressed
before encryption, etc. But ciphers got better and are now expected to
be known-plaintext-attack resistant. The cipher is expected to work well
"out of the box" in the face of whatever input you may supply it.

So I suggest that today we have the means to make true RNGs that remain
strong regardless of how much output you give to Mallory. With such an
RNG in hand, let us not be miserly with it. We should use it everywhere
we can.

>> Would you be willing to substitute a simple counter there?
> 
> I'd have to examine the specs in more detail to see what the full 
> role of the nonce is, but my guess is that a counter would do it (in
> practice I'd hash the site FQDN and a counter or do something
> similar to make sure I don't use the same nonce as another site, but
> I'd have to look at the protocol in some detail to see whether it'd
> still work with just a counter).
> 
>> If not, how little entropy would you tolerate?
> 
> See above.

I really think the security of TLS relies on having a healthy amount of
entropy in the hello.random data areas. Its designers did not dedicate
64 bytes of those critical first TCP packets to random without good
reason. As I have considered various ways to break TLS, many times an
otherwise promising line of thought has hit a dead end due to "that darn
unpredictable hello.random_data!"

For example, if the server's random_data was based on just the FQDN and
a counter, an attacker could arrange for a repeated values by forcing a
reboot of the server or restart of the daemon (usually not too hard to
do). Now he can simply replay a transaction he previously observed being
made by the legitimate client. Likewise in the client direction, for
some ciphers.

- Marsh