Generating Unique Keys

Tim Peters at
Tue Jan 28 00:39:39 CET 2003

[Paul Rubin]
> Yes.  Mersenne Twister tries to have good statistical properties so
> that your simulations won't be biased by accident.  But it makes no
> attempt at all to thwart malicious attacks.  Also, the implementations
> I've seen (I haven't looked at 2.3's) use just a 32-bit initial seed,
> so it's fairly quick for an attacker to search this whole 32-bit space.

You can pass a long (unbounded) int to 2.3's seed(), and all bits are used,
via the original authors' initialize-from-array-of-uint32 routine (the
absolute value of the Python long is broken into 32-bit chunks for this

More information about the Python-list mailing list