Going from unsalted to salted MD5 passwords

后端 未结 12 977
臣服心动
臣服心动 2021-02-07 02:56

I have a LAMP (PHP) website which is becoming popular.

I played it safe by storing the user passwords as md5 hashes.

But I now see that\'s not secure; I should h

12条回答
  •  不要未来只要你来
    2021-02-07 03:56

    You can do a "2 step hashing" instead of creating a hash in a single step.

    You could append each password hash to the username, and then hash it again. This will create an undecryptable hash thats salted with unique informations.

    The usual process of salting is

    salt+PWD -> hash

    You could do something like: PWD -> Hash -> UserID+Hash -> Hash

    (Note the UserID was only picked so a unique salt for each double hash exists... Feel free to make your salt more complex)

提交回复
热议问题