Is it possible to decrypt MD5 hashes?

前端 未结 24 2356
北荒
北荒 2020-11-21 06:22

Someone told me that he has seen software systems that:

  1. retrieve MD5 encrypted passwords from other systems;
  2. decrypt the encrypted passwords and
相关标签:
24条回答
  • 2020-11-21 06:37

    Not directly. Because of the pigeonhole principle, there is (likely) more than one value that hashes to any given MD5 output. As such, you can't reverse it with certainty. Moreover, MD5 is made to make it difficult to find any such reversed hash (however there have been attacks that produce collisions - that is, produce two values that hash to the same result, but you can't control what the resulting MD5 value will be).

    However, if you restrict the search space to, for example, common passwords with length under N, you might no longer have the irreversibility property (because the number of MD5 outputs is much greater than the number of strings in the domain of interest). Then you can use a rainbow table or similar to reverse hashes.

    0 讨论(0)
  • 2020-11-21 06:38

    No, it cannot be done. Either you can use a dictionary, or you can try hashing different values until you get the hash that you are seeking. But it cannot be "decrypted".

    0 讨论(0)
  • 2020-11-21 06:39

    It is not yet possible to put in a hash of a password into an algorithm and get the password back in plain text because hashing is a one way thing. But what people have done is to generate hashes and store it in a big table so that when you enter a particular hash, it checks the table for the password that matches the hash and returns that password to you. An example of a site that does that is http://www.md5online.org/ . Modern password storage system counters this by using a salting algorithm such that when you enter the same password into a password box during registration different hashes are generated.

    0 讨论(0)
  • 2020-11-21 06:40

    Yes, exactly what you're asking for is possible. It is not possible to 'decrypt' an MD5 password without help, but it is possible to re-encrypt an MD5 password into another algorithm, just not all in one go.

    What you do is arrange for your users to be able to logon to your new system using the old MD5 password. At the point that they login they have given your login program an unhashed version of the password that you prove matches the MD5 hash that you have. You can then convert this unhashed password to your new hashing algorithm.

    Obviously, this is an extended process because you have to wait for your users to tell you what the passwords are, but it does work.

    (NB: seven years later, oh well hopefully someone will find it useful)

    0 讨论(0)
  • 2020-11-21 06:42

    MD5 is a hashing algorithm, you can not revert the hash value.

    You should add "change password feature", where the user gives another password, calculates the hash and store it as a new password.

    0 讨论(0)
  • 2020-11-21 06:43

    MD5 is considered broken, not because you can get back the original content from the hash, but because with work, you can craft two messages that hash to the same hash.

    You cannot un-hash an MD5 hash.

    0 讨论(0)
提交回复
热议问题