开发者

Is it possible to break md5 hash using genetic algorithms?

开发者 https://www.devze.com 2023-03-01 22:07 出处:网络
With a knowledge of how md5 works, would it be possible to use a population based algorithm such as genetic programming to break simple passwords?

With a knowledge of how md5 works, would it be possible to use a population based algorithm such as genetic programming to break simple passwords?

For examples, given a md5 hash for a string that is between 5 to 10 characters, we are to try to get the string back.

开发者_如何学C

If yes, what could be

  • A good representation for an individual of the population
  • Selction criteria
  • Recombination methods

This is to understand the application of genetic algorithms and to know if anyone has done anything of this sort.


Not really.

With just 5 characters, you could brute force it in not too unreasonable amounts of time, but presumably you're asking more about GAs than you are about breaking MD5. The problem is that there's no exploitable structure in an MD5 hash. Strings that are "close together" do not generate hashes that are "close together" under any useful distance relationship. The fitness function will basically be random.


I think the answer is "no". Because you are not able to get any crossover function. And the fitness function will be boolean. GA with only mutation operator and such fitness function is a bruteforce.


No, it is highly unlikely.

The genetic algorithm is used eg. for finding local/global maximum/minimum of some function. In case of md5 hash, if you change the value for which you calculate md5 hash, the md5 hash changes completely, thus narrowing the input value range is completely unuseful. MD5 algorithm was designed to hash the generated value if input data changes in any way. The only possibility to find the correct value is when you apply mutation, but it results in checking random input values for whether they generate the given hash (which - as oxilumin said - is just a brute force attack).

You can read more about finding value that generated specific md5 hash here (rainbow tables).


Although the answer is probably "no", there is one caveat to consider: The published collisions are strings that only differ by a few key bytes: https://en.wikipedia.org/wiki/MD5#Collision_vulnerabilities

Guessing the plaintext with a genetic algorithm isn't guaranteed, but it may be more efficient to discover a collision that way.

Or if it's in PHP and compares the md5 hash with the == operator... https://eval.in/108854

0

精彩评论

暂无评论...
验证码 换一张
取 消