I’m attempting to convert a web project to Spring.
I have already incorporated Spring Security, however the old project used SHA-1 converted to a hex string to encrypt user passwords.
I was wondering how I can go about making a custom password encoder that will allow me to specify exactly how I want the password encrypted.
Sure, you probably don’t need a custom encoder, since it’s quite easy using Security’s namespace configuration
<password-encoder>:Put this line into your security-context.xml and it’ll use
ShaPasswordEncoderwith SHA-1 algorithm and BASE64 encoding enabled.