0

I am working on a project where I need to decrypt the password field on a HSQL DB. I need that field to perform some operation on my Java program. Kindly help me out.

fredt
  • 24,044
  • 3
  • 40
  • 61
AnirbanDebnath
  • 990
  • 16
  • 26

1 Answers1

1

You usually can't decrypt a password stored in the database. When a user account is created, the user chooses a password, and this string is then hashed using a one-way hashing function to the value you see in the database. On subsequent logins, a user enters his password, the password is again hashed, and the hashed value is compared against what is stored in the database.

It should be intuitive to you why you wouldn't want an encryption technique for your passwords which can easily be cracked. You don't want someone to be able to guess the password even if they can get their hands on the hashed value.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
  • You don't even want to be able to see them yourself. For why see [here](http://stackoverflow.com/questions/2283937/how-should-i-ethically-approach-user-password-storage-for-later-plaintext-retrie/2287672#2287672). – user207421 Mar 16 '15 at 06:24