/** * Calculates the SHA256 hash of the string. * * @param text * @return sha256 hash of the string */ public static String getHashSHA256(String text) { byte[] bytes = text.getBytes(StandardCharsets.ISO_8859_1); return getHashSHA256(bytes); }
String shaPassword = CryptoUtil.getHashSHA256(password); if (storedPassword.substring("{SHA256}".length()).equals(shaPassword)) { log.trace("Unsalted SHA-256 hashed password matched for user '{}'", username);
String shaPassword = CryptoUtil.getHashSHA256(password); if (storedPassword.substring("{SHA256}".length()).equals(shaPassword)) { log.trace("Unsalted SHA-256 hashed password matched for user '{}'", username);