Best way to encode passwords in PHP

前端 未结 8 1690
死守一世寂寞
死守一世寂寞 2020-12-07 23:51

I currently use,
base64_encode() to encode a user\'s password, this works well because it allows me to simply use base64decode() to dec

8条回答
  •  心在旅途
    2020-12-08 00:20

    An absolute must-read on this topic is Jeff's own You're Probably Storing Passwords Incorrectly. Here's the executive summary:

    1. Do not invent your own "clever" password storage scheme.
    2. Never store passwords as plaintext.
    3. Add a long, unique random salt to each password you store.
    4. Use a cryptographically secure hash.

提交回复
热议问题