StandardPasswordEncoder is a Spring Security PasswordEncoder implementation that hashes passwords with SHA-256. It accepts an optional secret for the hashing process, but it is deprecated because this algorithm is no longer considered strong enough for new implementations. section 4.1.3
Use its status to guide implementation decisions:
- Do not select it for new applications. section 4.1.3
- Replace it when discovered in an existing application with a more powerful password encoder. section 4.1.3
- Compare alternatives such as Pbkdf2PasswordEncoder, BCryptPasswordEncoder, and SCryptPasswordEncoder. section 4.1.3
PasswordEncoder p = new StandardPasswordEncoder();
PasswordEncoder p = new StandardPasswordEncoder("secret");
The constructors show the default form and the form that supplies an optional secret. section 4.1.3
