I am encrypting the security in my web page with MD5 and Im using the following code.
public static String stringToMD5(String password)
{
MessageDigest messageDigest;
try {
messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(password.getBytes(),0, password.length());
String hashedPass = new BigInteger(1,messageDigest.digest()).toString(16);
if (hashedPass.length() < 32) {
hashedPass = "0" + hashedPass;
}
return hashedPass;
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return password;
}
But because a custom way to log in I had to developed a custom AbstractAuthenticationProcessingFilter and now I have to decrypt that MD5.
So the question is how to decrypt the produced by that function.
Thanks in advance.