[Cryptography] TRNG review: Arduino based TRNGs

Bill Cox waywardgeek at gmail.com
Fri Jan 15 20:49:25 EST 2016


On Fri, Jan 15, 2016 at 5:23 PM, Ron Garret <ron at flownet.com> wrote:

> In fact, you can probably get pretty reasonable results with no circuitry
> at all and just letting the ADC pin float (I’ve tried this on a Teensy3 and
> it actually works quite well).
>

That's probably fine for seeding PRNGs for games.  It may have worked well
in that you saw no pattern, but 1) there could have been one you did not
see, and 2) any actual randomness from pin A0 might go away under different
conditions, such as running on a battery inside a metal box.

I was going to recommend what I'd do to figure out the thermal noise you
can count on, but this guy already did all of the work for me
<http://www.openmusiclabs.com/learning/digital/atmega-adc/>.

The R-C stages on the input to the ADC act as an anti-aliasing filter.  The
8K Ohm feeding the 10pF gives a 12MHz roll-off, which is not quite right,
since I'm not taking the 12K into 4pF stage into account.  From this site
<http://www.radio-electronics.com/info/rf-technology-design/noise/thermal-calculations.php>,
we can easily compute the expected thermal noise as 40uV.  This 10-bit A/D
has what, 2mV resolution on the input?  In a _very_ quite external
environment, where is the noise coming from that will reliably cause A0 to
wander all over the place?  I would be surprised if it were there.  The
data from the probably_random project seems to show that even with the
post-whitening, there isn't much randomness there.

My first guess is that you're measuring power supply noise.  Can you try
generating a bunch of floating A0 samples when running on a battery, with
good bypass caps, in a nice shielded environment like a metal box?

Bill

>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.metzdowd.com/pipermail/cryptography/attachments/20160115/9195f620/attachment.html>


More information about the cryptography mailing list