How to encrypt (hashing) password in database. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to encrypt (hashing) password in database.

how to save password in data base in encrypted form.in SQL server or my SQL

21st Feb 2019, 3:04 PM
madhusudan bhat
madhusudan bhat - avatar
1 Answer
+ 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
21st Feb 2019, 4:00 PM
Calviղ
Calviղ - avatar