.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Password 3pm" .TH Password 3pm "2022-10-15" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Data::Password \- Perl extension for assessing password quality. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Data::Password qw(IsBadPassword); \& \& print IsBadPassword("clearant"); \& \& # Bad password \- contains the word \*(Aqclear\*(Aq, only lowercase \& \& use Data::Password qw(:all); \& \& $DICTIONARY = 0; \& \& $GROUPS = 0; \& \& $SKIPCHAR = 0; \& \& print IsBadPassword("clearant"); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module checks potential passwords for crackability. It checks that the password is in the appropriate length, that it has enough character groups, that it does not contain the same characters repeatedly or ascending or descending characters, or charcters close to each other in the keyboard. It will also attempt to search the ispell word file for existance of whole words. The module's policies can be modified by changing its variables. (Check \*(L"\s-1VARIABLES\*(R"\s0). For doing it, it is recommended to import the ':all' shortcut when requiring it: .PP \&\fIuse Data::Password qw(:all);\fR .SH "FUNCTIONS" .IX Header "FUNCTIONS" .IP "1." 4 IsBadPassword(password) .Sp Returns undef if the password is ok, or a textual description of the fault if any. .IP "2." 4 IsBadPasswordForUNIX(user, password) .Sp Performs two additional checks: compares the password against the login name and the \*(L"comment\*(R" (ie, real name) found on the user file. .SH "VARIABLES" .IX Header "VARIABLES" .IP "1." 4 \&\f(CW$DICTIONARY\fR .Sp Minimal length for dictionary words that are not allowed to appear in the password. Set to false to disable dictionary check. .IP "2." 4 \&\f(CW$FOLLOWING\fR .Sp Maximal length of characters in a row to allow if the same or following. If \f(CW$FOLLOWING_KEYBOARD\fR is true (default), the module will also check for alphabetical keys following, according to the English keyboard layout. Set \f(CW$FOLLOWING\fR to false to bypass this check. .IP "3." 4 \&\f(CW$GROUPS\fR .Sp Groups of characters are lowercase letters, uppercase letters, digits and the rest of the allowed characters. Set \f(CW$GROUPS\fR to the number of minimal character groups a password is required to have. Setting to false or to 1 will bypass the check. .IP "4." 4 \&\f(CW$MINLEN\fR .Sp \&\f(CW$MAXLEN\fR .Sp Minimum and maximum length of a password. Both can be set to false. .IP "5." 4 \&\f(CW@DICTIONARIES\fR .Sp Location where we are looking for dictionary files. You may want to set this variable if you are using not *NIX like operating system. .IP "6." 4 \&\f(CW$SKIPCHAR\fR .Sp Set \f(CW$SKIPCHAR\fR to 1 to skip checking for bad characters. .IP "7." 4 \&\f(CW$BADCHARS\fR .Sp Prohibit a specific character range. Excluded character range regualr experssion is expect. (You may use ^ to allow specific range) Default value is: '\e0\-\ex1F\ex7F' For \s-1ASCII\s0 only set value \f(CW$BADCHARS\fR = '^\ex20\-\ex7F'; Force numbers and upper case only \f(CW$BADCHARS\fR = '^A\-Z1\-9'; .SH "FILES" .IX Header "FILES" .IP "\(bu" 4 /usr/share/dict/web2 .IP "\(bu" 4 /usr/share/dict/words .IP "\(bu" 4 /etc/passwd .SH "SEE ALSO" .IX Header "SEE ALSO" See Data::Password::BasicCheck if you need only basic password checking. Other modules Data::Password::Common, Data::Password::Check, Data::Password::Meter, Data::Password::Entropy and String::Validator::Password .SH "AUTHOR" .IX Header "AUTHOR" Ariel Brosh (\s-1RIP\s0), January 2002. .PP Oded S. Resnik, from April 2004. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2001 \- 2014 Raz Information Systems Ltd. .PP This package is distributed under the same terms as Perl itself, see the Artistic License on Perl's home page.