Created
November 16, 2016 21:11
-
-
Save Arsh25/f8176e8f4de2a8178a4588098ac61e7a 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
#!/usr/bin/env python | |
import itertools | |
import os | |
def generate_list(lang,max_len): | |
words = [] | |
for length in range(1,max_len+1): | |
perms = itertools.product(lang,repeat=length) | |
for word in perms: | |
password = ''.join(word) | |
words.append(password) | |
return words | |
if __name__ == '__main__': | |
words = generate_list("abcd",3) | |
#words = generate_list("abcdefghijklmnopqrstuvwxyz",7) | |
with open('passwords.txt','w') as password_file: | |
for word in words: | |
password_file.write(word+os.linesep) | |
print ("Done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment