Pbkdf2PasswordEncoder is a Spring Security PasswordEncoder implementation that derives password representations with the password-based key derivation function 2 (PBKDF2). section 4.1.3
Spring Security provides several PasswordEncoder choices:
- Pbkdf2PasswordEncoder uses PBKDF2. section 4.1.3
- BCryptPasswordEncoder and SCryptPasswordEncoder use bcrypt and scrypt respectively; StandardPasswordEncoder uses SHA-256 and is deprecated, while NoOpPasswordEncoder leaves passwords in cleartext for examples only. section 4.1.3
Parameterized construction
PasswordEncoder p = new Pbkdf2PasswordEncoder("secret", 16, 310000, Pbkdf2PasswordEncoder.SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256); section 4.1.3
PasswordEncoder p =
new Pbkdf2PasswordEncoder("secret", 16, 310000, Pbkdf2PasswordEncoder. SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256);
Inspect the complete parameterized Pbkdf2PasswordEncoder declaration. section 4.1.3
