Best way encrypt password php (in 2017) [duplicate]

痞子三分冷 提交于 2019-12-20 09:49:04

问题


In my website I use md5 to crypt password user in my database (and store session user)

$pswUser = md5($_POST["password"]);

But I have just been told that this way of encrypting has become obsolete

I did some research to find out how to do it but most of the posts dates from two or three years ago So what is the best way to encrypt password in 2017 ?

Thank you

Isn't duplicate discussion ... Secure hash and salt for PHP passwords => 2009 ...


回答1:


The password hash function in combination with password verify

https://secure.php.net/manual/en/function.password-hash.php https://secure.php.net/manual/en/function.password-verify.php



来源:https://stackoverflow.com/questions/43864379/best-way-encrypt-password-php-in-2017

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!