EVP_RAND-SEED-SRC(7SSL)
π EVP_RAND-SEED-SRC β the randomness seed source EVP_RAND implementation β¨
okay bestie, this is page EVP_RAND-SEED-SRC(7SSL) from OpenSSL, and it's genuinely such a serve. it's the manual for the seed source β the little guy whose whole job is to get the good good randomness into your DRBG. let's get into it π
πΈ NAME πΈ
EVP_RAND-SEED-SRC β the randomness seed source EVP_RAND implementation π
π¦ DESCRIPTION π¦
so. this is the vibe: it's all the support for deterministic random number generator seeding through the EVP_RAND API. yes, "deterministic" and "random" in the same sentence, that's just how cryptography is, don't think about it too hard π
here's the tea about where the seeds come from: the seed sources that get 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. iconic behaviour, no notes. π
β¨ Identity β¨
"SEED-SRC" is the name for this implementation. that's her government name. you can use it with the EVP_RAND_fetch() function. iykyk π
π Supported parameters π
here's what she supports, bestie:
"state"(OSSL_RAND_PARAM_STATE) <integer>"strength"(OSSL_RAND_PARAM_STRENGTH) <unsigned integer>"max_request"(OSSL_RAND_PARAM_MAX_REQUEST) <unsigned integer>
and these three? they work exactly as described in "PARAMETERS" in EVP_RAND(3). go read that one next, i'm literally begging π«Ά
π NOTES π
wanne get a context for the seed source? you can do it by calling:
EVP_RAND *rand = EVP_RAND_fetch(NULL, "SEED-SRC", NULL);
EVP_RAND_CTX *rctx = EVP_RAND_CTX_new(rand, NULL);
that's it. that's the whole note. slay π
π EXAMPLES π
here's the full example, and yes it's giving exactly what it should give:
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);
look at her. fetch a seed source, instantiate it, feed it into a CTR-DRBG, configure the DRBG with the cipher param, instantiate, generate, and clean up both contexts. periodt. π₯
π 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>.
β οΈ real talk for one sec bestie: that license bit isn't decorative. if you're using this file, you're abiding by Apache License 2.0, fr fr. π
and that's the page!! mwah π this was OpenSSL 4.0.3, dated 2026-09-29 β thanks for scrolling all the way down, you're the main character of this manpage reading session ππ§β¨
π¦ where this page comes from
- ubuntu stonking: openssl 4.0.3-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms