Christian Heimes added the comment:

I'm with Donald here. Python must not reduce security just for a special case. 
It doesn't mean that we should not address and fix this special case -- just 
treat it as special.

1) For your use case, the hash randomization key for the SipHash PRN doesn't 
need to be 4 or 8 bytes of CPRNG. Since you are not dealing with lots of 
untrusted input from a malicious remote source, any unpredictable or even 
predictable value will do.

2) Your use case might be special enough to use a special build of Python. Too 
bad https://www.python.org/dev/peps/pep-0432/ is not ready yet. 

3) #21470 causes 'import random' to read os.urandom(2500) in order to 
initialize the MT state of random.random. I really don't understand why MT 
needs 2500 bytes of distinct CPRNG data. The module should rather read less 
data and then stretch it into a larger init vector. We could use SipHash for 
the job. In fact why does the MT use a CPRNG at all? It's not designed as CPRNG 
source and could be initialized from other sources (id(self), time()...) 
instead.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26839>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to