All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eli Billauer <eli_billauer@users.sf.net>
To: linux-kernel@vger.kernel.org
Subject: [RFC] frandom - fast random generator module
Date: Thu, 16 Oct 2003 10:22:03 +0200	[thread overview]
Message-ID: <3F8E552B.3010507@users.sf.net> (raw)

  Hello,

Frandom is the faster version of the well-known /dev/urandom random 
number generator. Not instead of, but rather as a supplement, when 
pseudorandom data is needed at high rate. Few tests so far show that 
frandom is 10-50 times faster than urandom.

The project's home page: http://frandom.sourceforge.net.

The module works on 2.2, 2.4 and 2.6 kernels. A few straightforward 
#ifdef's handle compatability (easy to remove to match common coding style).

Purpose
=======

(1) Frandom is a handy source of bulk random data.
(2) It is *not* intended for encryption and security-related applications.
(3) frandom is intended for (scientific) simulations, wiping the disk, 
stress tests on algorithms and so on.
(4) It is more of an /dev/zero than /dev/random

Quality of random numbers
=========================

(1) The module has been tested for random number quality with the 
"diehard" set of tests, and passed them all. This indicates that the 
bytes are random enough for most scientific purposes.
(2) Additional tests results are welcomed.
(3) The core of frandom is based upon RC4. frandom is exactly RC4, minus 
the XOR operation with the data. So if frandom doesn't generate good 
random numbers, I would wonder why RC4 is considered safe.
(4) The random generator is seeded with 256 bytes of the kernel's 
get_random_bytes() for every file opened on /dev/frandom. This is 
equivalent to a 2048-bit random key on RC4.
(5) I don't see frandom fit for crypto purposes, mainly because the 
module was naively written. I won't fall off my chair if it turns out to 
be crypto-safe, but I wouldn't trust it either. Not yet, anyhow.
(6) Those who read the source and feel that such a simple algorithm 
can't create good random: That's exactly the beauty of RC4: It's simple 
and it works.

frandom and the linux kernel tree
=================================

(1) Occasionally, people complain that /dev/urandom is too slow, wishing 
for something faster.
(2) Other argue that a random generator can be written in user space.
(3) I agree with both. And I use /dev/zero a lot. I know how to write a 
zero-generating application in user space.
(4) The module is small: 6kB of source code as a standalone module, and 
2.3 kB of kernel memory.

Test results and comments will be appreciated.

    Eli



             reply	other threads:[~2003-10-16  8:21 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-16  8:22 Eli Billauer [this message]
2003-10-16  8:36 ` [RFC] frandom - fast random generator module Nick Piggin
2003-10-16 10:20   ` Eli Billauer
2003-10-16 10:48     ` Nick Piggin
2003-10-16 11:29     ` Jeff Garzik
2003-10-16 12:27       ` Eli Billauer
2003-10-16 15:10         ` Jeff Garzik
2003-10-16 16:20       ` Andreas Dilger
2003-10-16 16:31         ` Jeff Garzik
2003-10-16 18:18           ` Andreas Dilger
2003-10-16 18:52             ` Richard B. Johnson
2003-10-16 19:31             ` Matt Mackall
2003-10-16 20:40               ` Andreas Dilger
2003-10-16 21:03             ` David Wagner
2003-10-16 23:17             ` Jeff Garzik
2003-10-16 23:42               ` Andreas Dilger
2003-10-17  0:34                 ` David Wagner
2003-10-16 17:45         ` Matt Mackall
2003-10-16 18:38           ` Andreas Dilger
2003-10-16 19:08             ` Matt Mackall
2003-10-16 20:27               ` Andreas Dilger
2003-10-16 20:37                 ` Matt Mackall
2003-10-16 17:31       ` Matt Mackall
2003-10-16 23:03         ` Eli Billauer
2003-10-16 23:07           ` Jeff Garzik
2003-10-16 23:13           ` Matt Mackall
2003-10-16 23:35           ` jw schultz
2003-10-21 19:24       ` bill davidsen
2003-10-21 19:55       ` bill davidsen
2003-10-21 21:21         ` Helge Hafting
2003-10-21 22:18           ` bill davidsen
2003-10-22  1:04             ` H. Peter Anvin
2003-10-21 19:17   ` bill davidsen
2003-10-21 21:00     ` H. Peter Anvin
2003-10-21 22:08       ` bill davidsen
2003-10-22  1:06         ` H. Peter Anvin
2003-10-22  2:56           ` jw schultz
2003-10-22 16:22             ` Kent Borg
2003-10-23  2:46               ` Dale Farnsworth
2003-10-23  3:22               ` Sandy Harris
2003-10-23 14:15                 ` Kent Borg
2003-10-24 17:37                 ` bill davidsen
2003-10-24 17:54                   ` Theodore Ts'o
2003-10-24 20:59                   ` David Wagner
2003-10-24 21:33                     ` jw schultz
2003-10-22  3:49           ` Sandy Harris
2003-10-16 10:45 ` Ingo Oeser
2003-10-21 19:30   ` bill davidsen
     [not found] <HbGf.8rL.1@gated-at.bofh.it>
     [not found] ` <HbQ5.ep.27@gated-at.bofh.it>
     [not found]   ` <Hdyv.2Vd.13@gated-at.bofh.it>
     [not found]     ` <HeE6.4Cc.1@gated-at.bofh.it>
     [not found]       ` <HjaT.3nN.7@gated-at.bofh.it>
     [not found]         ` <Hjkw.3Al.11@gated-at.bofh.it>
2003-10-16 17:46           ` David Mosberger-Tang
2003-10-16 19:28             ` Eli Billauer
2003-10-16 20:42               ` Andreas Dilger
2003-10-21 19:46                 ` bill davidsen
2003-10-16 21:30               ` Matt Mackall

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=3F8E552B.3010507@users.sf.net \
    --to=eli_billauer@users.sf.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.