• Dear Guest, Please do NOT forget to join our JAVA JOBS (ONLY) FACEBOOK GROUP to be aware of latest JAVA openings, and you may also post any JAVA related queries/jobs.

How to Have my Password Encrypted in Java programming?

I just created user table to store user related details.
In user table I would like to save my registered users' password in a encrypted format.
can you guys anyone guide me how to get it done. Any reply will be greatly appreciated
Store only md5(Any encryption algorithm you prefer.Make sure that you use the same algorithm when validating the user also) of the password. Now when validating, find md5 of user entry and validate with the table value.
Yes you need to first convert the password string into MD5 format. You can also you SHA1, SHA encryption format to encrypt password. But MD5 is most commonly used encryption method for storing password in encrypted format.
You can convert the password into encryptted one by using MySQL's "MD5()" function.
For example your insert query will be
insert into user_table set name='name of the user',email='email address',password="MD5(password)"
Else you can create the encrypted password in your java program. Use the below link to convert your normal string to encrypted one.
MD5 in Java