MD5 Collision Source Code Released 411
SiliconEntity writes "The crypto world was shaken to its roots last year with the announcement of a new algorithm to find collisions in the still widely-used MD5 hash algorithm. Despite considerable work and commentary since then, no source code for finding such collisions has been published. Until today! Patrick Stach has announced the availability of his source code for finding MD5 collisions and MD4 collisions (Coral cache links provided to prevent slashdotting). MD4 collisions can be found in a few seconds (but nobody uses that any more), while MD5 collisions (still being used!) take 45 minutes on a 1.6 GHz P4. At last we will be able to implement various attacks which have been purely hypothetical until now. This more than anything should be the final stake in the heart of MD5, now that anyone can generate collisions whenever they want."
So what the hell do I do now? (Score:5, Interesting)
Right now it's time to... (Score:3, Interesting)
In other words, right now it's time to...
...LICK OUT THE KAMS, NOTHERGUCKERS!
WTF this source is useless (Score:4, Interesting)
Not -that- bad (Score:3, Interesting)
If we could craft a collision block that contained a specified string at a specified position, that would be another issue altogether.
The ability to find collision blocks easily does suggest that crafted collision blocks might be possible, but for now, you have as good a chance of getting a viable exploit out of
This doesn't mean we shouldn't look to other options for the newest releases of high-security software, but it doesn't mean that the md5 algorithm should be purged from our systems altogether either. It's still extremely valuable at detecting accidental corruption, and useful-with-caveats at detecting malicious corruption (45 minutes to discover a block of data that matches the sum is not really useful in either speed or resulting data for any kind of man in the middle attack, for example, so using md5 to validate network packets is safer than using it to validate disk files).
Of course, the black hats may know more than we do about md5 weaknesses, but 'may know' is just as true of any other algorithm.
So you found a collision, big deal (Score:3, Interesting)
I guess if one were trying to deliberately pedal gibberish, like say if you were the RIAA trying to destabilize a torrent net then that would be all you care about. But for more general issues I don't get it.
Or is it now possible to generate a collision that also contains some intentional content like a binary program or source code or bank statement. That woul dbe be bad.
It seems like even in the case of gibberish generation that some simple hacks could extend the useful life of this. For example, if you were to MD5 a whole document and then MD5 the concatenation of every other byte in the document, it woul dbe pretty hard to find two collisions that had that property simulateously. Sure I wont doubt there are better ways to hash something than adding hacks to MD5. I'm just saying that it seems like a simple hack might well be good enough to extend its useful lifespan for passwords and file shareing.
But I invite you to explain to me why I'm wrong.
quick and dirty benchmark (factorial) (Score:1, Interesting)
put windows calculator in scientific mode (to keep things comparable, please use windose calculator, not some custom written C+ program....)
type in 100,000
hit the n! button
ignore the warnings that it will take a long time, don't even bother clicking on "Continue", because the calculation is still going.
and report how long it takes to complete a factorial of 100,000
please report what CPU you have.
P4 3.2Ghz and Athlon 3200+ both do it in about 80 seconds....
Doesn't Microsoft networking still use MD4? (Score:3, Interesting)
You can spoof (almost) arbitrary documents! (Score:5, Interesting)
Most document formats have lots of "dead space", parts you can pretty much modify at will without changing what the user actually sees. Comments in HTML or PostScript. Old junk data in Word documents. Executables can have just about anything you like added if you know your stuff. The MD5 attacks currently available only 128 "dead space" bytes to generate a collision. So far from being a gibberish document, one can generate almost any document you want. This page has a simple example with PostScript files. [cits.rub.de] Both files have the same MD5 hash, but one is a relatively harmless letter of recommendation while the other is a grant of security clearance. Get your boss to sign your letter of recommendation digitally, swap in the security clearance file, and pass it on. This is a Big Deal and a Major Problem.
I may not have been clear enough... (Score:4, Interesting)
Or you may have a brain tumor...
The generaly accepted definition for "cracking a password" is, given the encrypted password, being able to generate a password the once entered in the authentication system will generate the same encrypted form.
For the second time, this attack does not permit that. This attack permits build two byte streams that hashes to the same value. So in a password context, assuming the password system permits the entry permits more than 1024 bits of arbitrary data to be entered as password (I don't remind the details well, but I think this is the amount of data that you must be able to change between the two streams) one could generate to "passwords" (being that long they don't qualify for this name anymore IMHO) that would hash to the same value.
How does that amount to an attack on MD5 passwords again? Never at any point the attack had been being able given a unknown to him MD5 hash to produce a stream that would hash to the same value.
Re:Q and A (Score:5, Interesting)
This is a very bad password salting scheme and vulnerable to a dictionary attack. Once I have your database and salts, I can run a dictionary of common passwords through your scheme and crack any weak passwords.
You can make things much harder by having your salt change for each password - include the username for example. Now I have to run my entire dictionary through the sha/md5 function for each user. By doing this, you make the attack O(m*n) instead of O(m) (where m = the number of words in my dictionary and n = the number of users).
And as you mentioned in a follow up post, this code only generates documents with identical md5 sums, it does not generate a document with a given sum. So MD5 is broken for document signing and the like, but secure for password hashing for the time being.
Re:Why? (Score:3, Interesting)
Your point is well taken. However, in this case, I believe you are mistaken. Indeed 3DES is just an extended form of DES which uses 2 keys and three encryptions. But here you are speaking of access so the analogy is likely to be fatally flawed anyway.
My initial response was to the idea that a hash of a hash would provide any security and indeed would reduce it as your example illustrates. If you MD5 a SHA1 hash, you have reduced your security because a failure in either hash algorythm renders the entire chain ineffective (weakest link principle).
Now, with my proposal, one would include independant hashs which would be checked independantly. If either one fails, one assumes that the data has been tampered with. The issue is that it would be difficult to defeat both simultaneously for this specific type of check. Being able to do so on demand while editing the file in a meaningful way might well prove impossible.
Mixing encryption systems is indeed the bread and butter of the way our systems usually work. For example almost any key exchange algorythm uses a combination of encryption algorythms to ensure that symmetric encryption keys can be exchanged in a secure manner among previously unknown parties. But the key is that you want to make it a requirement to break every link on the chain and not have the system fail when one link is compromised. And yes, double-encrypting with the same key is stupid
SHA1 is not a good alternative in some cases (Score:4, Interesting)
For the impatient, here is a summary for my recommendations for 2005-2006:
See the paper for mode details.
Re:breaking torrents? (Score:3, Interesting)
now if you you were a software company you could put torrents out (I assume they use blocks of MD5sum), and then after the torrent becomes popular start randomly seeding people with blocks that hash correctly but are complete garbage (since you can't pick what exactly you hash)
Yeah, they could do that. They could even use the same trick as the guys who showed the Postscript exploit and make the software do different things based on which of the collision pair is in the file. Get the right version and the software runs fine. Get the wrong version and the software formats your drive.
In case it's not clear, the attack is to write some code like:
The legit version contains the same value for a and b, but the bogus version contains different values. Both programs hash to the same value, but they behave differently.
This sort of attack can work wherever you can compare blocks and then follow different codepaths based on the result. It could probably work with the scripting language that DVD menuing systems are implemented in, too, so it could work for DVD ISOs. Audio and video streams would probably not be vulnerable.
Re:SHA-1??? (Score:3, Interesting)
Re:MD5 and digital signatures (Score:3, Interesting)
And well, here's a bit of news: someone has done just that with X.509 certificates based on MD5.
Ouch. I'm not sure how I missed that one. The first page of their paper shows that I greatly underestimated the severity of the attack. What I hadn't realized is:
My understanding was that the collision generation algorithm only created relatively small blocks, both effectively random, and that appending those blocks to different chunks of data would produce different hashes, even though the blocks themselves hash to the same value. But apparently the method can produce collisions even with arbitrary, attacker-specified IVs. That means effectively that you *can* craft a collision to any file, even a pre-existing file, as long as the file format has some "dead" space at an appropriate offset and the changes you want to make can precede this location.
This is significantly worse than I understood it to be. It still doesn't affect password hashing, but it affects many other uses of hashing. The exploit that showed a pair of different postscript documents with different visible content but the same hash didn't require the property that Lenstra et al used to create the certs, which led me to my erroneous assumption.
Thanks for pointing out this attack.
gnupg configuration help (Score:2, Interesting)
Re:SHA-1??? (Score:3, Interesting)
And then, when generating hashes of a 5 gigabyte file on my hard drive (there's been a lot of good stuff on Freshmeat, recently):
I'm going to guess, on the basis of these results, that you want to try Tiger as a first choice, Haval as a second choice, and that the mhash implementation will probably be OK for Tiger but if you opt for Haval you're probably better with a different hashing engine.