MD5 decryption algorithm in java

Is it possible to decrypt the code below? below is my method where we encrypt String values. If this is decryption, please help me how to do this, since my MD5 algorithm is not decrypted, but at the moment, my task is to find a way to decrypt it. Please provide your valuable feedback to do this.

public static String encryptPassword(final String password) { if (MyUtil.isEmpty(password)) { return null; } MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); digest.update(password.getBytes(), 0, password.length()); String secured = new BigInteger(1, digest.digest()).toString(16); return secured; } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return null; } 
+4
source share
2 answers

but now my task is to find a way to decrypt it.

Good luck. MD5 is a hash, which means one-way, not necessarily bijective conversion, from input to output. MD5 is known to be weak, but only for general collisions, and not for the selected hash attack. You can try every possible input until you get the correct hash (or collision), but it will be costly and not necessarily a good idea. In addition, pre-created rainbow tables can be used as a memory compilation over time. They take a long time to generate, but have a quick search. I will not refer to them because of disagreements on their use, but you can get and purchase them freely if you are within the applicable laws of your jurisdiction. This process is still not ordinary, and it is not a good idea for a webapp or a general application.

Have you looked into AES instead, which has a key and is encrypted, allowing decryption with this key?

+3
source

You cannot undo the MD5 algorithm, which you can do to look for collisions and hope that you find it. The most common way to crack the md5 hash is with rainbow tables , where you compare your hash with a huge collection of pre-computed hashes, hoping to find a match.

+1
source

Source: https://habr.com/ru/post/1500545/


All Articles