How can I hash a password in Java?

前端 未结 13 2023
暖寄归人
暖寄归人 2020-11-22 05:00

I need to hash passwords for storage in a database. How can I do this in Java?

I was hoping to take the plain text password, add a random salt, then store the salt a

13条回答
  •  太阳男子
    2020-11-22 05:26

    Among all the standard hash schemes, LDAP ssha is the most secure one to use,

    http://www.openldap.org/faq/data/cache/347.html

    I would just follow the algorithms specified there and use MessageDigest to do the hash.

    You need to store the salt in your database as you suggested.

提交回复
热议问题