File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Security and the fly likes Encryption/Decryption of password Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "Encryption/Decryption of password" Watch "Encryption/Decryption of password" New topic

Encryption/Decryption of password

PRavi kumar
Ranch Hand

Joined: May 13, 2007
Posts: 69

I need to encrypt the password and store in oracle data base.

when you enter the password through I need to get the encrypted password from data base and decrypt and compare and for user login.

kindly let me know which is the best approch do this. kindly provide the sample programs how i can do.

Thanks in advance.

Pat Farrell

Joined: Aug 11, 2007
Posts: 4659

Don't do it that way.
what you want to do is push the password through a HMAC and store the results. Then when someone wants to login, get their password, push it through the same HMAC and compare the results.

A HMAC with SHA1 will do the job.
There are RFCs defining the standard way, and the java.crypto classes have the SHA code.
I agree. Here's the link:
subject: Encryption/Decryption of password
It's not a secret anymore!