Secure password storage

前端 未结 7 952
别那么骄傲
别那么骄傲 2021-01-20 09:22

I\'m developing a web service where users must login. I will store user data in an SQL database and input/output via PHP. But I don\'t want to store it openly. How do I encr

7条回答
  •  梦谈多话
    2021-01-20 09:49

    You probably want to hash the password - not encrypt it. Check out SHA-1. Hashing means that you cannot retrieve the original data as you can with encryption. Instead what you do is hash the users input and compare it to the hash in the database to see if they've got the right password. Doing this increases security as if your database was ever compromised - a bunch of hashes are useless.

提交回复
热议问题