Re: [TLS] RNG vs. PRNG

Marsh Ray <> Wed, 28 April 2010 16:41 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id AFB473A6A48 for <>; Wed, 28 Apr 2010 09:41:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 0.072
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 ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id sQPiQyDrRpLT for <>; Wed, 28 Apr 2010 09:41:50 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id BC5533A659C for <>; Wed, 28 Apr 2010 09:41:50 -0700 (PDT)
Received: from ([]) by with esmtpa (Exim 4.68) (envelope-from <>) id 1O7AKP-000BGz-8N; Wed, 28 Apr 2010 16:41:37 +0000
Received: from [] (localhost []) by (Postfix) with ESMTP id DC59260B6; Wed, 28 Apr 2010 16:41:30 +0000 (UTC)
X-Mail-Handler: MailHop Outbound by DynDNS
X-Report-Abuse-To: (see for abuse reporting information)
X-MHO-User: U2FsdGVkX1+oQ6+IDUCZesvOdWXZhY1sC8GgBpNPpcg=
Message-ID: <>
Date: Wed, 28 Apr 2010 11:41:31 -0500
From: Marsh Ray <>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/20100216 Thunderbird/3.0.2
MIME-Version: 1.0
To:, Peter Gutmann <>
References: <>
In-Reply-To: <>
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-Mailman-Version: 2.1.9
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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 <> 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

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