Created
August 19, 2014 17:15
-
-
Save szczys/16d1a7f74562df77bcde to your computer and use it in GitHub Desktop.
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
namesFile = '/home/mike/Desktop/hgttg.txt' | |
easyPass = 'ilovehackaday' | |
hardCount = 10 | |
import random | |
import string | |
complexityLimit = 3 | |
with open(namesFile, 'r') as f: | |
names = f.read().split('\n') | |
for item in names: | |
if item != '': | |
length = random.randint(5,7) | |
complexity = random.randint(0,complexityLimit) | |
charset = '' | |
if complexity == 3: | |
if hardCount == 10: | |
hardCount = hardCount-1 | |
#Insert the easyPass the first time we hit this complexity | |
print item + ";" + easyPass | |
continue | |
else: | |
length = 10 | |
charset = string.digits + string.ascii_letters + '!@#$%^&*()' | |
hardCount = hardCount-1 | |
if (hardCount < 1): | |
#stop adding hard passwords so we don't get too many | |
complexityLimit = 2 | |
elif complexity == 2: | |
charset = string.ascii_lowercase + string.digits + '!@#$%^&*()' | |
elif complexity == 1: | |
charset = string.ascii_lowercase + string.digits | |
else: | |
charset = string.ascii_lowercase | |
print item + ';' + ''.join(random.choice(string.ascii_lowercase + string.digits) for i in range(length)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment