This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients PaulMcMillan, Vlado.Boza, dmalcolm, koniiiik, vstinner
Date 2012-04-19.23:26:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334877992.71.0.363744127306.issue14621@psf.upfronthosting.co.za>
In-reply-to
Content
I don't understand this issue: can you write a short script to test a collision? 

"E.g this strings collide for every prefix ending on 0xcd"

Do you mean that prefix & 0xff == 0xcd?

"0x27fd5a18, 0x26fe78fa"

Is it a byte string or an Unicode string? b'\x27\xfd\x5a\x18' and b'\x26\xfe\x78\xfa'?

--

Using PYTHONHASHSEED environment variable, it's easy to find two values generating the same _Py_HashSecret. Just one example:

PYTHONHASHSEED=3035016679:
* _Py_HashSecret = {0xcd5192eff3fd4d58, 0x3926b1431b200720}
PYTHONHASHSEED=4108758503:
*  _Py_HashSecret = {0xcd5192eff3fd4d58, 0x3926b1431b200720}

--

I wrote find_hash_collision.py to try to compute a collision, but the programs fail with:
---
Fail to generate a new seed!
# seeds = 65298
---
So it fails to generate a new random seed after testing 65298 different seeds. I ran the script with a function generating a seed, a seed generate a prefix "ending with 0xDC".

See attached program: it generates a random seed. Uncomment "seed = generate_seed_0xCD()" if the prefix must ends with 0xCD byte.
History
Date User Action Args
2012-04-19 23:26:32vstinnersetrecipients: + vstinner, dmalcolm, PaulMcMillan, Vlado.Boza, koniiiik
2012-04-19 23:26:32vstinnersetmessageid: <1334877992.71.0.363744127306.issue14621@psf.upfronthosting.co.za>
2012-04-19 23:26:32vstinnerlinkissue14621 messages
2012-04-19 23:26:31vstinnercreate