[Cryptography] Generate Random Data From Sound Card

Byrl Raze Buckbriar sub0 at octade.net
Sat Mar 7 06:38:55 EST 2026


On Wed, 4 Mar 2026 14:37:15 -0800
Jon Callas <jon at callas.org> wrote:

> > On Mar 3, 2026, at 15:54, Byrl Raze Buckbriar via cryptography <cryptography at metzdowd.com> wrote:
> > 
> > Try one command to convert the sound card into a TRNG.
> > 
> > It should work with the audio muted.  
> 
> That's really cool! Same principle as the camera with a lens cap on. Ambient hiss is another source for free. Thanks for pointing that out, it's another arrow in the quiver of combating  the Quantum Credulity Effect, that the very word "quantum" sucks people's brains out and leaves them incapable of thought.

I don't know how well this works across a variety of sound cards, hence the desire for a reliable, bashy way to list and test cards and sub-devices. On the cards I have tested it works great. I get roughly 85 KiB per second after sanitizing the null and high bytes. I don't know if there is much difference between sampling mono and stereo and I haven't tried to figure that out yet. In my tests the first few KB is low-quality and some blocks of zero, but after that it is usable data all the way through the stream even when extracting hundreds of megabytes.

I've played with computer cameras for this purpose. It seems like a piece of tape over the camera lens works well. If there are bright lights in the room it also works to tape a thin piece of tissue paper or thermal receipt paper over the lens then the light filters through chaotically and causes repeated randomized dithering and focus effects. Ffmpeg works for me:

```ffmpeg -f oss -f video4linux2 -s 640x480 -i /dev/video0 out.avi```

I can't say how much real random is there, although it seems to have some.

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



More information about the cryptography mailing list