Re: An home-made Random Generator
- From: Anon <null@xxxxxxxx>
- Date: Fri, 08 Jul 2005 08:29:12 +1000
Hi Ross,
I think that to make the distinction of "cryptographically secure" is a bit of a furphy --- Cryptographers are interested in pseudorandom number generators that are fast. Essentially, a stream cipher is a pseudorandom number generator.
The important thing is that the output "looks" random --- that is, it is not predictable and has the statistical properties of a random distribution (but can be replicated by anyone with the key). In this case it is the unpredictability that is important.
Given that, any well designed cipher or hash function will do the job, although I think stream ciphers might be easier to adapt.. I would recommend Rijndael (also known as AES) and RC6. These can be used to generate a stream of zeros and ones, which can be transformed into any number range you need. There is also optimised code available for Rijndael from NIST.
One of my colleagues has written a utility for which always one to specify the range and the type of output. It is then able to generate millions of pseudorandom values in a matter of minutes.
Hope this helps,
Ursus
clemenr@xxxxxxxxxx wrote:
Mainly out of curiousity, when I feel the need to use a "good" random number generator, I usually use the Mersenne Twister. Not because I've researched the properties, but because I've seen it quoted by people as being good, it's fast, and there is no shortage of free code implementing it.
I basically use random numbers for the bootstrap, simple simulations, permutation tests, etc. I do not as far as I know need a cryptographically secure random number generator. In fact, for many quick hacks I just use C's drand48().
Any comments on other random number generators I should look at.
Cheers,
Ross-c
.
- References:
- An home-made Random Generator
- From: \"Luis A. Afonso\"
- Re: An home-made Random Generator
- From: Anon
- Re: An home-made Random Generator
- From: clemenr
- An home-made Random Generator
- Prev by Date: Re: Orthogonal Distance Regressions in R (or anywhere else)
- Next by Date: Re: help with simple probabilities
- Previous by thread: Re: An home-made Random Generator
- Next by thread: Re: An home-made Random Generator
- Index(es):
Relevant Pages
|