Commit 4c150e0b authored by Raymond Hettinger's avatar Raymond Hettinger

Improve the default seeding in random module to use 32 bytes of entropy when available.

parent e50fe4c9
......@@ -108,7 +108,7 @@ class Random(_random.Random):
if a is None:
try:
a = long(_hexlify(_urandom(16)), 16)
a = long(_hexlify(_urandom(32)), 16)
except NotImplementedError:
import time
a = long(time.time() * 256) # use fractional seconds
......
......@@ -44,6 +44,10 @@ Library
as documented. The pattern and source keyword parameters are left as
deprecated aliases.
- Improve the random module's default seeding to use 256 bits of entropy
from os.urandom(). This was already done for Python 3, mildly improving
security with a bigger seed space.
- Issue #15618: Make turtle.py compatible with 'from __future__ import
unicode_literals'. Initial patch by Juancarlo Añez.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment