I want to know how to find just the first character or digit in first part of a 64 length string from a MD5 hash. For example, we have a hash:


and MD5 is:


In this case, what is the solution to find "f" that is the first part of string from the MD5?

  • 3
    That's not how hashes work, you can't get parts of it at a time
    – schroeder
    Feb 2, 2020 at 15:50

1 Answer 1


The MD5 pre-image resistance theoretically is broken bu not practically. Instead of the generic preimage attack with 2128 complexity, there is an attack that requires 2123.4 complexity. MD5, however, is not practically broken. You cannot reach the 123-bit search space in a meaningful time. Consider the collective power of BitCoin miners; in 2020/1/17 they reached 126.1314 Exahashes per second, that makes

  • 267 SHA256 double hashes in a second, and
  • 292 SHA256 double hashes in a year. So you need 221 years with that power.

What you asking is against the design principle of the hash functions; the avalanche criteria. That is changing one bit of input will flip approximately half of the output bits, randomly.

If you can find even a single bit better than the generic pre-image attack, then you have a theoretical weakness. you can use this attack like divide and conquer technique to reduce the overall pre-image attack complexity.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .