views:

162

answers:

6

Hi, I am dealing with some computer security issues at the school at the moment and I am interested in general programming public preferences, customs, ideas etc. If you have to use a random number generator or extractor, which one do you choose? Why do you choose it? The mathematical properties, already implemented as a package or for what reason? Do you write your own or use some package?

A: 

HotBits.

JSBangs
You know that when that link dies, this answer will be completely useless.
tvanfosson
It's a server which gives you bits. If the link dies the server is gone, so of course the answer would then be useless.
Steve Jessop
A: 

Retracted as per comments.

gahooa
I don't think "Mersenne Twister" and "security issues" should really appear in the same question/answer pair. It's fast and has good distribution, but it's no good for security work.
Steve Jessop
+4  A: 

If computational time is no object, then you can't go wrong with Blum Blum Shub (http://en.wikipedia.org/wiki/Blum%5Fblum%5Fshub). Informally speaking, it's at least as secure (hard to predict) as integer factorization.

Thom Smith
+2  A: 

dev/random, or equivalent on your platform.

It returns bits from an entropy pool fed by device drivers. No need to worry about mathematical properties.

If you're after a cryptographically secure PRNG, then repeated application of a secure hash to a large seed array is generally the way to go. Don't invent your own algorithm, though, go for a version of Fortuna or something else reasonably well reviewed.

Steve Jessop
+2  A: 

The keys for encryption of phone calls between presidents of the USA and USSR were said to be generated from cosmic rays. We checked it in the physics lab at out univercity -- their energies yield true Gaussian distribution. ;-) So for the best encryption you should use these, because such random sequence can not be replayed. Unless, of course, your adversary covertly builds a particle accelerator near your random number generator.

Ah... about computers... Well, acquire a stream that comes from something physical, not computed. /dev/random is an easiest solution, but your hand-made Geiger-counter attached to USB would give the best randomness ever.

Pavel Shved
+1  A: 

For a little school project, I'd use whatever the OS provides for random number generation.

For a serious security application (eg: COMSEC-level encryption), I use a hardware random number generator. Pure algorithms with no hardware access by definition don't produce random numbers.

T.E.D.