Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

RE (tilly) 3: a random sort of list

by tilly (Archbishop)
on Sep 08, 2000 at 21:23 UTC ( [id://31632]=note: print w/replies, xml ) Need Help??


in reply to RE: RE (tilly) 1: a random sort of list
in thread "a random sort of list"

Yes. But getting a good random seed can be hard.

On systems that have it, sample /dev/random. Frequent CGI scripts might run out of entropy though. CPAN has some cryptography modules that do a similar thing with similar limits.

If you need a *lot* of random data, make a large file from something volatile (/dev/kmem is a good source), compress it, throw away the start and encrypt *that*. Compress again and throw away the start if you are paranoid. Then sample.

The reason why this works is that perfectly random data is mathematically identical to data with an information rate of 1 (one bit of info per bit of data). So you start with data people cannot easily determine. Compression tries to increase your information rate so it becomes closer to random. (Modulo necessary signatures.) However given the type of information there will be recognizable artifacts. Encryption tries to scramble your information unrecognizably. The result is unpredicatable data that should be very close to looking like white noise.

ObTrivia: Virtually any form of encryption, even very weak ones (eg the pathetic standard Unix crypt) will be much harder to break if you first compress the data stream.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-25 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found