Reputation: 4829
I am using Spring, Hibernate for developing my application. And as DB side, I have MySQL. I have an User table and that has password field of varchar type.
Now, when a new user is created, I just want store password field in an encrypted form. Is there any facility provided by Hibernate to do so? Or is there any other way?
Upvotes: 3
Views: 10083
Reputation: 4829
I have resolve this issue by creating one trigger in mysql.
So, whenever any record created for User Table, it will fetch the password of that field and converted the password into encrypted form supported by mysql in-built function.
Upvotes: 0
Reputation: 7758
You might want to take a look at this thread which provides good answers for the same question:
Password encryption with Spring/Hibernate - Jasypt or something else?
In short, using a one-way hashing algorithm with salt to encrypt the password is the de-facto way of doing this.
Upvotes: 5