Question:
Whats the best way to encrypt passwords in php programming?
Priya
2011-08-14 20:08:17 UTC
was thinking and searching about this topic all day I am just curious, If you know whats the best way to crypt information and still be able to decrypt them later own safely Please let me know And wouldn't other people be able to decrypt data just like I did ?
Three answers:
anonymous
2011-08-14 21:33:20 UTC
There are two algorithms for encryption md5 and sha but i think md5 is a good way to ecnrypt a password in php
?
2011-08-15 03:13:05 UTC
One of the common ways is to save the password as an MD5 hash. When the user submits their password you convert it to MD5 and compare it to the MD5 you have stored. It cannot be decrypted (for the most part) which is a good thing. You don't want to be able to see your user's passwords which is more secure.
Achilles
2011-08-15 03:16:54 UTC
The SHA1 hash is the better hash than the MD5 since it have less number of collisions. So it is more safer than MD5 hash. If you need more protection you can use a salt (randomly generated string) along with SHA1 hash along with SHA1 hash (I have used this method to my client websites). You can use PHP sha1() function



http://php.net/manual/en/function.sha1.php



if you want to get the SHA1 hash of a password



If you have any problem, just IM me.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...