Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.


In reply to RE (tilly) 3: a random sort of list by tilly
in thread "a random sort of list" by petemar1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-19 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found