added passwords file

This commit is contained in:
Josh d'Entremont 2015-05-31 16:14:20 -03:00
parent 83d7c31c6e
commit 897faec917
2 changed files with 50 additions and 12 deletions

View file

@ -60,18 +60,16 @@ def getPasswords():
""" """
Returns an array of strings to be used as the password and the decoys Returns an array of strings to be used as the password and the decoys
""" """
# temporarily hard coded for testing groups = []
#TODO - move the passwords out of this file and add more arrays # read from passwords.txt
passwords = [ with open("passwords.txt") as pwfile:
'FEVER', for line in pwfile:
'SEVER', if not line.strip():
'SEWER', groups.append([])
'SEVEN', elif len(groups) > 0:
'ROVER', groups[len(groups) - 1].append(line[:-1])
'ERROR',
'HELLO', passwords = groups[random.randint(0, len(groups) - 1)]
'BOXER'
]
random.shuffle(passwords) random.shuffle(passwords)
return passwords return passwords

40
passwords.txt Normal file
View file

@ -0,0 +1,40 @@
# The login program will read groups of passwords from this file and
pick one at random. It ignores any lines until the first blank line,
and then reads all passwords as one group until another blank line
or the end of the file is found.
# Make sure there is exactly one blank line before EVERY group of
passwords, including the first group.
FEVER
SEVER
SEWER
SEVEN
ROVER
ERROR
HELLO
BOXER
NUMBERS
DOLLARS
POPULAR
ROBBERS
NOURISH
CLEANSE
GROUPED
GAINING
WASTING
DUSTERS
LETTING
ENDINGS
FERTILE
SEEKING
CERTAIN
BANDITS
STATING
WANTING
PARTIES
WAITING
STATION
MALTASE
MONSTER