Last active
June 11, 2016 19:43
-
-
Save rinchik/66702245a0f79ff4fbe731748269b275 to your computer and use it in GitHub Desktop.
Python string permutations to generate all possible password variations with given length and known characters
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
from datetime import datetime | |
startTime = datetime.now() | |
password = "abba" | |
character_list = 'abcdefghijklmnopqrstuvwxyz' | |
a = [] | |
for current in xrange(len(password)): | |
a = [i for i in character_list] | |
for y in xrange(current): | |
a = [x+i for i in character_list for x in a] | |
print "We generated all possible passwords in", datetime.now() - startTime | |
print "Our password is", a.index(password), "in the list of all passwords" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment