Date: Sat, 23 Aug 2003 02:19:18 -0700 From: David Schultz <das@FreeBSD.ORG> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/libkern arc4random.c Message-ID: <20030823091918.GA8236@HAL9000.homeunix.com> In-Reply-To: <12187.1060975343@critter.freebsd.dk> References: <200308151911.h7FJBkOI003844@grimreaper.grondar.org> <12187.1060975343@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 15, 2003, Poul-Henning Kamp wrote: > In message <200308151911.h7FJBkOI003844@grimreaper.grondar.org>, Mark Murray wr > ites: > > >For the paranoids, this is cheap (almost free), and is solid from a > >arcfour-neurotic perspective. > > We should actually have a script in src/tools/regression which ran > some or all of the stuff from http://csrc.nist.gov/rng/ on our > various random sources... Another test suite, which seems to be highly regarded, is Marsaglia's DIEHARD package. The sources themselves are probably on the web somewhere, and there's some sample output from the last time the subject of randomness came up on the lists at http://www.csua.berkeley.edu/~das/marsaglia/ . I can run it again if there's interest. Note that it requires a little bit more effort to test for the kind of problem Mike was trying to solve by throwing out the first few numbers after reseeding. The issue there is that while some RNGs produce good results when you seed them once and call them repeatedly, they may not appear so random with respect to the intial seed. That is, if you keep reseeding with successive numbers in a predictable pattern, the initial sequences you get out of the generator may not look so random when you string them all together. I'm not a cryptographer, but FWIW, I'm told that there are statistical tests that can differentiate an ARC4 sequence from a truly random sequence. However, it takes something like 2^31 bits of data to detect the statistical bias.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030823091918.GA8236>