@Override
    public boolean passwordsMatch(Object plaintext, Hash saved) {
        ByteSource plaintextBytes = createByteSource(plaintext);

        if (saved == null || saved.isEmpty()) {
            return plaintextBytes == null || plaintextBytes.isEmpty();
        } else {
            if (plaintextBytes == null || plaintextBytes.isEmpty()) {
                return false;
            }
        }

        return saved.matchesPassword(plaintextBytes);
    }
Constructs a new PasswordService with a default hash service and the default
algorithm name {@value #DEFAULT_HASH_ALGORITHM}, a default hash format (shiro2) and
a default hash format factory.

<p>The default algorithm can change between minor versions and does not introduce
API incompatibility by design.</p>
core/src/main/java/org/apache/shiro/authc/credential/DefaultPasswordService.java