|
NameOpenXPKI::Password - password hashing and checkingDescriptionProvides utility functions for hashing passwords and checking passwords against a hashFunctionshash scheme, passwd, paramshashes a password according to the provided scheme.SCHEME is one of sha (SHA1), md5 (MD5), crypt (Unix crypt), smd5 (salted MD5), ssha (salted SHA1), ssha (salted SHA256) or argon2. It returns a hash in the format "{SCHEME}encrypted_string", or undef if no hash could be computed. For argon2 the return format is unencoded token generated by Crypt::Argon2 "$argon...". For all algorithms except argon2, params can be the encoded part of a prior call to hash which effectively extracts the salt from the given string which will result in the same encoded string if the same password was given. The default is to create a random salt of suitable size. For argon2 params must be a hashref with the following options, options are passed as-is to Crypt::Argon2::argon2id_pass, details on the options can be found there.
checkchecks if a password matches the provided digest.The digest must have the format: "{SCHEME}encrypted_string" or must start with $argon2 SCHEME is one of sha (SHA1), md5 (MD5), crypt (Unix crypt), smd5 (encrypted MD5) or ssha (encrypted SHA1). It returns 1 if the password matches the digest, 0 otherwise.
Visit the GSP FreeBSD Man Page Interface. |