linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Luc Cooke <jlcooke@certainkey.com>
To: David McCullough <davidm@snapgear.com>
Cc: Jeff Garzik <jgarzik@pobox.com>,
	johnpol@2ka.mipt.ru, Andrew Morton <akpm@osdl.org>,
	herbert@gondor.apana.org.au, jmorris@redhat.com,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	cryptoapi@lists.logix.cz
Subject: Re: [PATCH] API for TRNG (2.6.11) [Fortuna]
Date: Thu, 31 Mar 2005 08:58:22 -0500	[thread overview]
Message-ID: <20050331135822.GR24697@certainkey.com> (raw)
In-Reply-To: <20050331035214.GA12181@beast>

On Thu, Mar 31, 2005 at 01:52:14PM +1000, David McCullough wrote:
> 
> Jivin Jeff Garzik lays it down ...
> ...
> > >If kernelspace can assist and driver _knows_ in advance that data
> > >produced is cryptographically strong, why not allow it directly
> > >access pools?
> > 
> > A kernel driver cannot know in advance that the data from a hardware RNG 
> > is truly random, unless the data itself is 100% validated beforehand.
> 
> You can also say that it cannot know that data written to /dev/random
> is truly random unless it is also validated ?
> 
> For argument you could just run "cat < /dev/hwrandom > /dev/random"
> instead of using rngd.
> 
> If /dev/random demands a level of randomness,  shouldn't it enforce it ?
> 
> If the HW is using 2 random sources, a non-linear mixer and a FIPS140
> post processor before handing you a random number it would be nice to
> take advantage of that IMO.


For those who are interested, my Fortuna patch to the Linux RNG (/dev/random,
/dev/urandom) is available here (2.6.12-rc1, works on kernels as low as
2.6.11.4):
  http://jlcooke.ca/random/

Fortuna is a Cryptographically Secure Random Number Generator (CSRNG)
developed by Neils Ferguson and Bruce Schnier and published in their book
Applied Cryptography.

By most regards, it is the state of the art as far as software based CSRNGs
go.  The website gives an over view of the design, here is a summary:
  Fortuna uses a block cipher (AES128) in CTR mode to generate output.
  Fortuna uses a 32 hash states (SHA-256) which collect event data from
  sources of randomness (as usual in Linux).
  Once every 0.1sec or so, some of the hash states are finalised and the
  digests are collected.
  These digests are hashed together with with the current block cipher key to
  produce the new block cipher key.

Ferguson goes into detail in Practical Cryptography as to why this design is
superior to Yarrow based RNG (like the existing Linux RNG) and also delves
into why entropy estimation is impossible and is infact a liability in RNG
design.

My patch keep the entropy estimation from the current Linux RNG since this is
a very controversial issue with most people.  Disabling entropy estimation
and /dev/random blocking can be done by changing the RANDOM_NO_ENTROPY_COUNT
macro to 1.

I have not tested the syncookie code yet.  But networking works smoothly
after I echo "1" to /proc/sys/net/ipv4/tcp_syncookies.  Any help on this
would be great.

JLC

  reply	other threads:[~2005-03-31 14:02 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-15 13:36 ocf-linux-20050315 - Asynchronous Crypto support for linux David McCullough
2005-03-24  4:27 ` [PATCH] API for true Random Number Generators to add entropy (2.6.11) David McCullough
2005-03-24  4:30   ` [PATCH] API for true Random Number Generators to add entropy (2.4.29) David McCullough
2005-03-24  4:33   ` [PATCH] API for true Random Number Generators to add entropy (2.6.11) Jeff Garzik
2005-03-24  4:46     ` David McCullough
2005-03-24  4:49       ` Michal Ludvig
2005-03-24  5:13       ` Jeff Garzik
2005-03-24 12:37         ` Folkert van Heusden
2005-03-24 12:52         ` David McCullough
2005-03-24 20:51           ` Jeff Garzik
2005-03-24  7:18       ` Jan Engelhardt
2005-03-24  7:37         ` Dave Jones
2005-03-24  4:38   ` [PATCH] " Andrew Morton
2005-03-24  5:17     ` Jeff Garzik
2005-03-24  5:32       ` Andrew Morton
2005-03-29  1:33         ` Matt Mackall
2005-03-24  5:43       ` Randy.Dunlap
2005-03-24 12:21     ` Evgeniy Polyakov
2005-03-24 20:39       ` Jeff Garzik
2005-03-25  4:25         ` Evgeniy Polyakov
2005-03-25  4:45           ` Jeff Garzik
2005-03-25  5:46             ` Herbert Xu
2005-03-31  3:52             ` David McCullough
2005-03-31 13:58               ` Jean-Luc Cooke [this message]
2005-04-13 15:36                 ` [PATCH] API for TRNG (2.6.11) [Fortuna] Jean-Luc Cooke
2005-03-24 12:28     ` [PATCH 2.6.12-rc1] API for true Random Number Generators to add entropy David McCullough
2005-03-24 12:38     ` [PATCH] API for true Random Number Generators to add entropy (2.6.11) David McCullough
2005-03-24 18:51     ` Andi Kleen
2005-03-24 20:37       ` Jeff Garzik
2005-03-27 17:19         ` Andi Kleen
2005-03-27 18:55           ` folkert
2005-03-28 15:20             ` Andi Kleen
2005-03-28 15:24               ` folkert
2005-03-29  7:17               ` Jeff Garzik
2005-03-29 15:03                 ` Andi Kleen
2005-03-29  7:16             ` Jeff Garzik
2005-03-29 15:07               ` Andi Kleen
2005-03-29  7:15           ` Jeff Garzik
2005-03-24 11:59   ` Evgeniy Polyakov
2005-03-24 12:48     ` Jeff Garzik
2005-03-24 13:08       ` Evgeniy Polyakov
2005-03-24 20:53         ` Jeff Garzik
2005-03-24 13:23       ` David McCullough
2005-03-24 13:46         ` Evgeniy Polyakov
2005-03-24 20:56           ` Jeff Garzik
2005-03-25  4:34             ` Evgeniy Polyakov
2005-03-25  4:48               ` Jeff Garzik
2005-03-25  5:33                 ` Evgeniy Polyakov
2005-03-25  5:58                   ` Jeff Garzik
2005-03-25  6:16                     ` Evgeniy Polyakov
2005-03-25  6:13                       ` Herbert Xu
2005-03-25  6:34                         ` Evgeniy Polyakov
2005-03-25  6:33                           ` Herbert Xu
2005-03-25  6:59                             ` Evgeniy Polyakov
2005-03-25  6:56                               ` Herbert Xu
2005-03-25  7:19                                 ` Evgeniy Polyakov
2005-03-25  7:19                                   ` Jeff Garzik
2005-03-25  7:38                                     ` Evgeniy Polyakov
2005-03-25  7:25                                   ` Herbert Xu
2005-03-25  7:58                                     ` Evgeniy Polyakov
     [not found]                                       ` <424495A8.40804@freescale.com>
2005-03-25 23:43                                         ` Jeff Garzik
2005-03-25 23:47                                           ` Herbert Xu
2005-03-26  0:47                                             ` Evgeniy Polyakov
2005-03-26  0:36                                               ` Herbert Xu
2005-03-26  8:52                                                 ` Evgeniy Polyakov
2005-03-28 13:45                                           ` Jean-Luc Cooke
2005-03-28 21:30                                             ` Herbert Xu
2005-03-29 10:23                                     ` Pavel Machek
2005-03-29 10:21                         ` Pavel Machek
2005-03-29 10:30                           ` Herbert Xu
2005-03-29 10:38                             ` Pavel Machek
2005-03-29 10:45                               ` Herbert Xu
2005-03-29 10:50                             ` Evgeniy Polyakov
2005-03-29 10:46                               ` Herbert Xu
2005-03-29 11:42                                 ` Evgeniy Polyakov
2005-03-29 11:39                                   ` Herbert Xu
2005-03-29 12:15                                     ` Evgeniy Polyakov
2005-03-29 12:13                                       ` Pavel Machek
2005-03-29 12:43                                       ` Herbert Xu
2005-03-29 13:11                                         ` Evgeniy Polyakov
2005-03-29 14:38                                           ` Evgeniy Polyakov
2005-03-29 13:48                                     ` Jean-Luc Cooke
2005-03-29 23:36                               ` Andrew James Wade
2005-03-29 22:02                         ` Bill Davidsen
2005-03-29 22:24                           ` Kyle Moffett
2005-03-29 22:46                           ` Jeff Garzik
2005-03-30 21:22                             ` Bill Davidsen
2005-03-30 21:49                               ` Jeff Garzik
2005-03-30 22:27                                 ` Paul Jackson
2005-03-29 10:18                 ` Pavel Machek
2005-03-29 10:25                   ` Herbert Xu
2005-03-29 10:53                   ` Martin Mares
2005-03-24 20:54         ` Jeff Garzik
2005-03-24 14:25       ` Jean-Luc Cooke
2005-03-24 20:57         ` Jeff Garzik
2005-03-24 21:20         ` Herbert Xu
2005-03-25  5:52     ` Evgeniy Polyakov

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=20050331135822.GR24697@certainkey.com \
    --to=jlcooke@certainkey.com \
    --cc=akpm@osdl.org \
    --cc=cryptoapi@lists.logix.cz \
    --cc=davidm@snapgear.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jgarzik@pobox.com \
    --cc=jmorris@redhat.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).