Created
June 28, 2013 01:39
-
-
Save ritou/5881834 to your computer and use it in GitHub Desktop.
Test result fot Data::Password module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Data::Password qw(:all); | |
$DICTIONARY = 8; | |
$FOLLOWING = 0; | |
$FOLLOWING_KEYBOARD = 0; | |
$GROUPS = 0; | |
$MINLEN = 8; | |
$MAXLEN = 64; | |
# http://www.blackout.org/articles-security/password-top100.html | |
my @bad_passwords = qw( | |
123456 | |
123456789 | |
password | |
romance | |
102030 | |
mystery | |
ajcuivd289 | |
shadow | |
tigger | |
123 | |
bookworm | |
dragon | |
sunshine | |
12345 | |
reader | |
purple | |
maggie | |
reading | |
1234 | |
angels | |
peanut | |
vampire | |
booklover | |
12345678 | |
charlie | |
ginger | |
michael | |
pepper | |
unicorn | |
princess | |
writerspace | |
101010 | |
242424 | |
cookie | |
writer | |
1234567 | |
buster | |
hannah | |
matthew | |
bailey | |
123123 | |
library | |
010203 | |
butterfly | |
callie | |
flower | |
morgan | |
654321 | |
chocolate | |
121212 | |
amanda | |
samantha | |
summer | |
abc123 | |
andrew | |
bandit | |
daniel | |
joshua | |
junior | |
midnight | |
mother | |
taylor | |
winner | |
freedom | |
harley | |
hunter | |
peaches | |
poohbear | |
booboo | |
murphy | |
patrick | |
trustno1 | |
biteme | |
books1 | |
brandy | |
cricket | |
george | |
jasper | |
jessica | |
mickey | |
sophie | |
teddybear | |
ashley | |
babygirl | |
jennifer | |
muffin | |
pookie | |
rascal | |
smokey | |
dakota | |
goddess | |
jasmine | |
pandora | |
pumpkin | |
thomas | |
tucker | |
123321 | |
131313 | |
angel1 | |
coffee | |
); | |
my $is_bad = undef; | |
for ($DICTIONARY = 8; $DICTIONARY > 2; $DICTIONARY--) { | |
print "\$DICTIONARY : $DICTIONARY\n"; | |
foreach my $password ( @bad_passwords ){ | |
$is_bad = IsBadPassword($password); | |
unless ( $is_bad ) { | |
print $password." is not bad password\n"; | |
} | |
} | |
print "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$DICTIONARYの値を変更したときの結果を表示している。
最小文字列長を8に設定しているので、それより短いものは自動的にはじかれる。
$ perl bad_password_check.pl
$DICTIONARY : 8
123456789 is not bad password
ajcuivd289 is not bad password
12345678 is not bad password
writerspace is not bad password
poohbear is not bad password
trustno1 is not bad password
teddybear is not bad password
babygirl is not bad password
$DICTIONARY : 7
123456789 is not bad password
ajcuivd289 is not bad password
12345678 is not bad password
poohbear is not bad password
trustno1 is not bad password
teddybear is not bad password
babygirl is not bad password
$DICTIONARY : 6
123456789 is not bad password
ajcuivd289 is not bad password
12345678 is not bad password
poohbear is not bad password
trustno1 is not bad password
teddybear is not bad password
babygirl is not bad password
$DICTIONARY : 5
123456789 is not bad password
ajcuivd289 is not bad password
12345678 is not bad password
poohbear is not bad password
babygirl is not bad password
$DICTIONARY : 4
123456789 is not bad password
ajcuivd289 is not bad password
12345678 is not bad password
$DICTIONARY : 3
123456789 is not bad password
12345678 is not bad password