Determines how the hashing is computed in the implementation

You can implement this to provide a different hashing strategy to the default.

no subtypes hierarchy

Initializer
JDBCHashStrategy(JDBCHashStrategy unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
computeHashshared default String computeHash(String password, String salt, Integer version)

Compute the hashed password given the unhashed password and the salt

Parameters:
  • password

    the unhashed password

  • salt

    the salt

  • version

    the nonce version to use

generateSaltshared default String generateSalt()

Compute a random salt.

getHashedStoredPwdshared default String getHashedStoredPwd(Array row)

Retrieve the hashed password from the result of the authentication query

Parameters:
  • row

    the row

getSaltshared default String getSalt(Array row)

Retrieve the salt from the result of the authentication query

Parameters:
  • row

    the row

setNoncesshared default void setNonces(Array nonces)

Sets a ordered list of nonces where each position corresponds to a version.

The nonces are supposed not to be stored in the underlying jdbc storage but to be provided as a application configuration. The idea is to add one extra variable to the hash function in order to make breaking the passwords using rainbow tables or precomputed hashes harder. Leaving the attacker only with the brute force approach.

Nonces are dependent on the implementation. E.g.: for the SHA512 they are extra salt used during the hashing, for the PBKDF2 they map the number of iterations the algorithm should take

Parameters:
  • nonces

    a json array.

Inherited Methods
Methods inherited from: Object
equals