Security Advisories (1)
CVE-2018-25107

In versions prior to 0.13, rand could be used as a result of calling get_weak, or get, if no random device was available. This implies that not explicitly asking for get_strong on a non POSIX operating system (e.g. Win32 without the Win32 backend) could have resulted in non cryptographically random data.

NAME

Crypt::Random::Source::Base - Abstract base class for Crypt::Random::Source classes.

SYNOPSIS

use Moose;
extends qw(Crypt::Random::Source::Base);

DESCRIPTION

This is an abstract base class.

In the future it will be a role.

METHODS

get $n, %args

Gets $n random bytes and returns them as a string.

This method may produce fatal errors if the source was unable to provide enough data.

read $buf, $n, [ $off ]

This method is cannibalized from IO::Scalar. It provides an IO::Handle work-alike.

Note that subclasses override this to operate on a real handle directly if available.

seed @stuff

On supporting sources this method will add @stuff, whatever it may be, to the random seed.

Some sources may not support this, so be careful.

available

This is a class method, such that when it returns true calling new without arguments on the class should provide a working source of random data.

This is use by Crypt::Random::Source::Factory.

rank

This is a class method, with some futz value for a ranking, to help known good sources be tried before known bad (slower, less available) sources.

get_data %Params

Provided for compatibility with Crypt::Random