Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # poor-man's quantum photon detector randomizer
- # ~1kb/s
- # over a test of a thousand time, global entropy was equal to 7.99/8 and passed nearly all Dieharder tests, as well as FIPS 140-2
- # however, sigma, mean and chi-square stats aren't too much enthusiastic
- # overall, the result is pretty impressive, but of course, don't use it in production :)
- DEVICE=/dev/video0
- # for external cameras should be /dev/video1
- FORMAT=image2pipe
- # fps-based image sequence from demuxer through pipe, format is automatically determined, as well as FPS and resolution
- # TODO force PNG format?
- TIMING=0.1
- # such timing is considered more or less practical for RNG based on my tests
- while true
- do
- ffmpeg -i $DEVICE -f $FORMAT -t $TIMING - 2> /dev/null | sha512sum | cut -d ' ' -f 1
- done
- # in the end when pressing Ctrl+C there will be repetitions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement