Can someone point me to a good PHP/MySQL salted hashed password implementation?

后端 未结 8 735
感情败类
感情败类 2021-02-06 07:33

After reading about salts password hashing Id like to implement a simple version for an admin area to a site Im building.

If you have any good links with code that have

8条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-06 08:05

    I don't have a link to available code, but what I've done in the past is to generate a randomized salt - $salt = rand(1,1000000000); - and save it in a session. I pass that salt to a login page and then use JavaScript to create a SHA hash of the salt + password which is submitted rather than a plaintext password. Since the salt is stored in the session I can then use that to see if the login hash matches the salt + password hash stored in the db.

提交回复
热议问题