NAME
Crypt::Random - Cryptographically Secure, True Random Number Generator.
VERSION
$Revision: 0.34 $
$Date: 2001/04/17 13:46:58 $
SYNOPSIS
use Crypt::Random qw( makerandom );
my $r = makerandom ( Size => 512, Strength => 1 );
DESCRIPTION
Crypt::Random is an interface module to the /dev/random device found on most modern Unix systems. The /dev/random driver gathers environmental noise from various non-deterministic sources including inter-keyboard timings and inter-interrupt timings that occur within the operating system environment.
The /dev/random driver maintains an estimate of true randomness in the pool and decreases it every time random strings are requested for use. When the estimate goes down to zero, the routine blocks and waits for the occurrence of non-deterministic events to refresh the pool.
The /dev/random kernel module also provides another interface, /dev/urandom, that does not wait for the entropy-pool to recharge and returns as many bytes as requested. /dev/urandom is considerably faster at generation compared to /dev/random, which should be used only when very high quality randomness is desired.
METHODS
- makerandom()
-
Generates a random number of requested bitsize in base 10. Following arguments can be specified.
- makerandom_itv()
-
Generates a random number in the specified interval. In addition to the arguments to makerandom() following attributes can be specified.
- Lower
-
Inclusive Lower limit.
- Upper
-
Exclusive Upper limit.
- makerandom_octet()
-
Generates a random octet string of specified length. In addition to Strength, Device and Verbosity, following arguments can be specified.
- Length
-
Length of the desired octet string.
- Skip
-
An octet string consisting of characters to be skipped while reading from the random device.
DEPENDENCIES
Crypt::Random needs Math::Pari 2.001802 or higher. As of this writing, the latest version of Math::Pari isn't available from CPAN. Fetch it from ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl/modules/
BIBLIOGRAPHY
- 1 random.c by Theodore Ts'o. Found in drivers/char directory of the Linux kernel sources.
- 2 Handbook of Applied Cryptography by Menezes, Paul C. van Oorschot and Scott Vanstone.
AUTHOR
Vipul Ved Prakash, <mail@vipul.net>