• Post Reply Bookmark Topic Watch Topic
  • New Topic

Encryption

 
ajay solanki
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I made an application, now I am expanding that one.
I want that user password store in an encrypted form.

So please tell me how can I encrypte and decrypte a password in Jsp
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The API to perform encryption/decryption in Java is called JCE, and you find various links about it in the http://faq.javaranch.com/java/SecurityFaq

You should not stored encrypted passwords, though. Someone can still get at the encryption key and recover the passwords. The general practice is to store a hash or digest of the password, from which the original password can not be recovered. (Look for MessageDigest in that FAQ for some pointers on this.) If someone then tries to log in, you'd calculate the hash of the password they entered and compare that to the stored hash.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!