9 votes

Prospecting for Hash Functions

Tags: hashing

2 comments

  1. [2]
    s4b3r6
    Link
    The fact you can bruteforce a 32bit hash function (though not 64bit), is kind of astonishing to me. That's a lot of compute power in the tiny box I use to mostly do entertainment things. I really...

    The prospector picks some operations at random and fills in their constants randomly within their proper constraints.

    The fact you can bruteforce a 32bit hash function (though not 64bit), is kind of astonishing to me. That's a lot of compute power in the tiny box I use to mostly do entertainment things.

    If you’re paying close enough attention, you may have noticed that all three functions above have the same structure. The prospector had stumbled upon it all on its own without knowledge of the existing functions.

    I really want to know if this common pattern has a name. MurmurHash also uses it, and the author's terminology 'sloshing' leaves more than a bit to be desired.

    If it doesn't have a name... Incoming academic paper?

    1. Deimos
      (edited )
      Link Parent
      I was interested in that too and spent a bit of time seeing if I could track down how MurmurHash ended up using that technique, to see if the author ever named/explained it. I eventually ended up...

      I really want to know if this common pattern has a name. MurmurHash also uses it, and the author's terminology 'sloshing' leaves more than a bit to be desired.

      I was interested in that too and spent a bit of time seeing if I could track down how MurmurHash ended up using that technique, to see if the author ever named/explained it. I eventually ended up on this old site for MurmurHash, which includes (at the bottom):

      The name, if you're wondering, comes from the simplest sequence of operations which will thoroughly mix the bits of a value - "x *= m; x = rotate_left(x,r);" - multiply and rotate. Repeat that about 15 times using 'good' values of m and r, and x will end up pseudo-randomized. Unfortunately multiply+rotate has a few major weaknesses when used in a hash function, so I used multiply+shift+xor. I liked the name Murmur better than Musxmusx, so I kept it.

      So I guess you could call it "musx-ing"?

      Alternatively, I also came across some pseudorandom number generators that used similar techniques and were named based on the operations they used, like Xoroshiro128+ (for "xor, rotate, shift, rotate"). You could probably follow that example and call this "xoshimu".

      1 vote