What I am trying to do is self explanatory: I get a "username" and a "password" set by a user, and try to encrypt it.
Here's what I've tried so far:
//Firstly i recieve user and pswd
$usua=SQLite3::escapeString($_POST['usuario']);
$psw=SQLite3::escapeString($_POST['psw']);
//Then i proceed to encrypt
$key = md5('firstWord');
$salt = md5('secondWord');
function hashword($string,$salt){
$string= crypt($string, '$1$'.$salt.'$');
}
$psw = hashword($psw, $salt);
Some how this code always returns the same result: "$1$7b77d82".
What's wrong?
How would you do this?
Should i use Bcrypt?
Clearly this process should return different values for each password used but it doesn't.