Hot answers tagged preimage-resistance
5
It sounds like you're pretty much out of luck.
Yes, there are a few tricks you could use to speed up a brute force search; for example, if we fix everything other than DWORD 3 of B, we can precompute everything up to round 10 of MD5, and compute what the value of the internal 'b' variable of round 52 of MD5 must be to generate the expected hash; this ...
3
As Mike asked, it's not clear if you're asking about onewayness, or collision resistance (as you call the function a 'cryptographic compression function').
Assuming you're asking about onewayness, well, given a single 128 bit value $h(M)$, we obviously cannot uniquely deduce the 1408 bit value $M$. However (hint), let us assume that we can ask for the ...
2
Your idea is equivalent to doing "constant folding" or "partial compilation". It's not likely to make much difference (see below for detailed explanation).
But, even setting that aside, there's a more significant reason why you're not gonna be able to find B. In your situation, the unknown part (B) is 4 DWORDs long, i.e., 128 bits long. This means that ...
2
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.
2
I have ask as part of my answer, "What problem are you trying to solve?"
Do you want a secure unkeyed hash function? If you do, then there are plenty of them around. Even some of the ones that are broken for some uses might be okay for yours (SHA-1 springs to mind -- note the discussion above on HMAC and how broken a hash function has to be). But really, ...
Only top voted, non community-wiki answers of a minimum length are eligible