NAME

Crypt::Password::Util - Crypt password utilities

VERSION

version 0.04

SYNOPSIS

use Crypt::Password::Util qw(crypt_type looks_like_crypt);

say crypt_type('62F4a6/89.12z');                    # CRYPT (13 base64 digits)
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

FUNCTIONS

crypt_type($str) => STR

Return crypt type, or undef if $str does not look like a crypted password. Currently known types: CRYPT (traditional DES crypt), MD5-CRYPT (including Apache variant), SSHA256 (salted SHA256), SSHA512 (salted SHA512), and PLAIN-MD5.

looks_like_crypt($str) => BOOL

Return true if $str looks like a crypted password. It is

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.