In my application, at the User registration time, i need to Encrypt the password field and then i like to store into the database.
After that the same user will be logging, at the moment the database password will decrypt and it will be compare to the User entering password.
Just highlighed the keywords you used it. I'm not into encryption/decryption but as Java reference state
Message digests are secure one-way hash functions that take arbitrary-sized data and output a fixed-length hash value.. So you can only encrypt, no reverse process. However there is no need for decryption as MessageDigest class provide
public static boolean isEqual(byte[] digesta, byte[] digestb).
Compares two digests for equality. Does a simple byte compare.
In login process take user entered password, encrypt it and compare with data from database. Problem solved...
Last edited by peter_budo; May 25th, 2007 at 6:54 am.
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 873
Code tags enforcer
Offline 6,656 posts
since Dec 2004