I am confuse of this two

Hi, can i ask what is the difference of this two,and which one should i use in my registration form to encrypt password…

sha2(‘$password’,256)

or

hash(‘sha256’,$password

Thank you in advance.

Use SHA-3 alternativelly, as it is much better and different as SHA-2 . Or md5 hash, as usually :slight_smile:

how do you retrieve the password using sha3 ? so that the user can log-in successfully.

:slight_smile:

jemz,

To compare a hash value, you must read hash the submitted password then compare that to the hashed value in the database. The whole objective is to NOT store the password.

Regards,

DK

You’d have sha-3 extension installed in php. Here’s the download page with instructions: https://github.com/strawbrary/php-sha3