4

All the examples of MD5 hash collisions I've come across comprise two different messages (inputs) of the same length. The first and second messages have different values for a number of bits and the resulting MD5's are equal.

Does the theory of finding an MD5 hash collision (exploiting the weakness in the algorithm) prescribe that the lengths of the messages be the same? In other words, would the theory be unusable to find a collision of two messages of different lengths? Has such a collision ever been found?

3
  • Considering md5 is designed to work with any arbitrary string length as input and there is a finite domain for potential md5 hashes (128 bit output), there is (and i'll lay my neck out on the line here) definitely a collision between inputs of differing length (somewhere..). Do I have an example? Unfortunately no, but you can logically deduce that such a string must almost certainly exist.
    – d0nut
    Jan 26 '16 at 22:47
  • @mgr326639, Might have better answers if you ask on crypto.stackexchange.com/questions/tagged/md5
    – Pacerier
    Jan 27 '16 at 0:11
  • 2
    These answers are not close to answering this question. In cryptography.se, this question asked almost the same time but got the answer two years ago. See Are there MD5 collisions for inputs of different lengths?
    – kelalaka
    Jan 24 at 22:33
2

Does the theory of finding an MD5 hash collision (exploiting the weakness in the algorithm) prescribe that the lengths of the messages be the same? In other words, would the theory be unusable to find a collision of two messages of different lengths?

MD5 includes the length of the message in the final block. This means that from an attackers point of view, for reasonable sized messages*, a difference in message length* is effectively equivalent to a distinct chosen suffix.

There have been attacks on MD5 that have allowed for distinct chosen prefixes, but afaik none that allow for distinct chosen suffixes.

* Technically you could find a collision between two messages whose size differed by 2^64 bits, but actually storing and transmitting the larger of the two messages may pose a challenge.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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