Crypt::Random::Source::Weak::openssl - Get random bytes from the OpenSSL command line utility
use Crypt::Random::Source::Strong::openssl; my $source = Crypt::Random::Source::Weak::openssl->new my $bytes = $source->get(1024); # get 1kb of random bytes
This is a weak random byte source because openssl rand is a PRNG.
openssl rand
This is a subclass of Crypt::Random::Source::Base::Proc.
Due to the retarded nature of the rand command line utility's interface, it must repeatedly be invoked with default_chunk_size as number of random bytes to generate.
default_chunk_size
The default number of bytes to generate per openssl rand invocation.
Defaults to 64 kb, which is pretty large and balances well with the startup time of openssl rand for miniscule chunks.
If you will be needing a lot of random data, increasing this number to something much larger would probably be beneficial.
The openssl executable to invoke. Defaults to what File::Which found for openssl (which means it must be in your PATH).
openssl
PATH
Crypt::Random::Source
openssl(1), rand(1)
This module is maintained using Darcs. You can get the latest version from http://nothingmuch.woobling.org/code, and use darcs send to commit changes.
darcs send
Yuval Kogman <nothingmuch@woobling.org>
Copyright (c) 2008 Yuval Kogman. All rights reserved This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Crypt::Random::Source::Weak::openssl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crypt::Random::Source::Weak::openssl
CPAN shell
perl -MCPAN -e shell install Crypt::Random::Source::Weak::openssl
For more information on module installation, please visit the detailed CPAN module installation guide.