Crypt::Password::Util - Crypt password utilities
This document describes version 0.10 of Crypt::Password::Util (from Perl distribution Crypt-Password-Util), released on 2015-01-25.
use Crypt::Password::Util qw(crypt_type looks_like_crypt crypt); say crypt_type('62F4a6/89.12z'); # CRYPT say crypt_type('$1$$...'); # MD5-CRYPT say crypt_type('$apr1$4DdvgCFk$...'); # MD5-CRYPT say crypt_type('$5$4DdvgCFk$...'); # SSHA256 say crypt_type('$6$4DdvgCFk$...'); # SSHA512 say crypt_type('1a1dc91c907325c69271ddf0c944bc72'); # PLAIN-MD5 say crypt_type('foo'); # undef say looks_like_crypt('62F4a6/89.12z'); # 1 say looks_like_crypt('foo'); # 0 say crypt('pass'); # automatically choose the appropriate type and salt
Return crypt type, or undef if
$str does not look like a crypted password. Currently known types:
Passphrase scheme based on Blowfish, designed by Niels Provos and David Mazieres for OpenBSD.
Recognized by: $2$ or $2a$header followed by 22 base64-digits salt and 31 digits hash.
Traditional DES crypt.
Recognized by: 11 digit base64 characters.
A baroque passphrase scheme based on MD5, designed by Poul-Henning Kamp and originally implemented in FreeBSD.
Recognized by: $1$ or $apr1$ header.
Unsalted MD5 hash, popular with PHP web applications.
Recognized by: 32 digits of hex characters.
Salted SHA256, supported by glibc 2.7+.
Recognized by: $5$ header.
Salted SHA512, supported by glibc 2.7+.
Recognized by: $6$ header.
Return true if
$str looks like a crypted password.
Like Perl's crypt(), but automatically choose the appropriate crypt type and random salt. Will first choose SSHA512 with 64-bit random salt. If not supported by system, fall back to MD5-CRYPT with 32-bit random salt. If that is not supported, fall back to CRYPT.
Authen::Passphrase which recognizes more encodings (but currently not SSHA256 and SSHA512).
Please visit the project's homepage at https://metacpan.org/release/Crypt-Password-Util.
Source repository is at https://github.com/perlancar/perl-Crypt-Password-Util.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Crypt-Password-Util
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
This software is copyright (c) 2015 by firstname.lastname@example.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.