CryptRandom is a module for generating cryptographically useful random bytes under RISC OS. It can use a number of sources to provide this information to clients needing secure, or high quality random data.
Computers are, by their nature, deterministic - so applying the same sequence of inputs to any program is likely to produce the same result. This is a bad thing when it comes to cryptography, as if you use a known sequence to encrypt a data stream, next time you turn on your machine you'll use the same known sequence, making the code possible to break. Thus we need a random sequence so that no pattern can be spotted in it. Basic provides a pseudo-random sequence, but this is the same every time the machine is turned on, so is not very good. It is also just a sequence, which will eventually repeat. True randomness is only possible on a computer by attaching it to other devices such as a radioactive source - not very practical.
CryptRandom applies another method, which will produce different values showing to no known pattern, which are different each time you switch the machine on. This is much less secure than using a true random source, but better than using a predictable random number generator like that Basic uses.
The CryptRandom module provides SWI calls which allow access to random data retrieved from a variety of sources.
The version of CryptRandom supplied with RISC OS Pyromaniac has been limited in its behaviour. It can be configured to use different implementations, but the two implementations supplied are simplistic. The configurations may be configured with the 'cryptrandom.implementation' configuration option. The implementation can be given a seed with the 'cryptrandom.seed' configuration option.
It should not therefore be relied on for cryptographicly reliable random numbers. RISC OS Pyromaniac is intended for debug and diagnostics, so this should be sufficient.
Original module copyright 2000-1 Theo Markettos.
Portions copyright Simon Tatham, Gary S. Brown and Eric Young