Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re:x2 spew - print out random characters

by grinder (Bishop)
on Nov 12, 2001 at 20:12 UTC ( #124852=note: print w/ replies, xml ) Need Help??


in reply to Re: spew - print out random characters
in thread spew - print out random characters

OpenBSD talks about /dev/srandom, which produces a cryptographically strong source of bits, but it just blocks on my machine. I wonder if I have to fiddle with a kernel setting to make it work.


update: turns out that on OpenBSD, you cannot just open R, '/dev/srandom' and hope that it works. Apparently (and this strikes me as incredibly klugey, but maybe it's more bulletproof), you have to do something like:

dd if=/dev/srandom of=./bits bs=4096 count=1

and after a suitably impressive wait you will have some strong random bits waiting for you in ./bits.


Otherwise an alternative is to grab some bits from a random seed. Maybe for v2.0. I think Linux has /dev/random which blocks if the entropy pool is exhausted, which would be the way to go on that platform. Trouble is that OpenBSD doesn't implement that device, it is RFU.

update: It looks like the lava lamp is dead.

--
g r i n d e r


Comment on Re:x2 spew - print out random characters
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-10-25 02:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (140 votes), past polls