Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following requirement for hashing using MD5.


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?

share|improve this question
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

Short answer: no you can't, MD5 is not that broken.

Long answer: if you really need to do that, a laptop i5 is able to try 5 millions of MD5 hashes per second; on average you will have to try 2^32 ~ 4300 millions hashes, so that it will be a matter of minutes on any decent remotely-modern CPU.

share|improve this answer
With a GPU it's even faster, taking only a few seconds. See oclHashcat performance – CodesInChaos Nov 5 '12 at 11:34
@CodesInChaos looking into that now. this crack is taking me forever with brute force – null Nov 5 '12 at 18:51
up vote 0 down vote accepted

After much research you can actually use CUDA to program your program to run with GPU, which is super fast.

Alternatively you can run your program directly using your graphics card utility. Example given at the site:

This is slightly faster than just running your brute force program as per normal.

share|improve this answer

Your Answer


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.