develooper Front page | perl.perl5.porters | Postings from October 2012

Re: Eliminating the "rehash" mechanism for 5.18

Thread Previous | Thread Next
Ed Avis
October 31, 2012 02:24
Re: Eliminating the "rehash" mechanism for 5.18
Message ID:
A 64-bit random seed has 2^64 possible values.  There are about 3*(2**64) ways
to shuffle 21 elements.  So as a rough estimate, if you can insert 21 elements
into a freshly created hash and observe the order of the hash keys, you should
be able to determine the random seed most of the time.  This would not be noticed
as a denial-of-service attack.

However, once you have your 21 elements in order, you still have to grind through
all possible random seeds to find which one gives that ordering.  That would take
about five million years on a typical desktop CPU.  Somebody clever might find
an analytic solution to determine the random seed from the hash ordering, but
such minds are probably all busy working for the NSA on more important problems.

Ed Avis <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About