For fun I have been experimenting with methods of encryption. One of the methods I am using requires a seed value. I would like to feed it with true random numbers. I know a standard method of acquiring a seed in for example C++ is to call time(NULL), however since this is only pseudo-random I was wondering if there are any reliable ways of gathering truly random numbers. The only constraint is that it must be possible to implement in C, C++, and Java.
Thank you in advance.
Clarification: While I run Ubuntu, this code must run a Windows system.
There are lots of them, but you’ve got your terminology confused, because any source of entropy bits will be a random number generator. You’re actually thinking about “pseudorandom numbers”.
Now, that said, there are a number of different schemes for entropy sources. A lot of UNIX-like systems have a /dev/random which creates random numbers by doing various magic on physical processes like cache sizes and memory contents. There are stronger sources that use, for example, inter-event times with radioactive decay.
Fourmilab.ch provides real random numbers here.
CCDs kept in the dark work well.
Lava lamps are nice.