Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I know this is a strange question, and I know that md5sum is nearly impossible to break... but I'm just wondering if someone here knows if it is possible to recreate a file given it's md5sum hash?

I mean, not necessarily the same file as the original but a file that would equate to the same md5sum hash. So far, I don't see any result from Google

share|improve this question
1  
See Predicting the winner of the 2008 US Presidential Elections using a Sony PlayStation 3. Contains some explanations and references too. –  manatwork Jan 10 '13 at 7:07

3 Answers 3

It is possible to find a file that has a given MD5 hash, but it is not possible to produce such a file from the hash itself.

share|improve this answer
    
+1 See: Trapdoor function & one-way function. –  Steel City Hacker Jan 10 '13 at 13:00

A unique MD5 hash can be produced by an infinite number of files, as there is only 2^128 unique hashes but there are infinite files of infinite length (theoretically).

To create a file from an MD5 hash would take a large amount of effort! You would have create a sequence of unique files and generate the MD5 hash for each one until you found a match. Certainly possible to 'brute force' your way through.

However your task would be considerably easier if you had the original file that the hash was produced with. There are several known flaws with MD5 and it is possible to create slightly different files for the same hash. MD5 is not unbreakable as you say.

share|improve this answer

Theoretically, it is possible! As user1129682 said, there is only 2^128 different MD5 hashes. Now, you can use a method of exhaustion to find a file with a specified MD5. e.g. You can generate a file with its contents as N "1"s and calculate its MD5. Increase N from 1 to infinity, then you will find at least a file with the predefined MD5. Of course, how long you can get it is unknown.

share|improve this answer
2  
That's not "create". –  Ignacio Vazquez-Abrams Jan 10 '13 at 12:57
    
@IgnacioVazquez-Abrams No, it's fair game. However, this method is useless in practice. If you're willing to spend the current age of the universe (a little under 1 billion billion seconds) enumerating possibilities, using a billion computers, each computer would have to perform about a trillion operation per second. Also, it is not guaranteed that there is a file containing only 1 bits with a particular MD5, you may need to put 0 bits as well. (It's not even known if all 16-byte blobs are the MD5 of some payload.) –  Gilles Jan 10 '13 at 23:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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