We know no practically feasible way to do what you ask for, except if the hash X=acf3602b5eb9a2db3e365d3043682faf
or the content of the file wczasp.rb
was prepared specially to make that possible.
Assuming that the content of file wczasp.rb
is arbitrary, what is asked would be a preimage attack. This is further sub-classified as first preimage if only the hash X=acf3602b5eb9a2db3e365d3043682faf
is known to the attacker, or second preimage if the content of the file wczasp.rb
is known.
If MD5 was a perfect Merkle–Damgård 128-bit hash, the best attack would be brute force, with an average cost of $2^{128}$ rounds (1 round is needed to hash a file of less than 56 bytes). Put simply, that won't happen even if you harnessed all the computing power available on earth.
However, MD5 is far from perfect. Its collision resistance is broken, very badly. In particular, this makes it very easy to prepare a wczasp.rb
file hashing to some value, so that it is possible to exhibit a different file, of the same length, hashing to the same value. Without a theoretical break, that would have required about $2^{64}$ rounds using Floyd's cycle-finding, which is costly, but feasible.
Because MD5 has these known weaknesses, and no strong security argument, a much better-than-brute-force preimage attack against MD5 can not be ruled out (especially a second preimage attack, which is easier than first preimage in a Merkle–Damgård construct at least). In fact, a preimage attack with complexity $2^{123.4}$ has been published. That is 24 times better than brute force (but still entirely impractical). I have not reviewed it in depth, and conjecture that it could work only as a second-preimage attack for a file of length $21\pmod{64}$, which is part of the example problem.
While there is currently a helluva of headroom in the security of MD5 against pre-image attacks, the saying attributed to the NSA comes to mind: "Attacks always get better; they never get worse".
md5clone.exe
andevilize
for Unix. The difference seems to be that they can control both images, whereas I can't control the first image; taken purely as data input. Anyway, I am actually less interested in MD5 itself, than in another way of hashing uncontrolled data that's more easily clone-able. You pointed out CRC, good--somehow thinking of that I confused it with MD5 earlier (huge diff I know) $\endgroup$