<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 28, 2016 at 5:06 AM, Salz, Rich <span dir="ltr"><<a href="mailto:rsalz@akamai.com" target="_blank">rsalz@akamai.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div class="gmail-m_-2092942809600465375WordSection1">
<p class="MsoNormal">Ian: Use /dev/urandom<u></u><u></u></p>
<p class="MsoNormal">Bill: Use /dev/random<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">So I have a new basic theory about randomness: ask N crypto folks and get at least N+1 opinions.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I look forward to the day when the community can come to consensus.  Until then, OpenSSL will proceed as best as it can and get slammed for it at some point. 
<span class="gmail-HOEnZb"><font color="#888888"><u></u><u></u></font></span></p><span class="gmail-HOEnZb"><font color="#888888">
<p class="MsoNormal"><u></u><span style="color:rgb(34,34,34)"></span></p></font></span></div></div></blockquote><div><br></div><div>I hate to suggest using /dev/random because it blocks when it does not need to, and is susceptible to simple denial-of-service attacks (cat /dev/random > /dev/null).  On the other hand, /dev/urandom does not block when it should.  Here is a quote from the urandom man page on my 14.04 Ubuntu machine:</div><div><br></div><div>"A read from the /dev/urandom device will not block waiting for more entropy.  As a result,  if  there is  not sufficient entropy in the entropy pool, the returned values are theoretically vulnerable to a cryptographic attack on the algorithms used by the driver."</div><div><br></div><div>So, my simple answer is, "Don't change OpenSSL".  If the OpenSSL folks are willing to do a bit more Linux-specific work, then I would instead suggest:</div><div><br></div><div>Read N bits (like 1024) bits from /dev/random when OpenSSL first needs random data, and throw them away.  Thereafter, read only from /dev/urandom.</div><div><br></div><div>Regardless, bugs like the one in rngd that cause RdRand to provide 100% of the entropy is currently causing /dev/random on many Linux systems to initially return random numbers that depend on only one unauditable source.  That's not OpenSSL's fault, but it needs to be addressed, IMO.  I believe that no unauditable random source should be incrementing the internal entropy estimate of /dev/random.  Those that do should be carefully audited, and preferably their health should be monitored over time.</div><div><br></div><div>Bill<br></div></div></div></div>