Sortix
Sortix Download Manual Development Source Code News Blog More
current nightly
RAND(3) LibreSSL RAND(3)

NAME

RAND - pseudo-random number generator

SYNOPSIS


#include <openssl/rand.h>

int RAND_bytes(unsigned char *buf, int num);
int RAND_pseudo_bytes(unsigned char *buf, int num);

DESCRIPTION

These functions give access to the systems cryptographically secure pseudo-random number generator (PRNG). It is used by other library functions for example to generate random keys, and applications can use it when they need randomness.
RAND_bytes(3) describes how to obtain random data from the PRNG.

INTERNALS

The RAND_SSLeay() method implements a PRNG based on the systems' arc4random_buf(3) random number generator.

SEE ALSO

BN_rand(3), RAND_bytes(3)
2015-10-26 LibreSSL
Copyright 2011-2025 Jonas 'Sortie' Termansen and contributors.
Sortix's source code is free software under the ISC license.
#sortix on irc.sortix.org
@sortix_org