PasswordEncoder
PasswordEncoder is a Spring Security interface and strategy for encoding passwords and verifying supplied passwords against stored encoded representations.
Spring Security in Action, Second Edition
PasswordEncoder is a Spring Security strategy for encoding passwords and matching supplied passwords against stored representations.
- How it is used
- Supports authentication by transforming stored passwords and validating supplied credentials through AuthenticationProvider.
- How deep it goes
- Defines encode, matches, and upgradeEncoding, implements plain-text and SHA-512 examples, then compares framework-provided strategies.
- Examples
- Uses NoOpPasswordEncoder, custom plain-text and SHA-512 implementations, BCrypt and SCrypt choices, and prefixed delegation.
- What you can do after
- Build it from scratch by implementing encode and matches, configure a Spring bean, or migrate algorithms with DelegatingPasswordEncoder.
Read how Spring Security in Action, Second Edition explains PasswordEncoder →
Spring in Action, Sixth Edition
PasswordEncoder is a Spring Security interface for transforming plaintext passwords into encoded representations suitable for secure storage and verification.
- How it is used
- Encodes registration passwords before persistence so the user details service can authenticate against stored encoded values.
- How deep it goes
- Explains injection and the encode call in registration, but does not detail encoding algorithms or verification internals.
- Examples
- Uses RegistrationController and RegistrationForm.toUser() to encode a submitted password before saving a User.
- What you can do after
- Apply it via dependency injection and RegistrationForm.toUser() to store encoded passwords during user registration.
Read how Spring in Action, Sixth Edition explains PasswordEncoder →
Related concepts
- AuthenticationProviderused by · AuthenticationProvider is a Spring Security interface or component that encapsulates a specific authentication mechanism and returns an authentication result.
- DelegatingPasswordEncoderincludes · DelegatingPasswordEncoder is a Spring Security PasswordEncoder implementation that selects another password encoder according to an identifier in the stored password representation.
- NoOpPasswordEncoderincludes · NoOpPasswordEncoder is a Spring Security PasswordEncoder implementation that leaves passwords unencoded in cleartext.
- authenticationuses · Authentication is the process of establishing or verifying the identity of a user, service, device, or other communicating entity.
- BCryptPasswordEncoderincludes · BCryptPasswordEncoder is a Spring Security PasswordEncoder implementation that hashes passwords using the bcrypt password-hashing function.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

