Re: Security Engineering vs. Crypto Academics... (was strengthening /dev/urandom)

From: Peter Gutmann (pgut001_at_cs.auckland.ac.nz)
Date: 09/07/04


Date: 7 Sep 2004 04:50:13 GMT

tytso@mit.edu (Theodore Y. Ts'o) writes:

>I will also note that /dev/random relies is very conservative about what
>crypto properties it depends upon for its security, precisely because I was
>very paranoid about advances in cryptoanalytic techniques. This is one of
>the reasons why (in order to generate 10 bytes of entropy) we hash the entire
>512 byte pool, and then take the resulting 160 bit SHA hash and fold it half
>using XOR. (While we are doing this, we are also mixing the intermediate
>hash values back into the entropy pool; this prevents back-tracking attacks.)
>What is important here is that we only expose 10 bytes of data from 512 bytes
>worth of input; so even if SHA-1 is totally broken and it is possible to
>completely invert it, at *most* all that can be revealed from a single turn
>of the hash function is 10 out of 512 bytes.

This seems to be a common theme in any generator that's had some thought put
into the design. It's interesting tracing the evolution of these things, PGP
1.0 introduced the randomness pool but with a rather poor LCRNG-based mixing
function, PGP 2.0 introduced the mixing-via-hash-function (MD5 at the time,
IIRC the code was actually grabbed from the HPACK archiver), PGP 5,
/dev/random, and cryptlib added the fold-in-half obscuring of the output which
AFAIK was a Colin Plumb idea (he's influenced an awful lot of RNG design), etc
etc etc. The various designs were all cross-pollinated from other designs,
leading to a common set of best practices for randomness modules (large pools,
hash-based mixing, feedback into the pool, folding the output in half,
interlocks to prevent output if insufficiently seeded, two (or more) stages
with periodic re-seeding, not relying on a single crypto primitive, etc etc).
It's interesting to note that the proposed X9.82 spec contains a number of
these naturally-evolved design principles, so that any well-thought-out
generator will be more or less automatically compliant with the standard's
requirements.

(The one problem area is their PRNG, which is a somewhat awkward FIPS 186
 derivative. The spec very thoughtfully allows it to be run in parallel with
 another PRNG, so it's not that bad).

>(That's another big difference between those people who have a security
>engineering point of view, versus those with the academic point of view. For
>all that they claim they are worried about theoretical attacks, they tend to
>make assumptions that the crypto primitives will remain inviolate.)

One of the (unwritten) design principles for the generator I use is that any
component in it should be able to fail completely (it can be replaced with the
identity transformation) without affecting the overall security. I haven't
looked at /dev/random for awhile so I can't comment on that, but the PGP 5
generator also seems to have followed a similar unwritten design rule. The
idea is that if someone were to publish a paper tomorrow with a title like
"How to invert SHA-1 in 2^8 steps", there'd be no need to field-upgrade every
app that uses the generator (there would be a need to field-upgrade other bits
of the app, however).

Peter.



Relevant Pages

  • Re: Encryption key changing the encryption logic.
    ... >>decides among various elementary crypto operations based on what it sees ... >>adversary knows which key bits select which algorithm and, in practice, N ... > or two rounds of a different block cipher. ... this design is covered under the 1-of-N discussion and your design is ...
    (sci.crypt)
  • Re: [PROPOSAL/PATCH] Fortuna PRNG in /dev/random
    ... > in random.c with the Fortuna PRNG designed by Ferguson and Schneier (Practical ... The kernel will break if CONFIG_CRYPTO is false ... don't want crypto, then you don't want secure random numbers." ... design a system that is closer to "true randomness" as possible. ...
    (Linux-Kernel)
  • Re: Comments re ISCs announcement on bind9 security
    ... It's a text published by ISC as a follow up to the bind9 predictable id saga. ... less an issue of using "extremely weak crypto" as it has been ... than the use of a random number generator that did not ... The particular pseudo-random number generator that BIND 9 now uses is a poor ...
    (Bugtraq)
  • Re: Math.random
    ... the number of bits the generator outputs at a time has nothing ... their succession present systematic biases. ... as the design of UUIDs assumes them to be. ... crypto system of all, the Vernam cipher or one-time pad. ...
    (comp.lang.javascript)
  • Scottish invention promises power revolution
    ... Scottish invention promises power revolution ... A radical new design of electrical generator that solves an engineering ... A new company, NGenTech, was formed ten days ago to exploit the new design. ...
    (soc.culture.scottish)