How would you add salt to your existing password hashes?

前端 未结 8 1664
心在旅途
心在旅途 2021-02-08 06:08

I have a database of hashed passwords that had no salt added before they were hashed. I want to add salt to new passwords. Obviously I can\'t re-hash the existing ones.

<
8条回答
  •  时光说笑
    2021-02-08 06:37

    If you are storing the salt inside the hash, it should be fairly straight forward to determine if a salt is included by checking the length of the hash. If there isn't a salt, just hash the password, if there is a salt, hash the password + salt.

    You shouldn't need a boolean column in your database.

提交回复
热议问题