Random number generation, simple question.

Olivier Dagenais olivierS.dagenaisP at canadaA.comM
Mon Jul 3 12:15:48 EDT 2000


I'm not sure feeding "random" numbers as the seed will keep producing random
numbers.

You may want to try scanning different components of the computer, in order
to retrieve values that, chances are, will be different from machine to
machine and from time to time, like how many files are there on the
computer, what the address of the network card is, how long has the machine
been running, what keys has the user pressed, how has the mouse or joystick
been moved, etc... ???

--
----------------------------------------------------------------------
Olivier A. Dagenais - Carleton University - Computer Science III


"Kalle Svensson" <kalle at gnupung.net> wrote in message
news:Pine.GSO.4.21.0007031546410.25965-100000 at luna.dsv.su.se...
> Hello.
>
> I have a few questions about the (pseudo) random number generator supplied
> in the standard library. I need 80 random bits (for a CipherSaber IV) but
> I hear most RNG's only supply 32 bits or less. My questions are:
>
>  * How many random bits does whrandom.random() generate?
>
>  * Suppose I do a loop where I get a byte at a time and then re-seed the
>    generator either with random numbers from the generator or with values
>    from time. Will that improve the randomness?
>
>  * Are there better alternatives? I understand I could read from
>    /dev/random on Linux, but this isn't portable, and even though I only
>    use GNU/Linux myself, I have friends who don't. If anyone can tip me
>    off about a similar feature in Win32, I could just detect platform and
>    use the appropriate function, of course. I don't think I have to care
>    about Macs or other *NIX dialects. Phew... :)
>
> Hope I'm making sense even though I hardly understand what I'm talking
> about... :)
>
> TIA,
>   Kalle Svensson
>





More information about the Python-list mailing list