Hacker News new | ask | show | jobs
by lawnchair_larry 4898 days ago
Actually that particular attack is impossible as far as humans currently know.
1 comments

Are you saying that any given substring of characters will provably rule out a chunk of "hash space" for the entire message? Because that property sounds sort of interesting in itself.
No, I'm not. Also "impossible" was a bad word for me to use. It's impossible in the "not enough time before the sun burns out" sense, not in the mathematical proof sense.

I should have said impractical, but then people sometimes respond by talking about how fast GPUs are advancing, not getting just how far off they really are.

The best known attack to find a first pre-image is 2^123. To put this in perspective, using a slightly modified common analogy to describe how long 2^128 is:

"Imagine a computer that is the size of a grain of sand that can test inputs against a hash. Also imagine that it can test a hash in the amount of time it takes light to cross it. Then consider a cluster of these computers, so many that if you covered the earth with them, they would cover the whole planet to the height of 1 inch. The cluster of computers would find a valid pre-image on average in 1,000 years."

Even then, you would not have a useful preimage to mount an attack. You wouldn't even have ASCII. If you got ASCII, it wouldn't be syntactically correct javascript. If it was, it wouldn't do anything remotely malicious.

You would have to keep doing this until you randomly generated an input that happens to be valid javascript that performs your malicious action.

So, I rounded up to impossible.