0

I create a user manually via db(mysql). Now I want to encrypt the password for this user.How do I do this? Currently this is how I have acheived it.

1. Create a user in db with cleartext password
2. in my code while server startup, I check if password is cleartext then i encrypt it using bcrypt.
3. in spring-security.xml i have added bcrypt bean to decrypt it.

But using this approach I have to restart the server each time I add a new user. Any other way to do this? Using spring 4

Priyanka Lopes
  • 783
  • 1
  • 7
  • 14
  • Well that's easy. Remove step 2 completely, then replace step 1 with "Create user in db with bcrypted password". – Kayaman Aug 26 '15 at 10:02
  • Please follow the link for bcrypt algo in mysql. http://stackoverflow.com/questions/20295778/how-to-use-bcrypt-algorithm-within-encrypt-function-in-mysql-for-verifying-p – sitakant Aug 26 '15 at 10:04

0 Answers0