1RAND_EGD(3ossl) OpenSSL RAND_EGD(3ossl)
2
3
4
6 RAND_egd, RAND_egd_bytes, RAND_query_egd_bytes - query entropy
7 gathering daemon
8
10 #include <openssl/rand.h>
11
12 int RAND_egd_bytes(const char *path, int num);
13 int RAND_egd(const char *path);
14
15 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int num);
16
18 On older platforms without a good source of randomness such as
19 "/dev/urandom", it is possible to query an Entropy Gathering Daemon
20 (EGD) over a local socket to obtain randomness and seed the OpenSSL
21 RNG. The protocol used is defined by the EGDs available at
22 <http://egd.sourceforge.net/> or <http://prngd.sourceforge.net>.
23
24 RAND_egd_bytes() requests num bytes of randomness from an EGD at the
25 specified socket path, and passes the data it receives into RAND_add().
26 RAND_egd() is equivalent to RAND_egd_bytes() with num set to 255.
27
28 RAND_query_egd_bytes() requests num bytes of randomness from an EGD at
29 the specified socket path, where num must be less than 256. If buf is
30 NULL, it is equivalent to RAND_egd_bytes(). If buf is not NULL, then
31 the data is copied to the buffer and RAND_add() is not called.
32
33 OpenSSL can be configured at build time to try to use the EGD for
34 seeding automatically.
35
37 RAND_egd() and RAND_egd_bytes() return the number of bytes read from
38 the daemon on success, or -1 if the connection failed or the daemon did
39 not return enough data to fully seed the PRNG.
40
41 RAND_query_egd_bytes() returns the number of bytes read from the daemon
42 on success, or -1 if the connection failed.
43
45 RAND_add(3), RAND_bytes(3), RAND(7)
46
48 Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
49
50 Licensed under the Apache License 2.0 (the "License"). You may not use
51 this file except in compliance with the License. You can obtain a copy
52 in the file LICENSE in the source distribution or at
53 <https://www.openssl.org/source/license.html>.
54
55
56
573.0.5 2022-07-05 RAND_EGD(3ossl)