Pbkdf2Hasher
class Pbkdf2Hasher(secret: CharSequence = "", saltLength: Int = DEFAULT_SALT_LENGTH, iterations: Int = DEFAULT_ITERATIONS, algorithm: Pbkdf2PasswordEncoder.SecretKeyFactoryAlgorithm = SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256) : PasswordEncoderHasher
Hasher that uses the PBKDF2 algorithm, salting each value individually.
Encoded values are the hex encoded salt and hash, 96 characters long with the default parameters, varying with saltLength and the hash width of algorithm.
Parameters
secret
Optional secret, sometimes called a pepper, mixed into every hash. Unlike the salt it is not stored alongside the hash, so it has to be kept and supplied identically in order to verify existing values.
saltLength
Length in bytes of the randomly generated salt
iterations
Number of hashing iterations to perform
algorithm
Pseudorandom function to apply on each iteration
Constructors
Link copied to clipboard
constructor(secret: CharSequence = "", saltLength: Int = DEFAULT_SALT_LENGTH, iterations: Int = DEFAULT_ITERATIONS, algorithm: Pbkdf2PasswordEncoder.SecretKeyFactoryAlgorithm = SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256)