/** * Calculates the MD5 hash of the string. * * @param text * @return md5 hash of the string */ public static String getHashMD5(String text) { byte[] bytes = text.getBytes(StandardCharsets.ISO_8859_1); return getHashMD5(bytes); }
String md5Password = CryptoUtil.getHashMD5(password); if (storedPassword.substring("{MD5}".length()).equals(md5Password)) { log.trace("Unsalted MD5 hashed password matched for user '{}'", username); String cmd5Password = CryptoUtil.getHashMD5(username + password); if (storedPassword.substring("{CMD5}".length()).equals(cmd5Password)) { log.trace("Salted MD5 hashed password matched for user '{}'", username);
String md5Password = CryptoUtil.getHashMD5(password); if (storedPassword.substring("{MD5}".length()).equals(md5Password)) { log.trace("Unsalted MD5 hashed password matched for user '{}'", username); String cmd5Password = CryptoUtil.getHashMD5(username + password); if (storedPassword.substring("{CMD5}".length()).equals(cmd5Password)) { log.trace("Salted MD5 hashed password matched for user '{}'", username);