Crypt::Passphrase::Encoder - Base class for Crypt::Passphrase encoders
version 0.019
This is a base class for password encoders. It is a subclass of Crypt::Passphrase::Validator.
Crypt::Passphrase::Validator
It expects the subclass to implement the following four methods:
$encoder->hash_password($password)
This hashes a $password. Note that this will typically return a different value each time since it uses a unique salt every time.
$password
$encoder->verify_password($password, $hash)
This checks if a $password satisfies $hash.
$hash
$encoder->needs_rehash($hash)
This method will return true if the password hash needs a rehash. This may either mean it's using a different hashing algoritm, or because it's using different parameters.
$encoder->crypt_subtypes
This method returns the types of crypt entries this validator supports. This is used to implement accepts_hash.
accepts_hash
$encoder->recode_hash($hash)
It provides the following methods to aid in implementing encoders:
$encoder->random_bytes($count)
This is a utility method to aid in generating a good salt.
$encoder->secure_compare($left, $right)
This compares two strings in a way that resists timing attacks.
Leon Timmermans <fawaka@gmail.com>
This 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.
To install Crypt::Passphrase, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crypt::Passphrase
CPAN shell
perl -MCPAN -e shell install Crypt::Passphrase
For more information on module installation, please visit the detailed CPAN module installation guide.