I would like to know whether Spring / Spring Security provide a means to Encrypt / Decrypt a password.
The scenario would basically be to encrypt the password and store in the DB , and perform a user authentication against the same on login.
I would like to know whether Spring / Spring Security provide a means to Encrypt / Decrypt a password.
The scenario would basically be to encrypt the password and store in the DB , and perform a user authentication against the same on login.
The Jasypt project library that simplifies encryption .You can find a number of examples Spring based password encoderd in Integrating Jasypt with Spring Security 2.x or 3.x (or Acegi 1.x) here are other tutorial http://blog.teamextension.com/quick-jasypt-spring-3-tutorial-626 http://chrislovecnm.com/2011/06/16/encrypting-spring-3-java-based-configurations-values-with-jasypt/
Take a look at the PasswordEncoder.
http://static.springsource.org/spring-security/site/docs/3.0.x/reference/core-services.html
In case of securing access to database, LDAP or other resources, nowadays you can use Spring Boot Cloud CLI for passwords encryption and decryption
$ spring encrypt mysecret --key foo 682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bda
$ spring decrypt --key foo 682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bda mysecret
Later you can use these passwords in Spring Cloud Config.