Mohammad S Anwar > Data-Password-Filter-0.05 > Data::Password::Filter

Download:
Data-Password-Filter-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.05   Source  

NAME ^

Data::Password::Filter - Interface to the password filter.

VERSION ^

Version 0.05

DESCRIPTION ^

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

CONSTRUCTOR ^

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.   |
    +-----------------------+----------------------------------------------------------------+

SPECIAL CHARACTERS ^

Currently considers the following characters as special:

    !   "   #   $   %   &   '   (   \   |   )
    )   *   +   ,   -   .   /   :   ;   <   =
    >   ?   @   [   \   ]   ^   _   `   {   |
    }   ~

METHODS ^

strength()

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";

score()

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";

as_string()

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";

AUTHOR ^

Mohammad S Anwar, <mohammad.anwar at yahoo.com>

BUGS ^

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.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Data::Password::Filter

You can also look for information at:

ACKNOWLEDGEMENT ^

Christopher Frenz, author of "Visual Basic and Visual Basic .NET for Scientists and Engineers" (Apress) and "Pro Perl Parsing" (Apress).

LICENSE AND COPYRIGHT ^

Copyright 2011-13 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.

DISCLAIMER ^

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.

syntax highlighting: