/** * Checks encryption type for given string. We need this for the MD5 * migration of passwords from old phpMyFAQ installations to new ones * with a salt. * * @param string $encryptedPassword Encrypted password * @param string $clearPassword Clear Password * * @return boolean */ public function checkEncryptedPassword($encryptedPassword, $clearPassword) { $encTypes = array('crypt', 'md5', 'sha'); foreach ($encTypes as $encType) { if ($encryptedPassword === PMF_Enc::selectEnc($encType, $this->_config)->encrypt($clearPassword)) { return true; } } return false; }
/** * instantiates a new encryption object, stores it in a private container * returns it. * * This method instantiates a new Enc object by calling the static * method. The specified encryption method enctype is passed to * The result is stored in the private container variable enc_container and * * @param string $enctype encryption type * @return PMF_User */ public function selectEncType($enctype) { $this->enc_container = PMF_Enc::selectEnc($enctype); return $this->enc_container; }