asked on
public static String MD5Digest(String userPassword)throws Exception{
String original = userPassword; //Replace "password" with the actual password inputted by the user
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(original.getBytes());
byte[] digest = md.digest();
StringBuffer sb = new StringBuffer();
for (byte b : digest) {
sb.append(String.format("%02x", b & 0xff));
//System.out.println("original:" + userPassword);
//System.out.println("digested:" + sb.toString());
}
return sb.toString();
//return userPassword;
//return original;
}
}