PHP salt and hash SHA256 for login password

后端 未结 6 2311
南方客
南方客 2020-12-23 17:19

I\'ve made encrypting of the password in my register script and they are stored in the database, and I have to use them to login, so I would want to use the unencrypted ones

6条回答
  •  没有蜡笔的小新
    2020-12-23 18:19

    You couldn't login because you did't get proper solt text at login time. There are two options, first is define static salt, second is if you want create dynamic salt than you have to store the salt somewhere (means in database) with associate with user. Than you concatenate user solt+password_hash string now with this you fire query with username in your database table.

提交回复
热议问题