CakePHP 3中此代码有什么问题?
crypt函数没问题,但是当我尝试解密密码时,它返回false。
public function beforeSave($event){
if(isset($event->data['entity']["password"])){
$event->data['entity']["password"] = Security::encrypt($event->data['entity']["password"], Security::salt());
}
}
public function readPassword($pass){
$result = Security::decrypt($pass, Security::salt());
echo $result;
die();
}