EVP_RAND-SEED-SRC(7ossl)
π EVP_RAND-SEED-SRC π
Okay bestie, welcome to the EVP_RAND-SEED-SRC(7ossl) page β this is the manual for the randomness seed source EVP_RAND implementation, and honestly it's giving "quiet backstage icon that makes the whole show work" energy. π
β¨ NAME β¨
EVP_RAND-SEED-SRC β the randomness seed source EVP_RAND implementation. That's the whole name, no cap. π«Ά
π DESCRIPTION π
So what we've got here is support for deterministic random number generator seeding through the EVP_RAND API. Literally the setup crew for your randomness, and they ate. π₯
The seed sources 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. Periodt. π¦
πΈ Identity πΈ
"SEED-SRC" is the name for this implementation β that's its whole government name, and it can be used with the EVP_RAND_fetch() function. Slay. π
π Supported parameters π
The supported parameters are:
"state"(OSSL_RAND_PARAM_STATE)<integer>β one of the supported params, bestie."strength"(OSSL_RAND_PARAM_STRENGTH)<unsigned integer>β also a supported param, yes ma'am."max_request"(OSSL_RAND_PARAM_MAX_REQUEST)<unsigned integer>β the third of the trio.
These parameters work as described in "PARAMETERS" in EVP_RAND(3). Iykyk β go read that one for the full tea. β
π 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);
That's it, that's the vibe. π
π₯ EXAMPLES π₯
Bestie, here's the whole example, character for character, because I would never do you like that and paraphrase code:
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 all those free calls β responsible queen behavior, we love to see it. π
π«Ά SEE ALSO π«Ά
EVP_RAND(3)"PARAMETERS"inEVP_RAND(3)
Go click those next, bestie, they're the sequel. β¨
π 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, don't skip the license β it's not a suggestion, it's a requirement. π
And that's the whole page, bestie. This masterpiece is version 3.5.9, dated 2026-09-29, and it's giving timeless. Now go seed something iconic. π§π
π¦ where this page comes from
- alpine 3.23: openssl-doc 3.5.9-r0 Β· Apache-2.0
- alpine 3.24: openssl-doc 3.5.9-r0 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms