<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 15, 2015, at 7:29 PM, Arnold Reinhold <<a href="mailto:agr@me.com" class="">agr@me.com</a>> wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class="">One can purchase a 5 megapixel HD camera module for the Raspberry Pi for $25.  An extensive Python support package is available, including the ability to read an image unencoded. <a href="http://picamera.readthedocs.org/en/release-1.9/" class="">http://picamera.readthedocs.org/en/release-1.9/</a>  Using a camera as a source for entropy was discussed at length in a thread here last year. A camera might be cheaper than a plug-in HRNG, doesn’t take up a USB port, and could be easier to audit.</div><div class=""><br class=""></div></div></div></blockquote></div><div class=""><br class=""></div>A bit more detail.  The picamera Python package provides a “bayer” mode which gives the raw bits from the camera pixels. (Bayer is the inventor of the RGGB color filter mosaic that overlays the camera chip in this and many other single chip color cameras.) According to the documentation:<div class=""><br class=""><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>• Bayer data occupies the last 6,404,096 bytes of the output file. The first 32,768 bytes of this is header data which starts with the string 'BRCM'.<br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>• Bayer data consists of 10-bit values, because this is the sensitivity of the OV5647 sensor used by the Pi’s camera. The 10-bit values are organized as four 8-bit values, followed by the low-order 2 bits of the four values packed into a fifth byte.</div></div><div class=""><br class=""></div><div class="">While unpacking all this data and processing it could be a pain for imaging, hence other modes like jpg, rgb and yuv are available, for RNG purposes bayer is ideal. The whole mishmash or chunks of it can be fed directly to a whitener such as a cryptographic hash. If speed is a concern, it might even make sense to just hash every fifth byte containing the low order bits, though careful experimentation, e.g. to look for correlation between nearby low order bits, is in order first. </div><div class=""><br class=""></div><div class="">Arnold Reinhold</div></body></html>