[New-bugs-announce] [issue21470] Better seeding for the random module

Raymond Hettinger report at bugs.python.org
Sat May 10 22:56:25 CEST 2014

New submission from Raymond Hettinger:

The default seeding for the random module currently used 32 bytes from urandom() to create the initial state of the random number generator.  This is far less than the number of possible states 2**19937-1.

Changing the default seed to a larger number will cover the state space.  This gives better security and better randomness by not using just a subset of the possible states.

The downside is slightly slower default initialization.

assignee: rhettinger
files: better_seed.diff
keywords: patch
messages: 218238
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Better seeding for the random module
type: security
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file35209/better_seed.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list