Spring Security 3.1 provides a new cryptography module that is included in the spring-security-core module and is available separately in spring-security-crypto. The crypto module contains its own o.s.s.crypto.password.PasswordEncoder interface. In fact, using this interface is the preferred method for encoding passwords, because it will salt passwords using a random salt. At the time of this writing, there are the following three implementations of o.s.s.crypto.password.PasswordEncoder:
Class |
Description |
o.s.s.crypto.bcrypt.BCryptPasswordEncoder |
This class uses the bcrypt hashing function. It supports salt and the ability to slow down to perform over time as technology improves. This helps protect against brute-force search attacks. |
o.s.s.crypto.password.NoOpPasswordEncoder |
This class does no encoding (it returns the password in... |