Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Encryption  RSS feed

 
sibasish padhi
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Is there any API for Encryption of Data. I mean to say I want to store the password in the database in an encrypted form and while retrival it will be decrypted .Can anyone help me
-Thanks
Sibasish
 
Thomas Rochon
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sibasish,

to compare a given String with a password stored in a data base,
you normally don't have to decrypt the password every time anew.
Instead you put the hash value of the password into the data base.
Now, every time someone want's to log in, using the password, you
create the hash value of the entered (plain text) password and
compare it to the hash value in the database. The two hash values
will be equal if the password entered by the user is equal to the
password which was originally hashed and put into the database.

I hope I made myself clear.
Sometimes I fail because of my dilettantish english

However - Hope that helps.
Regards,
- Thomas -
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are some classes in the library and many on the internet. Look around in the java.security and javax.crypto packages. Sorry to say I have no hands-on with any of this, but here's Another Ranch Thread that may help.
[ May 02, 2005: Message edited by: Stan James ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!