rawrand module
This module is to collect high entropy data for random key generation.
This needs to be as unpredictable and unreproducable as possible. The original
PGP method was to collect key stroke timings. However this only returns
rather small quantities of entropy. Sampling mouse position, for example,
is a more prolific source.
The header file defining this module is rawrand.h. Note
that the CTC dummy includes a dummy implementation of this module in rawrand.c.
However this is only a dummy for early test purposes. It must never
be used for real cryptography.
Functions
-
void getRawRandom(unsigned char * data,
int length);
-
get length bytes of data.
-
boolean ensureRawRandom(int bytes);
-
Returns true if (and when) the number of bytes requested is available.
Returns false if the user is not prepared to wait, or the data is otherwise
not forthcoming.
-
void getSessionData(unsigned char
* data, int * length);
-
This routine should return as much session specific variable data as possible.
Values like the time the machine booted, the time the program started and
the process Id. and any similar available information. This data is used
to seed the random number generator so that even if the GetRawRandom is
not highly random the program has a good PRNG.
webmaster@bifroest.demon.co.uk