|
NAMECrypt::Bcrypt - A modern bcrypt implementationVERSIONversion 0.007SYNOPSISuse Crypt::Bcrypt qw/bcrypt bcrypt_check/; my $hash = bcrypt($password, '2b', 12, $salt); if (bcrypt_check($password, $hash)) { ... } DESCRIPTIONThis module provides a modern and user-friendly implementation of the bcrypt password hash.Note that in bcrypt passwords may only contain 72 characters. It may seem tempting to prehash the password before bcrypting it but that may make it vulnerable to password shucking, a salted solution (for example using a MAC) should be used instead if one wants to support large passwords. The password is always expected to come as a (utf8-encoded) byte-string. FUNCTIONSbcrypt($password, $subtype, $cost, $salt)This computes the bcrypt hash for $password in $subtype, with $cost and $salt.Valid subtypes are:
$cost must be between 5 and 31 (inclusive). $salt must be exactly 16 bytes. bcrypt_check($password, $hash)This checks if the $password satisfies the $hash, and does so in a timing-safe manner.SEE OTHER
AUTHORLeon Timmermans <leont@cpan.org>COPYRIGHT AND LICENSEThis software is copyright (c) 2021 by Leon Timmermans.This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Visit the GSP FreeBSD Man Page Interface. |