<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 12, 2016 at 9:15 AM, Stephen Wood <span dir="ltr"><<a href="mailto:smwood4@gmail.com" target="_blank">smwood4@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><div>Thanks, Bill. This is a fun write-up.</div><span class=""><div><br></div><div>> <span style="font-size:12.8px">The most popular technique for generating true random data is to do what TrueRandom does, and drive a voltage onto pin 0, and measure it with the 8-bit ADC.  While sometimes this generates unpredictable data, the scatter plots show scary correlations, and the one thing we know it is not measuring is thermal noise.</span></div><div><span style="font-size:12.8px"><br></span></div></span><div><span style="font-size:12.8px">Is there any way you could mitigate this by diversifying board pins, for example read from pin 0 and 5 and XOR the data together?</span></div></div></div></div></blockquote><div><br></div><div>I think that would be similar to doing more reads from pin 0.  It might be possible with 2 or 3 passive external components to make this work with thermal noise.  The trick would be to have the DC voltage on pin 0 right on a boundary between two counts of the 8-bit ADC.  A resistor and capacitor could generate this voltage with the PWM.  Another resistor from the cap to pin 0 should provide the isolation needed to get reasonable levels of thermal noise on pin 0.  Then, you'd need some feedback loop in the sketch where you change the PWM output a bit every time you read a 1 or a 0, and try to keep the average 1's and 0's the same.</div><div><br></div><div>This would still have issues when an attacker might control noise on the power rails, but running off a battery with clean code, it should work OK.  This design would be similar to Intel's DRNG.</div><div><br></div><div>Without any external components, I think the thermal drift of the timers is the only reliable source of entropy, but it is very low speed.</div><div><br></div><div>Bill</div></div></div></div>