Security Advisories (1)
CVE-2026-41564 (2026-04-23)

CryptX versions before 0.088 for Perl do not reseed the Crypt::PK PRNG state after forking. The Crypt::PK::RSA, Crypt::PK::DSA, Crypt::PK::DH, Crypt::PK::ECC, Crypt::PK::Ed25519 and Crypt::PK::X25519 modules seed a per-object PRNG state in their constructors and reuse it without fork detection. A Crypt::PK::* object created before `fork()` shares byte-identical PRNG state with every child process, and any randomized operation they perform can produce identical output, including key generation. Two ECDSA or DSA signatures from different processes are enough to recover the signing private key through nonce-reuse key recovery. This affects preforking services such as the Starman web server, where a Crypt::PK::* object loaded at startup is inherited by every worker process.

NAME

Crypt::PRNG::Sober128 - Cryptographically secure PRNG based on Sober128 (stream cipher) algorithm

SYNOPSIS

### Functional interface:
use Crypt::PRNG::Sober128 qw(random_bytes random_bytes_hex random_bytes_b64 random_string random_string_from rand irand);

$octets = random_bytes(45);
$hex_string = random_bytes_hex(45);
$base64_string = random_bytes_b64(45);
$base64url_string = random_bytes_b64u(45);
$alphanumeric_string = random_string(30);
$string = random_string_from('ACGT', 64);
$floating_point_number_0_to_1 = rand;
$floating_point_number_0_to_88 = rand(88);
$unsigned_32bit_int = irand;

### OO interface:
use Crypt::PRNG::Sober128;

$prng = Crypt::PRNG::Sober128->new;
#or
$prng = Crypt::PRNG::Sober128->new("some data used for seeding PRNG");

$octets = $prng->bytes(45);
$hex_string = $prng->bytes_hex(45);
$base64_string = $prng->bytes_b64(45);
$base64url_string = $prng->bytes_b64u(45);
$alphanumeric_string = $prng->string(30);
$string = $prng->string_from('ACGT', 64);
$floating_point_number_0_to_1 = rand;
$floating_point_number_0_to_88 = rand(88);
$unsigned_32bit_int = irand;

DESCRIPTION

Provides an interface to the Sober128 based pseudo random number generator

All methods and functions are the same as for Crypt::PRNG.

FUNCTIONS

random_bytes

See "random_bytes" in Crypt::PRNG.

random_bytes_hex

See "random_bytes_hex" in Crypt::PRNG.

random_bytes_b64

See "random_bytes_b64" in Crypt::PRNG.

random_bytes_b64u

See "random_bytes_b64u" in Crypt::PRNG.

random_string

See "random_string" in Crypt::PRNG.

random_string_from

See "random_string_from" in Crypt::PRNG.

rand

See "rand" in Crypt::PRNG.

irand

See "irand" in Crypt::PRNG.

METHODS

new

See "new" in Crypt::PRNG.

bytes

See "bytes" in Crypt::PRNG.

bytes_hex

See "bytes_hex" in Crypt::PRNG.

bytes_b64

See "bytes_b64" in Crypt::PRNG.

bytes_b64u

See "bytes_b64u" in Crypt::PRNG.

string

See "string" in Crypt::PRNG.

string_from

See "string_from" in Crypt::PRNG.

double

See "double" in Crypt::PRNG.

int32

See "int32" in Crypt::PRNG.

SEE ALSO