Password(3pm)
β¨ Password(3pm) β the Data::Password era β¨
okay bestie, sit down, we're talking about Data::Password, the Perl extension that sniffs your passwords and tells you, in the gentlest possible terms, that they're Giving Nothing. π«Ά it lives in the User Contributed Perl Documentation corner of the perl universe, and it's here to vibe-check your password quality. π
πΈ NAME πΈ
Data::Password β a Perl extension for assessing password quality. that's it, that's the whole job. π₯
π SYNOPSIS π
use Data::Password qw(IsBadPassword);
print IsBadPassword("clearant");
# Bad password - contains the word 'clear', only lowercase
use Data::Password qw(:all);
$DICTIONARY = 0;
$GROUPS = 0;
$SKIPCHAR = 0;
print IsBadPassword("clearant");
yes bestie, those$DICTIONARY,$GROUPSand$SKIPCHARlines are the "let me turn off the vibes detector" arc. keep reading. π
π¦ DESCRIPTION π¦
so this module checks potential passwords for crackability. like, it's the friend who reads your password out loud and goes "ma'am." π
here's what it's actually doing:
- it checks that the password is in the appropriate length
- it checks that it has enough character groups
- it checks that it does not contain the same characters repeatedly
- it checks that it does not contain ascending or descending characters
- it checks that it does not contain characters close to each other in the keyboard
- and it will also attempt to search the ispell word file for the existence of whole words
the module's policies can be modified by changing its variables β go peek at VARIABLES for that. π
and for doing that, it is recommended that you import the ':all' shortcut when you require it:
use Data::Password qw(:all);
periodt. π
π FUNCTIONS π
IsBadPassword(password)
returns undef if the password is ok β icon behaviour, we love β or a textual description of the fault if there is any. ngl that's main character energy: either silence or a read. π
IsBadPasswordForUNIX(user, password)
performs two additional checks: it compares the password against the login name and the "comment" (ie, real name) found on the user file. so like, you can't just be your own government name with a 1 at the end. caught. π
π VARIABLES π
$DICTIONARY
minimal length for dictionary words that are not allowed to appear in the password. set it to false to disable the dictionary check entirely, no cap. π«
$FOLLOWING
maximal length of characters in a row to allow if the same or following. if $FOLLOWING_KEYBOARD is true (which it is by default, bestie), the module will also check for alphabetical keys following, according to the English keyboard layout. β¨οΈ set $FOLLOWING to false to bypass this check. bye qwerty. π
$GROUPS
groups of characters are: lowercase letters, uppercase letters, digits, and the rest of the allowed characters. set $GROUPS to the number of minimal character groups a password is required to have. setting it to false or to 1 will bypass the check. so like, if you want a minimum of 3, say 3. slay.
$MINLENand$MAXLEN
minimum and maximum length of a password. both can be set to false β no gatekeeping here. β¨
@DICTIONARIES
location where we are looking for dictionary files. you may want to set this variable if you are using a not-*NIX-like operating system. π
$SKIPCHAR
set $SKIPCHAR to 1 to skip checking for bad characters. π
$BADCHARS
prohibit a specific character range. an excluded character range regular expression is expected. (you may use ^ to allow a specific range instead. yes the logic is flip-flopped, we don't make the rules.) π€‘
default value is:
'\0-\x1F\x7F'
for ASCII only, set the value to:
$BADCHARS = '^\x20-\x7F';
to force numbers and upper case only, set:
$BADCHARS = '^A-Z1-9';
π FILES π
/usr/share/dict/web2/usr/share/dict/words/etc/passwd
these are the little spots it goes snooping around in. π
π SEE ALSO π
see Data::Password::BasicCheck if you need only basic password checking β lowkey a whole mood, less drama, same energy. π
other modules, if you want the extended cinematic universe: Data::Password::Common, Data::Password::Check, Data::Password::Meter, Data::Password::Entropy and String::Validator::Password. π₯
π§ AUTHOR π§
Ariel Brosh (RIP), January 2002. ποΈ
Oded S. Resnik, from April 2004. β¨
π COPYRIGHT π
Copyright (c) 2001 - 2014 Raz Information Systems Ltd. <http://www.raz.co.il/>
This package is distributed under the same terms as Perl itself β see the Artistic License on Perl's home page. π
and that's the whole page, bestie. this one shipped as part of perl v5.36.0, dated 2022-10-15, filed under Password(3pm). go forth and make your passwords unrepeatable, ascending-free, descending-free, keyboard-adjacent-free, dictionary-free icons. π
β¨ππ¦
π¦ where this page comes from
- ubuntu noble: libdata-password-perl 1.12-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-password-perl 1.12-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-password-perl 1.12-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms