0
How to encrypt (hashing) password in database.
how to save password in data base in encrypted form.in SQL server or my SQL
1 Resposta
+ 5
We don't encrypt passwords, the better way is to hash it, which is one way convert, no decryption is needed, so password recovery is not possible, hashed password can only be applied on comparing with the original password.
What we really need is salt and then hash the passwords, in order to secure them. Salt make simple password more complicated, it would ensure the simple passwords would not be hacked by brutal force.
In PHP,
$salted = "dDW3f5vuvt_randomString". $password. "F5gefg_randomString4tSfR" ;
$hashed_password = hash('sha512', $salted) ;
Check from Google to know more about salt and hash passwords.
http://php.net/manual/en/function.hash.php