From: Jean-Luc Cooke <jlcooke@certainkey.com>
To: "Theodore Ts'o" <tytso@mit.edu>, linux-kernel@vger.kernel.org
Subject: Re: [PROPOSAL/PATCH] Fortuna PRNG in /dev/random
Date: Fri, 24 Sep 2004 08:54:57 -0400 [thread overview]
Message-ID: <20040924125457.GO28317@certainkey.com> (raw)
In-Reply-To: <20040924043851.GA3611@thunk.org>
On Fri, Sep 24, 2004 at 12:38:51AM -0400, Theodore Ts'o wrote:
> I've taken a quick look at your patch, and here are some problems with it.
>
>
> 0. Code style issues
>
> Take a look at /usr/src/linux/Documentation/CodingStyle, ...
Will-do. My bad.
> 1. Don't leave out-of-date comments behind.
>
> Your patch makes significant changes, but you haven't updated the
> comments to reflect all of your changes. ...
>
> 2. The kernel will break if CONFIG_CRYPTO is false
> matter what. This was a design decision that was made long ago, to
> simplify user space applications that could count on /dev/random ...
My naive point of view tells me either this design decision from days of
yore was not thought out properly (blasphemy!), or the cryptoapi needs to
be in kernel.
A compromise would be to have a primitive PRNG in random.c is no
CONFIG_CRYRPTO is present to keep things working.
> 3. The TCP sequence numbers are broken
I see. I'll make the change. Thank you.
> As far as the Fortuna generator being "better", it really represents a
> philosophical divide between what I call Crypto academics" and "Crypto
> engineers". I won't go into that whole debate here, except to note
> that the current /dev/random was designed with close consultation with
> Colin Plumb, who wrote the random number generator found in PGP, and
> indeed /dev/random is very close to that used in PGP. In discussions
> on sci.crypt, there were those who argued on both side of this issue,
> with such notables as Peter Gutmann lining up against Jean-Luc.
Agreed. This is why I've been dreading in posting the patch here. The
current /dev/random is good, possibly the best OS-level RNG out there
right now. Ted, if I've never said it before or ever again, you've done
a great job. But my first impressions when I dove in were:
- gah! Why did someone go through so much trouble to make this hard to
analyse?
- humm, why not use the cryptoapi if we want random data?
- why do linux users want information secure random numbers? Wouldn't
crypto-secure random numbers be what they really want?
+ this, I've learned, is not something you can argue well against. It's
a matter of taste ... like Brittany Spears.
I wanted something more structured running on my machines so I re-wrote
random.c to use Fortuna, no entropy estimators, and uses the cryptoapi.
For the record, I believe David Wagner saw the case for replacing the PRNG
with Fortuna holding water. Even removing the entropy estimator. But
coneeded that some people will want /dev/random to block, so let them eat
cake.
> > + Removed entropy estimation
> > - Fortuna doesn't need it, vanilla-/dev/random and other Yarrow-like
> > PRNGs do to survive state compromise and other attacks.
>
> Entropy estimation is a useful concept in that it attempts to limit
> possible attacks caused by weaknesses in the crypto algorithms (such
> what happened at this year's Crypto's conference, where MD4, MD5,
> HAVAL, and SHA-0 were all weakened). The designed used by PGP and
> /dev/random both limit the amount of reliance placed in the crypto
> algorithms, where as Fortuna and Yarrow both assume that crypto
> primitives are 100% strong. This is again a philosophical divide;
> given that we have access to unpredicitability based on hardware
> timings, we should limit the dependence on crypto algorithsm and to
> design a system that is closer to "true randomness" as possible.
What if I told the SHA-1 implementation in random.c right now is weaker
than those hashs in terms of collisions? The lack of padding in the
implementation is the cause. HASH("a\0\0\0\0...") == HASH("a") There
are billions of other examples.
The academic vs. engineer analogy works the other way as well. Fortuna's
security can be directly reduced to the security of the underlying
algorithms. This is a good thing. If the security of all applications
were reduced in the same way, the world would be a safer place (political
discussions not withstanding).
Vanilla random.c depends on SHA-1 be to be resistant to 1-st pre-image
attacks. Fortuna depends on this as well with SHA-256 (or whatever
other hash you put in there). The "folding over with XOR" method you
use to make random.c stronger can work against you as well. It comes
down to "I've changed SHA-1 to make it stronger". The logic question
becomes: "Then why doesn't everyone use it?"
JLC
next prev parent reply other threads:[~2004-09-24 12:57 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-23 23:43 [PROPOSAL/PATCH] Fortuna PRNG in /dev/random Jean-Luc Cooke
2004-09-24 4:38 ` Theodore Ts'o
2004-09-24 12:54 ` Jean-Luc Cooke [this message]
2004-09-24 17:43 ` Theodore Ts'o
2004-09-24 17:59 ` Jean-Luc Cooke
2004-09-24 20:44 ` Scott Robert Ladd
2004-09-24 21:34 ` Theodore Ts'o
2004-09-25 14:51 ` Jean-Luc Cooke
2004-09-24 18:43 ` James Morris
2004-09-24 19:09 ` Matt Mackall
2004-09-24 20:03 ` Lee Revell
2004-09-24 13:44 ` Jean-Luc Cooke
2004-09-27 4:58 ` Theodore Ts'o
[not found] ` <20040927133203.GF28317@certainkey.com>
2004-09-27 14:55 ` Theodore Ts'o
2004-09-27 15:19 ` Jean-Luc Cooke
-- strict thread matches above, loose matches on Subject: below --
2004-09-24 0:59 linux
2004-09-24 2:34 ` Jean-Luc Cooke
2004-09-24 6:19 ` linux
2004-09-24 21:42 ` linux
2004-09-25 14:54 ` Jean-Luc Cooke
2004-09-25 18:43 ` Theodore Ts'o
2004-09-26 1:42 ` Jean-Luc Cooke
2004-09-26 5:23 ` Theodore Ts'o
2004-09-27 0:50 ` linux
2004-09-27 13:07 ` Jean-Luc Cooke
2004-09-27 14:23 ` Theodore Ts'o
2004-09-27 14:42 ` Jean-Luc Cooke
2004-09-26 6:46 ` linux
2004-09-26 16:32 ` Jean-Luc Cooke
2004-09-26 2:31 ` linux
2004-09-27 18:53 Manfred Spraul
2004-09-27 19:45 ` Jean-Luc Cooke
2004-09-28 0:07 ` Theodore Ts'o
2004-09-28 2:24 ` Jean-Luc Cooke
2004-09-28 13:46 ` Herbert Poetzl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040924125457.GO28317@certainkey.com \
--to=jlcooke@certainkey.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox