<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, 10 Sep 2015 at 01:26 M.-A. Lemburg <<a href="mailto:mal@egenix.com">mal@egenix.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Reading this thread is fun, but it doesn't seem to be getting<br>
anywhere - perhaps that's part of the fun ;-)<br>
<br>
Realistically, I see two options:<br>
<br>
 1. Someone goes and implements the OpenBSD random function in C<br>
    and put a package up on PyPI, updating it whenever OpenBSD<br>
    thinks that a new algorithm is needed or a security issue<br>
    has to be fixed (from my experience with other crypto software<br>
    like OpenSSL, this should be on the order of every 2-6 months ;-))<br>
<br>
 2. Ditto, but we put the module in the stdlib and then run around<br>
    issuing patch level security releases every 2-6 months.<br></blockquote><div><br></div><div>I see a third: rename random.random() to be be something that gets the point across it is not crypto secure and then stop at that. I don't think the stdlib should get into the game of trying to provide a RNG that we claim is cryptographically secure as that will change suddenly when a weakness is discovered (this is one of the key reasons we chose not to consider adding requests to the stdlib, for instance).</div><div><br></div><div>Theo's key issue is misuse of random.random(), not the lack of a crypto-appropriate RNG in the stdlib (that just happens to be his solution because he has an RNG that he is partially in charge of). So that means either we take a "consenting adults" approach and say we can't prevent people from using code without reading the docs or we try to rename the function. But then again that won't help with all of the other functions in the random module that implicitly use random.random() (if that even matters; not sure if the helper functions in the module have any crypto use that would lead to their misuse).</div><div><br></div><div>Oh, and there is always the nuclear 4th option and we just deprecate the random module. ;)</div><div><br></div><div>-Brett</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Replacing our deterministic default PRNG with a non-deterministic<br>
one doesn't really fly, since we'd break an important feature<br>
of random.random(). You may remember that we already ran a similar<br>
stunt with the string hash function, with very mixed results.<br>
<br>
Calling the result of such a switch-over "secure" is even<br>
worse, since it's a promise we cannot keep (probably not even<br>
fully define). Better leave the promise at "insecure" - that's<br>
something we can promise forever and don't have to define :-)<br>
<br>
Regardless of what we end up with, I think Python land can do<br>
better than name it "arc4random". We're great at bike shedding,<br>
so how about we start the fun with "randomYMMV" :-)<br>
<br>
Overall, I think having more options for good PRNGs is great.<br>
Whether this "arc4random" is any good remains to be seen, but<br>
given that OpenBSD developed it, chances are higher than<br>
usual.<br>
<br>
--<br>
Marc-Andre Lemburg<br>
eGenix.com<br>
<br>
Professional Python Services directly from the Source  (#1, Sep 10 2015)<br>
>>> Python Projects, Coaching and Consulting ...  <a href="http://www.egenix.com/" rel="noreferrer" target="_blank">http://www.egenix.com/</a><br>
>>> mxODBC Plone/Zope Database Adapter ...       <a href="http://zope.egenix.com/" rel="noreferrer" target="_blank">http://zope.egenix.com/</a><br>
>>> mxODBC, mxDateTime, mxTextTools ...        <a href="http://python.egenix.com/" rel="noreferrer" target="_blank">http://python.egenix.com/</a><br>
________________________________________________________________________<br>
2015-09-18: PyCon UK 2015 ...                               8 days to go<br>
<br>
::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::<br>
<br>
   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48<br>
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg<br>
           Registered at Amtsgericht Duesseldorf: HRB 46611<br>
               <a href="http://www.egenix.com/company/contact/" rel="noreferrer" target="_blank">http://www.egenix.com/company/contact/</a><br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></div></div>