diff --git a/src/main/java/helpers/ScryptHelper.java b/src/main/java/helpers/ScryptHelper.java index bea2b34..be23a56 100644 --- a/src/main/java/helpers/ScryptHelper.java +++ b/src/main/java/helpers/ScryptHelper.java @@ -4,6 +4,7 @@ import java.nio.CharBuffer; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Arrays; @@ -106,12 +107,14 @@ return false; } } + + boolean result = MessageDigest.isEqual(cHash, hash); Arrays.fill(salt, (byte) 0); Arrays.fill(hash, (byte) 0); Arrays.fill(cHash, (byte) 0); - return true; + return result; } else { throw new IllegalArgumentException("Hash is not in a recognisable format!");