Re: Efficient pseudo-random number generation
From: Jerry Coffin (jcoffin_at_taeus.com)
Date: 04/25/04
- Next message: news.hku.hk: "Re: grouping different kinds of food"
- Previous message: Ioannis Vranos: "Re: "Ravenscar-like" profile for C/C++"
- Maybe in reply to: Ioannis Vranos: "Efficient pseudo-random number generation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Apr 2004 08:13:54 -0700
"Cy Edmunds" <cedmunds@spamless.rochester.rr.com> wrote in message news:<eZFic.93900$M3.41471@twister.nyroc.rr.com>...
[ ... ]
> rand() is OK for making a Yahtzee program, but for something as important as
> encryption I would not recommend it. The standard only requires it to
> deliver 16 bits and the requirements of its statistical performance are
> inadequately defined. Good portable generators of 31 bits or more are
> readily available -- e.g. www.boost.org
Though you don't state it directly, you more or less imply that a
31-bit generator IS suitable for encryption.
This is NOT generally the case. First of all, rand() is typically
implemented as a linear-congruential PRNG, which not suitable for
cryptographic purposes, regardless of size.
Second, if you do start with a suitable algorithm, a cryptographic
generator will generally need to store substantially more than 31 bits
of state -- somewhere in the vicinity of twice that would be a
reasonable starting point, and depending on exactly what you're doing,
the requirements might easily go up from there.
--
Later,
Jerry.
The universe is a figment of its own imagination.
- Next message: news.hku.hk: "Re: grouping different kinds of food"
- Previous message: Ioannis Vranos: "Re: "Ravenscar-like" profile for C/C++"
- Maybe in reply to: Ioannis Vranos: "Efficient pseudo-random number generation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|