This question already has an answer here:
- Will hashing over and over eventually give the same hash? 1 answer
- Cycles in SHA256 4 answers
So let's say you had infinite time and energy. You have a hashed string of some sort. Because you have infinite time and energy, you can produce a collision(or the original value) easily enough. But, there is a problem. The hashed string was hashed an unknown amount of times. (ie, it may have been produced by
sha256(sha256("foobar")) or by
You were given a hint by your adversary though. They give you (say) 10 strings, of which one is the initial value that is hashed.
Is it possible to determine with absolute certainty that you chose the correct string? Is it possible that hashing "foobar" recursively an infinite amount of times will eventually yield any arbitrary hash value?
Although my question is about SHA256, I'd be equally curious of other hash algorithms as well