Random Numbers in Perl

Nathan Saper natedog@well.com
Tue, 24 Oct 2000 22:51:25 -0700


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Oct 23, 2000 at 08:39:34AM -0700, Kevin Buettner wrote:
> On Oct 22, 11:53pm, Nathan Saper wrote:
> 
> > Here's one for you Perl gurus out there:
> > 
> > In a Perl app I'm trying to write, I want to be able to create random
> > hex integers $bits bits long, where $bits is a user-defined variable.
> > The randomness of the numbers needs to be as good as possible, because
> > it would be used in a crypto app.
> > 
> > Any ideas?
> 
> If you're on linux, query /dev/random and use however many bits you need.
> 
> This isn't exactly portable, but I doubt that you'll find a portable
> way to obtain cryptographically strong random numbers.
> 

I'm trying to implement something that is as OS-unspecific as
possible.

> Kevin
 
- --
Nathan Saper (natedog@well.com) | http://www.well.com/user/natedog/
GnuPG (ElGamal/DSA): 0x9AD0F382 | PGP 2.x (RSA): 0x386C4B91
Standard PGP & PGP/MIME OK      | AOL Instant Messenger: linuxfu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.5 and Gnu Privacy Guard <http://www.gnupg.org/>

iD8DBQE59nTY2FWyBZrQ84IRAkGOAJ42L4T+/sKxeY7WU9pDuIppfe/A7ACfaSFP
TYGqfLJL0+yLaoQwAw0RX1s=
=VajF
-----END PGP SIGNATURE-----