EVP_RAND-SEED-SRC(7ossl)
π EVP_RAND-SEED-SRC β¨
okay so this is the 7ossl manual page for EVP_RAND-SEED-SRC, and bestie, if you've ever wondered where your random numbers come from before they get all dressed up as "cryptographically secure" β it's this. the seed source. the literal origin story. main character energy fr fr π±β¨
π NAME π
EVP_RAND-SEED-SRC β the randomness seed source EVP_RAND implementation. that's it, that's the whole vibe check π
πΈ DESCRIPTION πΈ
support for deterministic random number generator seeding through the EVP_RAND API. lowkey iconic: your DRBG gets deterministically seeded, which sounds contradictory but that's the whole point, iykyk.
the seed sources actually used are specified at the time OpenSSL is configured for building, using the --with-rand-seed= option. and by default? operating system randomness sources are used. no cap, the OS is doing the heavy lifting π«Ά
π¦ Identity π¦
"SEED-SRC" is the name for this implementation β that's its whole government name. it can be used with the EVP_RAND_fetch() function, so go fetch, bestie π
β Supported parameters β
the supported parameters are:
"state"(OSSL_RAND_PARAM_STATE)<integer>"strength"(OSSL_RAND_PARAM_STRENGTH)<unsigned integer>"max_request"(OSSL_RAND_PARAM_MAX_REQUEST)<unsigned integer>
these parameters work as described in "PARAMETERS" in EVP_RAND(3). that's the homework, go read it π
π§ NOTES π§
a context for the seed source can be obtained by calling:
EVP_RAND *rand = EVP_RAND_fetch(NULL, "SEED-SRC", NULL);
EVP_RAND_CTX *rctx = EVP_RAND_CTX_new(rand, NULL);
two lines. that's it. slay β¨
π₯ EXAMPLES π₯
here's the whole glow-up sequence, verbatim, do not touch:
EVP_RAND *rand;
EVP_RAND_CTX *seed, *rctx;
unsigned char bytes[100];
OSSL_PARAM params[2], *p = params;
unsigned int strength = 128;
/* Create and instantiate a seed source */
rand = EVP_RAND_fetch(NULL, "SEED-SRC", NULL);
seed = EVP_RAND_CTX_new(rand, NULL);
EVP_RAND_instantiate(seed, strength, 0, NULL, 0, NULL);
EVP_RAND_free(rand);
/* Feed this into a DRBG */
rand = EVP_RAND_fetch(NULL, "CTR-DRBG", NULL);
rctx = EVP_RAND_CTX_new(rand, seed);
EVP_RAND_free(rand);
/* Configure the DRBG */
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
SN_aes_256_ctr, 0);
*p = OSSL_PARAM_construct_end();
EVP_RAND_instantiate(rctx, strength, 0, NULL, 0, params);
EVP_RAND_generate(rctx, bytes, sizeof(bytes), strength, 0, NULL, 0);
EVP_RAND_CTX_free(rctx);
EVP_RAND_CTX_free(seed);
step one: make a seed source. step two: feed it into a DRBG. step three: configure the DRBG. step four: generate. step five: free everything because we are responsible queens and we do not leak ππ§Ό
π SEE ALSO π
EVP_RAND(3)"PARAMETERS"inEVP_RAND(3)
π COPYRIGHT π
copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. π«Ά
licensed under the Apache License 2.0 (the "License"). you may not use this file except in compliance with the License. you can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
fr fr read the license before you ship, bestie. it's giving "legally required and also genuinely good advice" π
and that's the page!! π this little love letter is from OpenSSL version 3.5.0, dated 2026-09-25, and it's the EVP_RAND-SEED-SRC(7ossl) manual page signing off. mwah πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms