3 ms·
Machine learning is good at statistical sampling, approximation, and categoriztion. Let's think about hash functions. Not inverting a hash, just applying one.
by evanb 4y ago
Machine learning is good at statistical sampling, approximation, and categoriztion.
Let's think about hash functions. Not inverting a hash, just applying one.
- A hash function has a bit-perfect map between input and output, "close" is not enough.
- A good hash function is designed to produce a completely different answer if even one input bit is changed. It's not a smooth function, in terms of the input space and the natural topology of the output space. Let me call that bit-sensitivity.
- I guess you could frame a hash as a categorization, but the number of categories would have to be the size of the output space, which is insanely big for any hash worth your time. You'd have to recognize 2^|bits in output|. Good luck!
So ML seems to be a very bad match for implementing the (forward) hash itself.
What about the inverse?
- The bit-perfection requirement is extremely onerous. Either the output of the inverse has the correct hash or it does not.
- At least the space of inputs which match a given hash IS a distribution (there are many inputs which yield the same hash, so there are many valid outputs given an input for the inverse hash). Unfortunately, because the purpose of the hash is to be bit-sensitive, the distribution of hash inputs (inverse outputs) is horribly multimodal.
- You can't generate the output of the inverse in stages, because the bit-sensitivity makes it nigh impossible to say you're meaningfully getting closer to the correct answer.
Also seems to be a bad match for ML.
Finally, some broader implications. Good hashes are hoped to be one-way functions. https://en.wikipedia.org/wiki/One-way_function https://en.wikipedia.org/wiki/One-way_function Inverting one succeeds with very little probability, by definition. If your approach worked it would show that there is SOME algorithm for inverting these functions and thus they are not one-way. That's OK, there's actually no proof that ANY function is one-way. But our current hash functions have survived years of intense scrutiny by human-intelligence experts. Learning to invert one would be a major, exciting development, upending an entire field. Not impossible, but a reason for skepticism.
- graderjs 4y agoMmm, I love this idea! Clear write up! Something I’ve never thought about, but did from your answer is that “wow does that mean that human knowledge is a smooth function?” That’s such an interesting statement to think about what that means. Regarding You can't generate the output of the inverse in stages, because the bit-sensitivity makes it nigh impossible to say you're meaningfully getting closer to the correct answer. That’s where I’m thinking maybe you could pair it (AI) with one of those statistical solvers for hash functions that tries to exploit correlations and differentials to try, even a tiny bit, to break that symmetry and get a little bit of incremental knowledge about: “are you closer or not?” I think if you could get even a tiny tiny edge then AI could be one way that you could maximize that advantage. Maybe, I don’t know how tho.