info > Crypt::OpenSSL::Random

📖 NAME

Crypt::OpenSSL::Random - OpenSSL/LibreSSL pseudo-random number generator access

🚀 Quick Reference

Use CaseCommandDescription
Seed PRNG with random dataCrypt::OpenSSL::Random::random_seed($data)🌱 Seeds the PRNG with a string of bytes; returns true if sufficient seeding.
Seed PRNG from EGD daemonCrypt::OpenSSL::Random::random_egd("/path")🔌 Seeds from entropy gathering daemon; returns bytes read or -1. (Not on LibreSSL)
Check PRNG seeding statusCrypt::OpenSSL::Random::random_status()✅ Returns true if PRNG has sufficient seeding.
Get cryptographically strong random bytesCrypt::OpenSSL::Random::random_bytes(10)🔒 Returns 10 strong random bytes, or false if insufficient seed.
Get pseudo-random bytes (non-cryptographic)Crypt::OpenSSL::Random::random_pseudo_bytes(10)🔓 Returns 10 pseudo-random bytes (not necessarily unpredictable).

📋 SYNOPSIS

use Crypt::OpenSSL::Random;

Crypt::OpenSSL::Random::random_seed($good_random_data);
Crypt::OpenSSL::Random::random_egd("/tmp/entropy");
Crypt::OpenSSL::Random::random_status() or
  die "Unable to sufficiently seed the random number generator".

my $ten_good_random_bytes = Crypt::OpenSSL::Random::random_bytes(10);
my $ten_ok_random_bytes = Crypt::OpenSSL::Random::random_pseudo_bytes(10);

🔍 DESCRIPTION

Crypt::OpenSSL::Random provides the ability to seed and query the OpenSSL and LibreSSL library's pseudo-random number generators.

Note: On LibreSSL random_egd() is not defined.

📦 EXPORT

None by default.

🔧 Static Methods

🐛 BUGS

Because of the internal workings of OpenSSL's random library, the pseudo-random number generator (PRNG) accessed by Crypt::OpenSSL::Random will be different than the one accessed by any other perl module. Hence, to use a module such as Crypt::OpenSSL::Random, you will need to seed the PRNG used there from one used here. This class is still advantageous, however, as it centralizes other methods, such as random_egd, in one place.

✍️ AUTHOR

Ian Robertson, iroberts@cpan.com

Now maintained by Reini Urban, rurban@cpan.org

📄 LICENSE

This module is available under the same licences as perl, the Artistic license and the GPL.

📚 SEE ALSO

perl(1), rand(3), RAND_add(3), RAND_egd(3), RAND_bytes(3).

perl v5.34.0 2022-02-06 Random(3pm)

Crypt::OpenSSL::Random
📖 NAME 🚀 Quick Reference 📋 SYNOPSIS 🔍 DESCRIPTION
📦 EXPORT 🔧 Static Methods
🐛 BUGS ✍️ AUTHOR 📄 LICENSE 📚 SEE ALSO

Generated by phpman v4.9.26-1-g511901d Author: Che Dong Under GNU General Public License
2026-08-09 09:03 @2600:1f28:365:80b0:50b3:453e:ff52:20f7
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format