5.4 pisces.egdlib - Interface to the Entropy Gathering Daemon

EGD (Entropy Gathering Daemon) is a tool designed to be used by GPG (GNU Privacy Guard) on systems that do not have a /dev/random. It is a user-space program that culls entropy from system statistics reported by various commands like w or vmstat. EGD is available from http://www.lothar.com/tech/crypto/.

This module implements an interface for request random data from EGD. For most purposes, it is better to use the interface provided by pisces.cryptrand which provides an abstraction layer on top of this and other modules.

EGD (path)
The EGD class provides a high-level interface for communicating with an EGD daemon. The constructor takes that path of the Unix-domain socket used by the daemon.

EGD defines the following methods:

getAvailableEntropy ()
Returns the number of bits of entropy currently available.

getRandomBytes (num)
Returns up to num bytes of random data. It will return less than num bytes if sufficient entropy is not available.

getRandomBytesSync (num)
Returns exactly num bytes of random data. WARNING: This method does not appear to behave correctly, perhaps because of a bug in EGD.

getPID ()
Returns the daemon's process id.