prestodb/presto · error · HashedPasswordException

Password hashing algorithm cannot be determined

Error message

Password hashing algorithm cannot be determined

What it means

Fallback guard in getHashingAlgorithm: the stored password string is neither a $2y BCrypt hash nor a colon-delimited PBKDF2 record, so no hashing algorithm can be identified for it. Fires when the password file contains an entry in an unrecognized format.

Source

Thrown at presto-password-authenticators/src/main/java/com/facebook/presto/password/file/EncryptionUtil.java:113

    }

    public static HashingAlgorithm getHashingAlgorithm(String password)
    {
        if (password.startsWith("$2y")) {
            if (getBCryptCost(password) < BCRYPT_MIN_COST) {
                throw new HashedPasswordException("Minimum cost of BCrypt password must be " + BCRYPT_MIN_COST);
            }
            return HashingAlgorithm.BCRYPT;
        }

        if (password.contains(":")) {
            if (getPBKDF2Iterations(password) < PBKDF2_MIN_ITERATIONS) {
                throw new HashedPasswordException("Minimum iterations of PBKDF2 password must be " + PBKDF2_MIN_ITERATIONS);
            }
            return HashingAlgorithm.PBKDF2;
        }

        throw new HashedPasswordException("Password hashing algorithm cannot be determined");
    }

    private static class PBKDF2Password
    {
        private final int iterations;
        private final byte[] salt;
        private final byte[] hash;

        private PBKDF2Password(int iterations, byte[] salt, byte[] hash)
        {
            this.iterations = iterations;
            this.salt = requireNonNull(salt, "salt is null");
            this.hash = requireNonNull(hash, "hash is null");
        }

        public int iterations()
        {
            return iterations;

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Re-create the password file entry using the supported BCrypt ($2y...) or PBKDF2 (salt:iterations:hash) formats
  2. Use the provided password generation tooling instead of manual hashing
  3. Validate the password file format before deployment
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-password-authenticators/src/main/java/com/facebook/presto/password/file/EncryptionUtil.java:113 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/b3cd794ddaddd919. Report an issue: GitHub.