Sunday, May 11, 2008

MD5 Collisions

Today i find the need to make a post on MD5 collisions as many people still don’t understand what it really is..

Just like all the rest i tended to believe that the method of finding collisions (described by Xiaoyun Wang and Hongbo Yu) can help make a 128 byte block that will have the same hash code as the hash code that i am interested in. That’s one of the last ferry tails from my youth that i believed till yesterday.

I’ve heard about MD5 collisions since the moment when first posts have appeared about a source code released in public domain. It was the time when i was experimenting with all dangerous stuff like delphi, c++ and asm mixed in one cocktail. Actually it came to my attention as i was trying to write a very fast implementation of MD5 that could be used for brute forcing and i was searching for any info on MD5. When i’ve read about collisions i thought that this is big.. that this will shake the world of web sites, when lots of guys had MD5 hashes hacked from engines like forums, or CMS, and were searching for a way to brute force them. After almost 2 years of believing that collisions can break a hash code, i finally realized that i was wrong.. and i do admit it. There were lots of discussions on forums like what to do with the user databases, how to migrate to a different hashing method, and guys from the other camp asking how to use the collision sources. How naive it was..

The truth

The source code (released by Xiaoyun Wang and Hongbo Yu) won’t generate a block that has the same hash code (unfortunately).. By using this code you can make 2 files that will have the same hash code. All the basic idea is described in this article that i find really nice http://www.mathstat.dal.ca/~selinger/md5collision/.

So to all web admins, web developers and so on, stop freaking out. MD5 passwords still can be cracked only by brute forcing or Rainbow Tables.