RAND_EGD(3ossl)
π RAND_EGD π
okay so bestie, this is the OpenSSL manual page for RAND_egd, RAND_egd_bytes, and RAND_query_egd_bytes β the trio that goes and asks an Entropy Gathering Daemon for some randomness. yes, that's a real thing. no cap. π
β¨ NAME β¨
RAND_egd, RAND_egd_bytes, RAND_query_egd_bytes β literally just "go query the entropy gathering daemon bestie" π
πΈ SYNOPSIS πΈ
#include <openssl/rand.h>
int RAND_egd_bytes(const char *path, int num);
int RAND_egd(const char *path);
int RAND_query_egd_bytes(const char *path, unsigned char *buf, int num);
π¦ DESCRIPTION π¦
so picture this: it's an older platform, and it does not have a good source of randomness β think stuff like "/dev/urandom" being missing from the vibe check π. in that situation you can still query an Entropy Gathering Daemon (EGD) over a local socket to get randomness and seed the OpenSSL RNG. that's the whole plot. the protocol used is the one defined by the EGDs you can find at <http://egd.sourceforge.net/> or <http://prngd.sourceforge.net>.
RAND_egd_bytes()β requestsnumbytes of randomness from an EGD at the socketpathyou gave it, and then passes the data it receives intoRAND_add(). π«ΆRAND_egd()β literally equivalent toRAND_egd_bytes()but withnumset to255. that's it, that's the whole difference.RAND_query_egd_bytes()β requestsnumbytes of randomness from an EGD at the specified socketpath, and heads up:nummust be less than 256. ifbufisNULL, it's equivalent toRAND_egd_bytes(). ifbufis notNULL, then the data gets copied to the buffer andRAND_add()is not called. noted. π
also, lowkey important: OpenSSL can be configured at build time to try to use the EGD for seeding automatically. so it can just do it on its own, main character energy. β¨
π RETURN VALUES π
RAND_egd()andRAND_egd_bytes()return the number of bytes read from the daemon on success, or-1if the connection failed or the daemon did not return enough data to fully seed the PRNG. πRAND_query_egd_bytes()returns the number of bytes read from the daemon on success, or-1if the connection failed. π
π SEE ALSO π
π COPYRIGHT π
Copyright 2000-2018 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 go copying this around. it's giving "respect the paperwork." π§
and that's the page bestie, mwah π β this was the OpenSSL 3.5.6 version, dated 2026-04-07, filed under RAND_EGD(3ossl). slay. β
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms