Live data from Hacker News

Reversing an integer hash function

taxicat1.github.io

1–10 of 19 posts

Re: Reversing an integer hash function

#6
Is there a category of hash functions that hash a 64/32 bit input to exactly 64/32 bits output, such that all inputs are uniquely preserved? This could be an interesting property for a hash table of integers, because a hash match implies a key match.

Re: Reversing an integer hash function

#7
post #6

Is there a category of hash functions that hash a 64/32 bit input to exactly 64/32 bits output, such that all inputs are uniquely preserved? This could be an interesting property for a hash table of integers, because a hash match implies a key match.

I think the word you are looking for is "permutation".

However, if you can use a permutation as a hash function, you might be fine with just using the identity function.

Re: Reversing an integer hash function

#8
post #6

Is there a category of hash functions that hash a 64/32 bit input to exactly 64/32 bits output, such that all inputs are uniquely preserved? This could be an interesting property for a hash table of integers, because a hash match implies a key match.

This would be a “bijective function” or a “perfect hash function”, although the latter is usually used when the input is much smaller than the output.

Re: Reversing an integer hash function

#9
post #2

I'm collecting such inverters at https://github.com/rurban/smhasher/tree/inverse/inverse But only 3 so far.

For the cryptopals challenge, you have to invert the Mersenne Twister scramble function:

https://cryptopals.com/sets/3/challenges/23

https://github.com/elsamuko/cryptopals/blob/610ab19bf6823a34...

Post reply on HN