[Cryptography] Generate Random Data From Sound Card

Patrick Chkoreff pc at fexl.com
Fri Mar 6 11:16:59 EST 2026


On 3/5/26 6:25 PM, Jon Callas wrote:

> I also think that hashing a picture of just about anything is good enough, because the requirements for cryptography are so low (512-1024 bits of unguessable stuff in the many megapixels).

I could photograph the dead leaves on a patch of ground in the woods, or 
the gravel on my driveway, hash the image file with SHA-512, and get 512 
usable bits.  As you suggested, it should even work with a compressed 
format like JPG.

The slightest change in the subject matter will cascade through all 512 
bits unpredictably in a way that could never be reproduced.  The problem 
is that your camera may be a vulnerable device and the photos could 
leak.  Then you can only hope that the enemy doesn't bother to guess 
your exact method.

I do have a set of 16-sided dice, but I haven't used them for serious 
purposes.  If I really needed to generate 1024 bits, I would be lazy and 
use this (with the hexdump only for readability):

head -c 128 /dev/urandom | hexdump

In other words, I would just rely entirely on Theodore Tso's code.  Go Ted.


-- Patrick




More information about the cryptography mailing list