Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Your random numbers are not that random

by cavac (Parson)
on Jul 21, 2012 at 23:22 UTC ( [id://983025]=note: print w/replies, xml ) Need Help??


in reply to Your random numbers are not that random

It's reasonable to assume that recent perl versions do some basic checks if seeding the random number generator works. Often enough, broken random numbers are a very big security problem..

Does your system have a *working* random number generator? What happens if you run this in your bash:

for i in {1..20}; do echo $RANDOM; done

What does ls /dev/*random show?

Here's another one: Does your system have a working clock that isn't showing something like "1970-01-01"? That sounds like a strange question, but perldoc -f srand seems to imply that it normally (also) uses the time of day for initialization. A system clock that has been reset to zero (check: "If system clock less than release date" or something like that) might make it easy to guesstimate the initial seed of the RNG, since process id and memory usage should be easy to guesstimate as well, especially if the program is run as part of the startup routine of a known embedded system.

"I know what i'm doing! Look, what could possibly go wrong? All i have to pull this lever like so, and then press this button here like ArghhhhhaaAaAAAaaagraaaAAaa!!!"

Replies are listed 'Best First'.
Re^2: Your random numbers are not that random
by davies (Prior) on Jul 21, 2012 at 23:45 UTC

    The bash line gives 20 apparently random 4 and 5 digit numbers that are different on both cards. I have /dev/random and /dev/urandom on both cards. The Pi does not have a battery clock, but setting the date & time after booting from a problem card does not change the problem.

    Regards,

    John Davies

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://983025]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-03-19 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found