Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I am new to cryptography and this practice question is puzzling me. Please help!

share|improve this question

closed as off-topic by Adnan, TildalWave, AJ Henderson, Steve, Xander Mar 6 at 20:10

  • This question does not appear to be about Information security within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
If the hash is different (even by one bit), the inputs are guaranteed to be different. But if the hashes are the same, the input might still be different (with very small probability, assuming a good hash like SHA-256). –  CodesInChaos Mar 6 at 12:31
5  
This question is better suited at Crypto.SE –  Adnan Mar 6 at 13:01
1  
Do you mean you know that at least 50% of the bits of 2 hashes are the same (and you don't know about the other bits)? i.e. Given you know 50% are the same, what is the probability that the original plaintext was the same? That might be a more meaningful question –  Baldrick Mar 6 at 13:08

1 Answer 1

Looks like a trick question.

With a perfect (cryptographic) hash then there should be no correlation between the input and output of the hash, therefore the similarity of the hash outputs should bear no relation to the similarity of the 2 inputs.

Indeed, if you pick 2 random hash outputs then, on overage 50% of the bits will be the same. If you pick any 2 random peices of data, then on average half the bits will be the same.

If you apply the same hash function to the same data it should always produce the same result. There's only a very low probability of 2 different messages picked at random resulting in the same hash (a collision). The likelihood of this occurring for a perfect hash is dependant on the length of the hash (with a 1 bit hash, the probability is 50%, 2 bits, 25% etc).

The similaritiy of the output has nothnig to do with the similarity of the input.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.