public function checkRSAEncryptedPassword($encryptedPassword, $passwordHash, $salt, $fingerprint)
    {
        if ($fingerprint === null || !isset($this->keys[$fingerprint])) {
            throw new InvalidKeyPairIdException('Invalid keypair fingerprint given', 1233655216);
        }

        $decryptedPassword = $this->decryptWithPrivateKey($encryptedPassword, $this->keys[$fingerprint]['privateKey']);

        return ($passwordHash === md5(md5($decryptedPassword) . $salt));
    }
public function checkRSAEncryptedPassword($encryptedPassword, $passwordHash, $salt, $fingerprint)
    {
        if ($fingerprint === null || !isset($this->keys[$fingerprint])) {
            throw new InvalidKeyPairIdException('Invalid keypair fingerprint given', 1233655216);
        }

        $decryptedPassword = $this->decryptWithPrivateKey($encryptedPassword, $this->keys[$fingerprint]['privateKey']);

        return ($passwordHash === md5(md5($decryptedPassword) . $salt));
    }
public function checkRSAEncryptedPassword ( $ encryptedPassword , $ passwordHash , $ salt , $ fingerprint ) { if ( $ fingerprint === null || ! isset ( $ this -> keys [ $ fingerprint ] ) ) { throw new InvalidKeyPairIdException ( 'Invalid keypair fingerprint given' , 1233655216 ) ; } $ decryptedPassword = $ this -> decryptWithPrivateKey ( $ encryptedPassword , $ this -> keys [ $ fingerprint ] [ 'privateKey' ] ) ; return ( $ passwordHash === md5 ( md5 ( $ decryptedPassword ) . $ salt ) ) ; }
Checks if the given encrypted password is correct by
comparing it's md5 hash. The salt is appended to the decrypted password string before hashing.

@param string $encryptedPassword The received, RSA encrypted password to check
@param string $passwordHash The md5 hashed password string (md5(md5(password) . salt))
@param string $salt The salt used in the md5 password hash
@param string $fingerprint The fingerprint to identify the private key (RSA public key fingerprint)
@return boolean true if the password is correct
@throws InvalidKeyPairIdException If the given fingerprint identifies no valid keypair
Checks if the given encrypted password is correct by comparing it s md5 hash . The salt is appended to the decrypted password string before hashing .