<div dir="ltr"><br><div class="gmail_extra"><div style="font-family:'Helvetica Neue';font-size:14px">Wow, there’s so much useful feedback here. Thank you, everyone!</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">I’d like to respond with the following: 1) Some background on the project. 2) A reiteration of what I’ve gleaned from the conversation. 3) Next steps.</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">1) Background:</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">I’m building an Arduino shield mainly for educational purposes. I’m trying to keep it as simple as possible so that its internal workings can be easily understood. While I’m not creating something for serious cryptographic use, the project is less compelling if it cannot create cryptographic-quality output.</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">2) What I’ve learned:</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">2a) My algorithm isn’t doing what I think it’s doing.</div><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><div style="font-family:'Helvetica Neue';font-size:14px">I algebraically expanded the steps of the algorithm and saw that a lot of the XOR operations were canceling each other out, confirming in my own mind what a lot of others caught on to quickly here. </div><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">Bill showed that the algorithm can be reversed by guessing bytes that are hidden, which can be used to decrypt the whole stream.</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">2b) One solution is to encrypt or hash the output</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">This will result in a decrease in throughput and add complexity to the project. Options include AES-CBC-MAC, Cha-cha, Blake, etc.</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">2c) Another option is to seed a CSPRNG, generate a pseudo random stream, and if I like, mix it with the raw stream from the diode. This would keep the throughput up, but add complexity.</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">2d) Avalanche noise from transistors is subject to failure.</div><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><div style="font-family:'Helvetica Neue';font-size:14px">Correct me if I’m wrong, but it looks like without a health check, both approaches (2b and 2c) will produce random output even if the transistor fails and outputs all 0s. One thing I liked about my (flawed) algorithm is that it would pass statistical tests if the noise source was healthy, and produce poor, detectable results if the noise source failed.</div><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">With the above architectures, it seems some kind of internal health check would be needed. Running the stream through a Von Neumann filter might achieve this. Would a simple monobit test be a good (read: cheap) litmus test for the noise source’s health, or is something more sophisticated needed? Bill mentioned doing health checks on a host machine. Would this involve switching modes on the device? That is, stream unwhitened noise periodically to the host to check for health, and then switch back to encrypted output?</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">2e)</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">I’ve <a href="http://i.imgur.com/1HdwjYr.png" target="_blank">diagrammed two approaches</a> here to help me understand.</div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">3) Next Steps</div><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><div style="font-family:'Helvetica Neue';font-size:14px">Rhys Weatherly has implemented a lot of these<a href="http://rweather.github.io/arduinolibs/crypto.html" target="_blank"> cryptographic algorithms for Arduino</a> and measured their performance. I’m going to try to implement one of the above architectures. Hopefully I can find something that the Arduino can handle that can be abstracted to such a degree that the code is easy to read. </div><div style="font-family:'Helvetica Neue';font-size:14px"><br></div><span style="font-family:'Helvetica Neue';font-size:14px"></span><div style="font-family:'Helvetica Neue';font-size:14px">Thanks again everyone!</div></div></div>