<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
In a word - No.<br>
<br>
There is zero reason for people doing crypto to use the random
module, therefor we should not change the random module to be
cryptographically secure.<br>
<br>
Don't break things and slow my code down by default for dubious
reasons, please.<br>
<br>
<div class="moz-cite-prefix">On 9/9/2015 12:35, Guido van Rossum
wrote:<br>
</div>
<blockquote
cite="mid:CAP7+vJ+B=umEubBs9YQ4LVPcsLk0bjXFS=K7AtBrEeHNL0Ww2w@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>I've received several long emails from Theo de Raadt
(OpenBSD founder) about Python's default random number
generator. This is the random module, and it defaults to a
Mersenne Twister (MT) seeded by 2500 bytes of entropy taken
from os.urandom().<br>
<br>
Theo's worry is that while the starting seed is fine, MT is
not good when random numbers are used for crypto and other
security purposes. I've countered that it's not meant for
that (you should use random.SystemRandom() or os.urandom()
for that) but he counters that people don't necessarily know
that and are using the default random.random() setup for
security purposes without realizing how wrong that is.<br>
<br>
There is already a warning in the docs for the random module
that it's not suitable for security, but -- as the meme goes
-- nobody reads the docs.<br>
<br>
</div>
Theo then went into technicalities that went straight over my
head, concluding with a strongly worded recommendation of the
OpenBSD version of arc4random() (which IIUC is based on
something called "chacha", not on "RC4" despite that being in
the name). He says it is very fast (but I don't know what that
means).<br>
<br>
</div>
I've invited Theo to join this list but he's too busy. The two
core Python experts on the random module have given me opinions
suggesting that there's not much wrong with MT, so here I am.
Who is right? What should we do? Is there anything we need to
do?<br clear="all">
<div>
<div>
<div><br>
-- <br>
<div class="gmail_signature">--Guido van Rossum (<a
moz-do-not-send="true"
href="http://python.org/%7Eguido" target="_blank">python.org/~guido</a>)</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Python-ideas mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python-ideas@python.org">Python-ideas@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/python-ideas">https://mail.python.org/mailman/listinfo/python-ideas</a>
Code of Conduct: <a class="moz-txt-link-freetext" href="http://python.org/psf/codeofconduct/">http://python.org/psf/codeofconduct/</a></pre>
</blockquote>
<br>
</body>
</html>