interface JDBCHashStrategy
Determines how the hashing is computed in the implementation You can implement this to provide a different hashing strategy to the default.
Author
Tim Fox
abstract fun computeHash(password: String, salt: String, version: Int): String
Compute the hashed password given the unhashed password and the salt |
|
abstract fun generateSalt(): String
Compute a random salt. |
|
abstract fun getHashedStoredPwd(row: JsonArray): String
Retrieve the hashed password from the result of the authentication query |
|
abstract fun getSalt(row: JsonArray): String
Retrieve the salt from the result of the authentication query |
|
abstract fun setNonces(nonces: MutableList<String>): Unit
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. |