First off, why would you want random
numers in the first place? Well, they are very crucial to cryptography
, the most basic example being the one time pad
, where random bits are created to the length of the file to be encrypted
. The random bits are used to XOR
to the original file to scramble it, and then you have two separate files of equal length, the encrypted file
, and the key
. If the numbers you have are completely random, then the one time pad is completely secure, and not even the NSA
will be able to crack
it. Attacks against one time pads are dependant on finding the pattern to the numbers used to encrypt it in the first place. One time pads with repeating keys (that is a key is used that is smaller than the file length, so it must repeated to encrypt the whole file) are not really one time pads and are not secure
So now you are saying to yourself, I need random numbers bad! But how can I get truly random numbers, seeing as pseudo
random number generators are not really random, and thus are insecure.
Redirect input from /dev/audio into a file, and blow into your microphone at the same time. I believe this will give very random numbers.
Use a VCR to record video fuzz. Do this by recording when no cable or antenna is hooked into the VCR. Get an RCA to 1/4" jack converter. Play the video fuzz into your sound card, and redirect it into a file.
Write a byte skipping program. Write a program the uses a pseudo random number generator and feed it a number of your choice. Use that number to seek a DWORD on your hard drive. Use that DWORD to seed it again, and repeat, taking eighther the DWORDS and saving them, or the pseudo random numbers.
If you are doing a very small encryption, flip a coin, roll some dice, something like that.
That's all I can think of for now. But I am sure there are many more.
Gorgonzola says Another of the many Ways to get random numbers, I think. Get a Commodore 64 and read the output of its SID chip.