in reply to Re^2: Crypt::Random::ISAAC - secure random number generator
in thread Crypt::Random::ISAAC - secure random number generator

if (-e "/dev/random"){ .... } else { .... }

To generate a nice seed where you don't have /dev/random, you can do a checksum on your environment. Here are some sources of bits that are not random, but hard to reproduce:

Once you have a big string you can pipe it through a compression or cipher algorithm, just to distribute bits across 8bit space evenly, and use unpack to count the sum (see examples in perldoc).

/dev/random collects entropy from drivers, timers, and so forth, so essentially you're doing a cheap emulation of that.

If you get something nice, make a module out of it: Entropy::Gather::Win32 or something.

-nuffin
zz zZ Z Z #!perl

Replies are listed 'Best First'.
Re^4: Crypt::Random::ISAAC - secure random number generator
by radiantmatrix (Parson) on Jul 11, 2005 at 18:38 UTC

    Some excellent ideas, which I am pursuing. Any idea on how to (reasonably quickly) determine if I got good seed values (i.e. are they random enough)? I don't have enough of a math background, I guess.

    Larry Wall is Yoda: there is no try{}
    The Code that can be seen is not the true Code
      ent measures entropy in byte streams

      -nuffin
      zz zZ Z Z #!perl