Re: kernel security questions

Jon Lewis (jlewis@inorganic5.fdt.net)
Mon, 16 Mar 1998 14:31:05 -0500 (EST)


On Mon, 16 Mar 1998, Theodore Y. Ts'o wrote:

> urandom is the faster less secure random generator. Looking at a few dd's
> from it, I would think it would work as well for this purpose. Instead of
> using isalpha and friends, just make sure the char value is between 32 and
> 126. That'll give you a better range of usable but non-alpha characters.
>
> /dev/urandom and /dev/random use the same algorithm for generating
> random numbers, and so their speed is the same. The big difference
> between the two is that the random number generator keeps traccxcxcx

If you try to read signifigant amounts of data from both /dev/random and
/dev/urandom, you'll find urandom to be orders of magnitude faster.
Perhaps this is just because /dev/random runs out of random bytes and
makes you wait for more to accumulate. Perhaps trying to read large
amounts of data from either is misuse. Either way, I took what I said
straight from devices.txt:

8 = /dev/random Nondeterministic random number gen.
9 = /dev/urandom Faster, less secure random number gen.

If you want to generate large amounts of random data, like for creating
big files full of junk for testing new disks, using something like
putchar(rand()); is considerably faster than reading /dev/urandom.

------------------------------------------------------------------
Jon Lewis <jlewis@fdt.net> | Unsolicited commercial e-mail will
Network Administrator | be proof-read for $199/message.
Florida Digital Turnpike |
______http://inorganic5.fdt.net/~jlewis/pgp for PGP public key____

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu