[Python-ideas] PEP 504: Using the system RNG by default

Guido van Rossum guido at python.org
Wed Sep 16 16:26:05 CEST 2015

There's still way too much chatter, and a lot that seems just rhetoric.
This is not the republican primaries.

Yes lots of companies got hacked. What's the evidence that a language's
default RNG was involved? IIUC the best practice for password encryption
(to make cracking using a large word list harder) is something called
bcrypt; maybe next year something else will become popular, but the default
RNG seems an unlikely candidate. I know that in the past the randomness of
certain protocols was compromised because the seeding used a timestamp that
an attacker could influence or guess. But random.py seeds MT from
os.urandom(2500). So what's the class of vulnerabilities where the default
RNG is implicated?

Tim's proposal is simple: create a new module, e.g. safefandom, with the
same API as random (less seed/state). That's it. Then it's a simple import
change away to do the right thing, and we have years to seed StackOverflow
with better information before that code even hits the road. (But a
backport to Python 2.7 could be on PyPI tomorrow!)

--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150916/c301cbd4/attachment-0001.html>

More information about the Python-ideas mailing list