docs/api/exposed-crypt/org.jetbrains.exposed.v1.crypt/-pbkdf2-hasher/index.html
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.
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
Members
Link copied to clipboard
constructor(secret: CharSequence = "", saltLength: Int = DEFAULT_SALT_LENGTH, iterations: Int = DEFAULT_ITERATIONS, algorithm: Pbkdf2PasswordEncoder.SecretKeyFactoryAlgorithm = SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256)
Link copied to clipboard
open override fun hash(plainText: String): Hashed
Hashes plainText into the value to be stored, salting it if the algorithm supports salting.
Link copied to clipboard
open override fun matches(plainText: String, encodedValue: String): Boolean
Returns whether plainText hashes to encodedValue, which is expected to be an already hashed value.
Generated by Dokka © 2026 Copyright