Atk 4.3 Authen custom login fail

Cannot login, the hash value are difference
my code

Frontend:
$auth->usePasswordEncryption(‘sha256/salt’);

Login:
$form->app->auth->verifyCredentials($form[‘email’], $form[‘password’]));

Register:
$enc = $this->app->auth->encryptPassword($p, $m);

I recommend not to use any argument for usePasswordEncryption.

Also you do not need to manually encrypt password, because it will be encrypted by model anyway. Try

$enc = $p

More info: http://book.agiletoolkit.org/controller/auth.html#password-encryption

Thanks for info
$this->app->auth->addEncryptionHook($m);