# Finding partial pre-image of MD5 hash

I have the following requirement for hashing using MD5.

H(A,B,C,X);

Where values A,B & C are given. However X is not given.

I would like to find out what value of X would give a hash beginning with 32 1's bits

meaning H(A,B,C,X) = Begin with 32 '1' bits

I can brute force by testing all kinds of characters of X till i get 32 '1' bits.

however is there a faster way rather than doing this?

• Short answer: No, there isn't. So use brute-force. But if you use a GPU it'll just take a few seconds to find such an $X$. – CodesInChaos Nov 4 '12 at 17:00
• Are A, B, C, X arbitrary length strings, or is there a length limit? – Paŭlo Ebermann Nov 4 '12 at 20:09
• A,B,C are fixed strings where as X can be any characters up to 100 characters of length – null Nov 5 '12 at 1:01