Check password quality with Perl
When you manage some serious system where users can change their passwords you’ll face with problem of quality of those passwords. There is a Perl module – Data::Password, which may do all work to check user passwords: length or the number of character groups. Also, it’s possible to make more complicated checking: the password does not contain the same chars repeatedly or ascending or descending characters, or charcters close to each other in the keyboard. You can use system dictionary files (/usr/share/dict/words for Fedora Core 5, for example) or create you own. The module has only two methods and six variable which can be imported into your script/module to customize checking. Here is a small example of using Data::Password:
use Data::Password qw(:all);
$DICTIONARY = 0;
$GROUPS = 0;
# Will print "Bad password - contains the word 'clear', only lowercase"
print IsBadPassword("clearant");