Data::Password::Filter - Interface to the password filter.
Version 0.04
The module is a simple attempt to convert an article written by Christopher Frenz on the topic "The Development of a Perl-based Password Complexity Filter". However I took the liberty to add my flavour on top of it.
http://perl.sys-con.com/node/1911661
Below is the list parameters that can be passed to the constructor. None of the parameters are mandatory. The format of user dictionary should be one word perl line. It only uses the word longer than 3 characters from the user dictionary, if supplied.
+-----------------------+----------------------------------------------------------------+ | Key | Description | +-----------------------+----------------------------------------------------------------+ | length | Length of the password. Default is 8. | | min_lowercase_letter | Minimum number of alphabets (a..z) in lowercase. Default is 1. | | min_uppercase_letter | Minimum number of alphabets (A..Z) in uppercase. Default is 1. | | min_special_character | Minimum number of special characters. Default is 1. | | min_digit | Minimum number of digits (0..9). Default is 1. | | check_variation | 1 or 0, depending whether checking variation. Default is 1. | | check_dictionary | 1 or 0, depending whether checking dictionary. Default is 1. | | user_dictionary | User supplied dictionary file location. Default use its own. | +-----------------------+----------------------------------------------------------------+
Currently considers the following characters as special:
! " # $ % & ' ( \ | ) ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
Returns the strength of the given password.
+----------------+------------+ | Score (s) | Strength | +----------------+------------+ | s <= 50% | Very weak. | | 50% < s <= 70% | Weak. | | 70% < s <= 90% | Good. | | s > 90% | Very good. | +----------------+------------+ use strict; use warnings; use Data::Password::Filter; my $password = Data::Password::Filter->new(); print "Strength: " . $password->strength('Ab12345?') . "\n";
Returns the score (percentage) of the given password or the previous password for which the strength has been calculated.
use strict; use warnings; use Data::Password::Filter; my ($password); $password = Data::Password::Filter->new(); print "Score: " . $password->score('Ab12345?') . "\n"; $password = Data::Password::Filter->new(); print "Strength: " . $password->strength('Ab54321?') . "\n"; print "Score: " . $password->score() . "\n";
Returns the filter detail.
use strict; use warnings; use Data::Password::Filter; my $password = Data::Password::Filter->new(); print "Strength: " . $password->strength('Ab12345?') . "\n"; print "Score: " . $password->score('Ab12345?') . "\n"; print $password->as_string() . "\n";
Mohammad S Anwar, <mohammad.anwar at yahoo.com>
<mohammad.anwar at yahoo.com>
Please report any bugs or feature requests to bug-data-password-filter at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-Password-Filter. I will be notified and then you'll automatically be notified of progress on your bug as I make changes.
bug-data-password-filter at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Data::Password::Filter
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Password-Filter
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Data-Password-Filter
CPAN Ratings
http://cpanratings.perl.org/d/Data-Password-Filter
Search CPAN
http://search.cpan.org/dist/Data-Password-Filter/
Christopher Frenz, author of "Visual Basic and Visual Basic .NET for Scientists and Engineers" (Apress) and "Pro Perl Parsing" (Apress).
Copyright 2011 Mohammad S Anwar.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install Data::Password::Filter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Password::Filter
CPAN shell
perl -MCPAN -e shell install Data::Password::Filter
For more information on module installation, please visit the detailed CPAN module installation guide.