| 1 |
NAME |
| 2 |
Data::Password - Perl extension for assessing password quality. |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
use Data::Password qw(IsBadPassword); |
| 6 |
|
| 7 |
print IsBadPassword("clearant"); |
| 8 |
|
| 9 |
# Bad password - contains the word 'clear', only lowercase |
| 10 |
|
| 11 |
use Data::Password qw(:all); |
| 12 |
|
| 13 |
$DICTIONARY = 0; |
| 14 |
|
| 15 |
$GROUPS = 0; |
| 16 |
|
| 17 |
$SKIPCHAR = 0; |
| 18 |
|
| 19 |
print IsBadPassword("clearant"); |
| 20 |
|
| 21 |
DESCRIPTION |
| 22 |
This module checks potential passwords for crackability. It checks that |
| 23 |
the password is in the appropriate length, that it has enough character |
| 24 |
groups, that it does not contain the same characters repeatedly or |
| 25 |
ascending or descending characters, or charcters close to each other in |
| 26 |
the keyboard. It will also attempt to search the ispell word file for |
| 27 |
existance of whole words. The module's policies can be modified by |
| 28 |
changing its variables. (Check "VARIABLES"). For doing it, it is |
| 29 |
recommended to import the ':all' shortcut when requiring it: |
| 30 |
|
| 31 |
*use Data::Password qw(:all);* |
| 32 |
|
| 33 |
FUNCTIONS |
| 34 |
1 IsBadPassword(password) |
| 35 |
|
| 36 |
Returns undef if the password is ok, or a textual description of the |
| 37 |
fault if any. |
| 38 |
|
| 39 |
2 IsBadPasswordForUNIX(user, password) |
| 40 |
|
| 41 |
Performs two additional checks: compares the password against the |
| 42 |
login name and the "comment" (ie, real name) found on the user file. |
| 43 |
|
| 44 |
VARIABLES |
| 45 |
1 $DICTIONARY |
| 46 |
|
| 47 |
Minimal length for dictionary words that are not allowed to appear |
| 48 |
in the password. Set to false to disable dictionary check. |
| 49 |
|
| 50 |
2 $FOLLOWING |
| 51 |
|
| 52 |
Maximal length of characters in a row to allow if the same or |
| 53 |
following. If $FOLLOWING_KEYBOARD is true (default), the module will |
| 54 |
also check for alphabetical keys following, according to the English |
| 55 |
keyboard layout. Set $FOLLOWING to false to bypass this check. |
| 56 |
|
| 57 |
3 $GROUPS |
| 58 |
|
| 59 |
Groups of characters are lowercase letters, uppercase letters, |
| 60 |
digits and the rest of the allowed characters. Set $GROUPS to the |
| 61 |
number of minimal character groups a password is required to have. |
| 62 |
Setting to false or to 1 will bypass the check. |
| 63 |
|
| 64 |
4 $MINLEN |
| 65 |
|
| 66 |
$MAXLEN |
| 67 |
|
| 68 |
Minimum and maximum length of a password. Both can be set to false. |
| 69 |
|
| 70 |
5 @DICTIONARIES |
| 71 |
|
| 72 |
Location where we are looking for dictionary files. You may want to |
| 73 |
set this variable if you are using not *NIX like operating system. |
| 74 |
|
| 75 |
6 $SKIPCHAR |
| 76 |
|
| 77 |
Set $SKIPCHAR to 1 to skip checking for bad characters. |
| 78 |
|
| 79 |
7 $BADCHARS |
| 80 |
|
| 81 |
Prohibit a specific character range. Excluded character range |
| 82 |
regualr experssion is expect. (You may use ^ to allow specific |
| 83 |
range) Default value is: '\0-\x1F\x7F' For ASCII only set value |
| 84 |
$BADCHARS = '^\x20-\x7F'; Force numbers and upper case only |
| 85 |
$BADCHARS = '^A-Z1-9'; |
| 86 |
|
| 87 |
FILES |
| 88 |
* /usr/dict/web2 |
| 89 |
|
| 90 |
* /usr/dict/words |
| 91 |
|
| 92 |
* /etc/passwd |
| 93 |
|
| 94 |
SEE ALSO |
| 95 |
See Data::Password::BasicCheck if you need only basic password checking. |
| 96 |
Other modules Data::Password::Common, Data::Password::Check, |
| 97 |
Data::Password::Meter, Data::Password::Entropy and |
| 98 |
String::Validator::Password |
| 99 |
|
| 100 |
AUTHOR |
| 101 |
Ariel Brosh (RIP), January 2002. |
| 102 |
|
| 103 |
Oded S. Resnik, from April 2004. |
| 104 |
|
| 105 |
COPYRIGHT |
| 106 |
Copyright (c) 2001 - 2014 Raz Information Systems Ltd. |
| 107 |
<http://www.raz.co.il/> |
| 108 |
|
| 109 |
This package is distributed under the same terms as Perl itself, see the |
| 110 |
Artistic License on Perl's home page. |
| 111 |
|