[Cryptography] Generate Random Data From Sound Card

Byrl Raze Buckbriar sub0 at octade.net
Sat Mar 7 06:42:47 EST 2026


On Fri, 6 Mar 2026 11:16:59 -0500
Patrick Chkoreff <pc at fexl.com> wrote:

> 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.

Shuffling the bytes of multiple pictures into one blob, or exoring the bytes across files can also improve the randomness of the input.
 
> 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.

Best to use a network-free camera and use a secure wipe method such as the 'shred' or 'wipe' applications.
 
> 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):

I have a jar with 500 miniature, multicolored dice. The dice bear nine colors. The colors are like the neon terminal colors. I bought the dice for about $8 on sale. What a steal.

I can haphazardly roll the whole jar of dice out onto a dark cloth and snap a photo. No need to key in the numbers. I keep them in a transparent jar so I can also shake the jar then take a picture of the dice in the jar. This is similar in principle to the lava lamp method but necessarily manual.

I suppose you could replicate this with a pile of multi-colored marbles, crafting beads, mahjongg tiles, different colors of sand, bingo chips, speckled beans, sawdust, legos, coins, a bucket of bolts, etc.

The idea is to snap some pictures from different angles then hash the files together and wipe them. Or record video and orbit the camera randomly around the mess for a few seconds and hash that video file.

After accumulating a few thousand bytes of starting entropy the user can whiten clock drift or RDTSC transforms to keep stretching it indefinitely without touching the onboard random devices.

Random is endless fun (pun not intended).

-- 
= OCTADE = alt.rhubarb = misc.misc = sci.crypt =
= https://soc.octade.net/octade =


More information about the cryptography mailing list