I am remaking a site that was built in RoR, I was wondering if anyone could help me with the SHA1 that they used to encrypt the passwords. How do I add the salt into the encryption in PHP? Here is the rails script:
def self.encrypt(password, salt)
Digest::SHA1.hexdigest("--#{salt}--#{password}--")
end
Here is my PHP:
class encryptPassword
{
public $pass;
function getEncryptedPw()
{
return sha1($this->pass);
}
}
Not sure how I add the salt in PHP so that the end result is the same as the one in the RoR script.