|
|
|
|
|
by CiPHPerCoder
3670 days ago
|
|
That question should never even need to be asked. The library you're using should take care of that for you. In PHP: $storeMe = password_hash($plaintext, PASSWORD_DEFAULT);
if (password_verify($plaintext, $storeMe)) {
// Logged in
}
The detail is totally abstracted away. All sane password hashing libraries offer this API.See: https://paragonie.com/blog/2016/02/how-safely-store-password... EDIT - CANNOT REPLY: > One major failure of this article:
>
> You should generate a random salt for each user and store it alongside the user
> record in the DB.
No, you shouldn't. Your library should do that for you, and store it as a single string that's opaque to the developer. > I completely disagree. This implies that my DB ORM handles password stuff,
> which doesn't make sense.
See the passlib section: https://paragonie.com/blog/2016/02/how-safely-store-password... |
|
You should generate a random salt for each user and store it alongside the user record in the DB.