[Koha] Password, hash, bcrypt

Jonathan Druart jonathan.druart at bugs.koha-community.org
Fri Feb 21 21:57:49 NZDT 2020


Hello Rob,

Here is what you were looking for:

use Modern::Perl;
use Koha::AuthUtils;
use C4::Auth;
# Generate the hash
my $hashed_pwd = Koha::AuthUtils::hash_password('Your password');
# Compare it with a new login
my $login_pwd = 'Your password';
say C4::Auth::checkpw_hash( $login_pwd, $hashed_pwd );
my $wrong_pwd = 'wrong';
say C4::Auth::checkpw_hash( $wrong_pwd, $hashed_pwd );

Regards,
Jonathan

Le jeu. 20 févr. 2020 à 20:06, robm <robmietto at gmail.com> a écrit :
>
> Oooooooooooooooo!!!
>
> I found it!
>
> PHP has a function: password_verify() to this job!! A piace of a cake! ;-)
>
> Regards!!
>
> rob
>
>
>
> --
> Sent from: http://koha.1045719.n5.nabble.com/Koha-general-f3047918.html
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> https://lists.katipo.co.nz/mailman/listinfo/koha


More information about the Koha mailing list