How to Have my Password Encrypted in Java programming?

Discussion in 'Strings, I/O, Formatting, Parsing' started by evanwebwills, Apr 22, 2011.

  1. evanwebwills

    evanwebwills New Member

    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
     
  2. pnranjith

    pnranjith New Member

    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.
     
  3. vinoth.t

    vinoth.t New Member

    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
    Code:
    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
     

Share This Page