Hi, I've been reading up on using a salt value when creating a password to make it more secure, what I can't get my head round is how do you remember this salt value? I'm guessing that when a user logs in to be able to compare the password entered with the one in the database you would need to again add the salt value to the entered password. Am I missing something really obvious? Thanks in Advance
Hi, create function like this : public function calculateHash($password){ return md5($password . str_repeat('YOUR-SALT-HERE', 10)); } Code (markup): save result to db and when someone wants to login use : ... if ($row->password !== $this->calculateHash($password)) { echo "Bad password"; } ... Code (markup):
Great! I have using same generator.. the more complicated you create, the more secure your session login!