3

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?

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
Nirmal
  • 4,739
  • 13
  • 70
  • 113

2 Answers2

4

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.

Community
  • 1
  • 1
Olly
  • 7,492
  • 8
  • 48
  • 59
0

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.

Nirmal
  • 4,739
  • 13
  • 70
  • 113