![]() |
![]()
| ![]() |
![]()
NAMECrypt::Random - Cryptographically Secure, True Random Number Generator. SYNOPSISuse Crypt::Random qw( makerandom ); my $r = makerandom ( Size => 512, Strength => 1 ); DESCRIPTIONCrypt::Random is an interface module to the /dev/random and /dev/urandom device found on most modern unix systems. It also interfaces with egd, a user space entropy gathering daemon, available for systems where /dev/random (or similar) devices are not available. When Math::Pari is installed, Crypt::Random can generate random integers of arbitrary size of a given bitsize or in a specified interval. ALTERNATIVESCrypt::Random has numerous options for obtaining randomness. If you would prefer a simpler module that provides cryptographic grade randomness Crypt::URandom should be considered. The CPANSec group has developed the CPAN Author's Guide to Random Data for Security <https://security.metacpan.org/docs/guides/random-data-for-security.html> that should be reviewed before dealing with randomness. BLOCKING BEHAVIOURSince kernel version 5.6 in 2020, /dev/random is no longer blocking and there is effectively no difference between /dev/random and /dev/urandom. Indeed there has been no difference in the quality of randomness from either in many years. /dev/random now only blocks on startup of the system and only for a very short time. HARDWARE RNGIf there's a hardware random number generator available, for instance the Intel i8x0 random number generator, you can use it instead of /dev/random or /dev/urandom. Usually your OS will provide access to the RNG as a device, eg (/dev/intel_rng). METHODS
DEPENDENCIESCrypt::Random needs Math::Pari 2.001802 or higher. SEE ALSOCrypt::URandom should be considered as simpler module for obtaining cryptographically secure source of Randomness. The CPANSec group has developed the CPAN Author's Guide to Random Data for Security <https://security.metacpan.org/docs/guides/random-data-for-security.html> that should be reviewed before dealing with randomness. BIBLIOGRAPHY
LICENSEThis is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. AUTHORVipul Ved Prakash, <mail@vipul.net>
|