Page 1 of 1

Re: Which function to encrypt / decrypt password

Posted: Thu Nov 01, 2012 1:59 am
by MeroD
http://www.php.net/manual/en/function.sha1.php

Or:

Code: Select all

<?php
$hashed_password = crypt('mypassword'); // let the salt be automatically generated

if (crypt($user_input, $hashed_password) == $hashed_password) {
   echo "Password verified!";
}
?>
http://php.net/manual/en/function.crypt.php

Re: Which function to encrypt / decrypt password

Posted: Fri Nov 02, 2012 9:32 am
by egami
md5 may also work for you.

php.net/md5

Re: Which function to encrypt / decrypt password

Posted: Fri Nov 02, 2012 2:10 pm
by seandisanti
Why does everyone want to be able to reverse passwords? One way encryption is all that is necessary, because there is never ever ever EVER a reason that you need to know another user's password. All you do by trying to have that functionality is set yourself up to be in a position of liability in the event that your data is compromised because of your insecure practices.
</rant>