Re: [TLS] RNG vs. PRNG

Marsh Ray <marsh@extendedsubset.com> Wed, 05 May 2010 22:02 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 72D393A6D32 for <tls@core3.amsl.com>; Wed, 5 May 2010 15:02:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.162
X-Spam-Level:
X-Spam-Status: No, score=-0.162 tagged_above=-999 required=5 tests=[AWL=-0.163, BAYES_50=0.001]
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 oSCyOL7LegyA for <tls@core3.amsl.com>; Wed, 5 May 2010 15:02:52 -0700 (PDT)
Received: from mho-01-ewr.mailhop.org (mho-01-ewr.mailhop.org [204.13.248.71]) by core3.amsl.com (Postfix) with ESMTP id D74A63A6CE6 for <tls@ietf.org>; Wed, 5 May 2010 15:02:51 -0700 (PDT)
Received: from xs01.extendedsubset.com ([69.164.193.58]) by mho-01-ewr.mailhop.org with esmtpa (Exim 4.68) (envelope-from <marsh@extendedsubset.com>) id 1O9mfu-000Gxs-8s; Wed, 05 May 2010 22:02:38 +0000
Received: from [127.0.0.1] (localhost [127.0.0.1]) by xs01.extendedsubset.com (Postfix) with ESMTP id 10DDD6048; Wed, 5 May 2010 22:02:37 +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: U2FsdGVkX19N3gDjPkkU/EwdTkMo2/hHLs4Ocx1O6Bs=
Message-ID: <4BE1EAFD.5030604@extendedsubset.com>
Date: Wed, 05 May 2010 17:02:37 -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: Nicolas Williams <Nicolas.Williams@oracle.com>
References: <Pine.LNX.4.44.1005042046390.29670-100000@citation2.av8.net> <C806603B.A3E9%uri@ll.mit.edu> <20100505062823.GW9429@oracle.com>
In-Reply-To: <20100505062823.GW9429@oracle.com>
X-Enigmail-Version: 1.0.1
OpenPGP: id=1E36DBF2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: "'tls@ietf.org'" <tls@ietf.org>
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, 05 May 2010 22:02:53 -0000

On 5/5/2010 1:28 AM, Nicolas Williams wrote:
> I'm not sure what the point of this sub-thread is.

The currently language in the spec is broken and misleading to the point
that people (implementers) are unclear about the requirements for
various protocol structures.

> TLS can't really
> mandate that implementations use real RNGs, and I suspect many (myself
> included) would object to a requirement that implementors use real
> RNGs not coupled with PRNGs (as a bias removal / RNG stream
> post-processing technique).

It's entirely within the scope of the spec to specify what properties of
various structures (e.g., premaster secret) are required for security.
The current specs do talk about it, but people seem to come away with
different meanings because the terminology is inconsistent.

In the case of client_hello.random and server_hello.random, I believe
that even though they are sent in-the-clear they need to be
crypto-quality unpredictable (and of course reveal no information about
any secret internal state).

> Also, none of this is new; the subject has been
> exhaustively treated before, thus we're just annoying uninterested TLS
> WG list subscribers and wasting our own time.

I agree that some of this is a tiny bit annoying, it bugs me that
everyone isn't on the same page with the terminology. I don't understand
why anyone would confuse a raw thermal noise source with a
well-constructed RNG (e.g., a healthy /dev/random), with a deterministic
PRNG (e.g. TLS's PRF), and so on.

Still, it seems pretty important that the next revision of the spec (or
some other IETF document) conveys the requirements clearly enough that
insecure implementations don't get shipped.

- Marsh


On 5/5/2010 1:28 AM, Nicolas Williams wrote:
> I'm not sure what the point of this sub-thread is.  TLS can't really
> mandate that implementations use real RNGs, and I suspect many (myself
> included) would object to a requirement that implementors use real RNGs
> not coupled with PRNGs (as a bias removal / RNG stream post-processing
> technique).  Also, none of this is new; the subject has been
> exhaustively treated before, thus we're just annoying uninterested TLS
> WG list subscribers and wasting our own time.
> 
> On Tue, May 04, 2010 at 11:37:31PM -0400, Blumenthal, Uri - 0668 - MITLL wrote:
>> In general I have to agree with Dean.
>>
>> True RNG "itself" can't be attacked - though its implementations could
>> (depending on many circumstances). Attacks against PRNG could be both
>> cryptanalytic and implementation-directed.
> 
> A true RNG depends on physical processes.  Therefore it can be attacked
> by physical means.  Now, the obvious retort is that without physical
> security you can't have cryptographic security, and that is true, but
> there's degrees of physical access that a device ought to be able to
> tolerate.  The simplest thing to do is to couple an RNG to a PRNG.
> Other post-processing of RNG outputs to remove bias are also possible.
> 
> (Also, one could conceive of RNG devices that can be affected without
> direct access.  For example, thermal RNGs might get biased when the
> system runs hot.)
> 
>> PRNG can't have higher behavioral assurance than RNG because if one can bias
>> RNG output then the attacker got (or drastically reduced the search space
>> for) the PRNG seed - and thus can be highly assured of predicted PRNG
>> output. :-)
> 
> But the attacker would have to have prolonged physical access to the
> RNG, and from the get-go; if at any point the attacker does not then the
> attacker loses (assuming a well-constructed entropy pool, mixer and
> extractor, which should have PRNG characteristics).
> 
> Let's put it this way: what rationale is there to not have a PRNG
> coupled to an RNG?  (An "SRNG" in John Denker's terminology[0], but that
> term isn't very common.  Even in the "true" RNG that Denker describes
> there's still a cryptographic hash function in use.)
> 
>> Unlike RNG, PRNG security has critical dependence on secrecy of its seed -
>> in addition to all other concerns (such as algorithm strength, correctness
>> of implementation, defense - or lack of - against attackers who can lay
>> hands on the box, etc - some of which are shared with RNG and some are
>> PRNG-unique). 
>>
>> PRNGs are so popular because RNG are hard to come by (and those available
> 
> True, but:
> 
>> typically trickle output bits, and the closer to consumer they are - the
> 
> a trickle of entropy over hours, coupled to a PRNG, can produce decent
> results.  Also, I doubt the rate of entropy gathering from sensors is as
> low as all that for, say, a cell phone -- maybe for one that just sits
> there unused.  And consumer devices have enough ROM and flash storage
> that a seed, counter, timestamp, ... can be stored and used to uniquely
> seed a PRNG at bootup, which, combined with even a fairly low rate of
> entropy gathering results in a system that's more easily attacked via
> other vulnerabilities in the very rapidly growing OSes, TCBs and apps
> that these devices run.
> 
>> more vulnerable to implementation attacks), and collecting decent amount of
>> randomness from an RNG is even harder. So naturally hybrid approach is
>> embraced, when one uses whatever little he can get from a true RNG (if he
>> can get hold of it) and seeds with it PRNG to get as much of "acceptable"
>> randomness as necessary.
> 
> Consumer devices and desktops don't usually get attacked via PRNG
> attacks (except, of course, when the PRNG or seeding process is flawed
> and the result is well-known keys, as in the Debian OpenSSL problem from
> a while back).  This sub-thread might as well be about how many angels
> can dance on a pinhead :)
> 
> [0] http://www.av8n.com/turbid/paper/turbid.htm#htoc47
> 
> Nico