Quote:
Originally Posted by AlbertoKnox
Right, the possibility of pre-finding collisions is what made me think of including the current time in the extra junk.
If I give the them the hash, how does it help for them to bother hashing? They can just tell me once I'm committed right?
|
Good point, only one of you needs to hash.
Quote:
|
The key can't be -just- the data or they could brute force it fast, so it has to have extra junk, opening the same collision issue, right?
|
I don't think it's common for encryption algorithms to have more than one key that can decrypt a message. It's "common" is hashes (it's actually NOT that common, it's often quite rare and difficult to find, but it's more common than in encryption algorithms) because most hashing algorithms are vastly reducing the size of the output space. Take md5 for example - no matter how many bits you put into md5, you get a fixed length out (say, 32 hex digits) which means that there MUST be many plain texts that will hash into the same hashed value.
Quote:
|
Do you mean he wins just by guessing my guess? He could never know the secret, right? Maybe I'm confused though.
|
He supplies the number, you supply the secret, you put those together to make a key and use it to unlock your message. If it works, it'll unlock your message which should contain both the number and the secret to verify that they match.
Quote:
|
A collision does seem unlikely, but it would be good to know just how unlikely.
|
I have not ever really been interested in actual implementations of encryption so I don't know, but it might actually be considered impossible. The added requirement that the key and the plaintext share some text should make it very, very difficult.
Also, of course, encryption is NEVER seen as a means of keeping something hidden forever. It's simply a matter buying yourself a given length of time at current computing levels. So all you have to do with your scheme is make each iteration secure for many many multiples of the length of time it's active. A timestamp or gameid or something like that should be helpful there.
You might find it insightful to write a simple program to try to produce 2 short plaintexts that produce the same hash using some common hashing algorithm like SHA2 or MD5 and then extrapolate from there. Like say you give your player a game id, and say, hash the game id plus your guess and get it back to me in 10 minutes or less. Then try to satisfy yourself that it would take, say, 10 years to break the game. Even if you're wrong by orders of magnitude, you should be pretty safe.