{"action":"opened","issue":{"url":"https://api.github.com/repos/HGustavs/LenaSYS/issues/1964","repository_url":"https://api.github.com/repos/HGustavs/LenaSYS","labels_url":"https://api.github.com/repos/HGustavs/LenaSYS/issues/1964/labels{/name}","comments_url":"https://api.github.com/repos/HGustavs/LenaSYS/issues/1964/comments","events_url":"https://api.github.com/repos/HGustavs/LenaSYS/issues/1964/events","html_url":"https://github.com/HGustavs/LenaSYS/issues/1964","id":145599181,"number":1964,"title":"PHP's password_hash function should be used instead of MySQL \"password()\"","user":{"login":"b14davbo","id":18139533,"avatar_url":"https://avatars.githubusercontent.com/u/18139533?v=3","gravatar_id":"","url":"https://api.github.com/users/b14davbo","html_url":"https://github.com/b14davbo","followers_url":"https://api.github.com/users/b14davbo/followers","following_url":"https://api.github.com/users/b14davbo/following{/other_user}","gists_url":"https://api.github.com/users/b14davbo/gists{/gist_id}","starred_url":"https://api.github.com/users/b14davbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b14davbo/subscriptions","organizations_url":"https://api.github.com/users/b14davbo/orgs","repos_url":"https://api.github.com/users/b14davbo/repos","events_url":"https://api.github.com/users/b14davbo/events{/privacy}","received_events_url":"https://api.github.com/users/b14davbo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-04T06:45:44Z","updated_at":"2016-04-04T06:45:44Z","closed_at":null,"body":"When creating a new account, logging in, resetting password etc, we should be using PHP's native password hashing function, see [http://php.net/manual/en/function.password-hash.php](url).\r\n\r\nSimple code snippet on how to use\r\n```php\r\n// get password from post\r\n$password = $_POST[\"password\"];\r\n\r\n// hash the password\r\n$user_password = password_hash($password, PASSWORD_DEFAULT);\r\n```\r\nRight now, we're using MySQL password() function which is deprecated as of MySQL 5.7.6.\r\n[http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html#function_password](url)"}}