by RiderOfGiraffes · 17y ago · 0 comments
Could you expand a little further as to why the scheme I've described doesn't work?
Thanks.
Let's assume that the hash is computationally secure, so that it's effectively impossible to compute a file to match a given hash. SHA-256 seems to me to meet that assumption.
I decide whether I want heads or tails, and create a file that starts with my choice, then has random padding. I compute the hash and send it to you.
You now tell me openly your call. I believe you have no way to compute from my hash what I've chosen, so to you, my choice is hidden. Whether you guess right is effectively random.
Now I reveal the file from which the hash was computed. Again, I can't compute a different file with the same hash, so I'm forced to reveal the choice I made. If you were right we both know it. If you were wrong we both know it.
Can you explain how it's possible for either of us to cheat?
I appreciate your time - thanks.
The coin is effectively irrelevant. Imagine we're together and I pretend to toss the coin. I decide what I want it to be, place it as that, and then hold it in my hand. Provided I'm not allowed to change my mind, this is just as fair as actually tossing the coin because you are free to call and are right or wrong with equal probability. The point about the real coin is that it prevents me from changing my mind. The point about the hash is it prevents me from changing my mind.
In effect, the hash is the coin. I am free to decide heads or tails as I wish - I just need to be prevented from changing my mind after you call.