Created
November 20, 2020 22:54
-
-
Save Getup1/dca1c229ddac9e167b194008943ade60 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 python3 | |
def matcher(pattern): | |
def sieve(string): | |
if len(string) != len(pattern): | |
return False | |
matched = True | |
for a, b in zip(pattern, string): | |
if a != '*' and a != b: | |
matched = False | |
break | |
return matched | |
return sieve | |
p1 = ["the", "if", "of", "as", "in", "a", "you", "from", "to", "an", "too", "little", "snow", "dead", "drunk", "rosebud", "duck", "al", "le"] | |
p2 = ["diamond", "beer", "mushroom", "assistant", "clown", "captain", "twinkie", "security", "nuke", "small", "big", "escape", "yellow", "gloves", "monkey", "engine", "nuclear", "ai"] | |
p3 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] | |
allCombs = [ | |
q1 + q2 + q3 | |
for q1 in p1 | |
for q2 in p2 | |
for q3 in p3 | |
] | |
while len(allCombs) > 1: | |
pattern = input("Input pattern: ") | |
allCombs = list(filter(matcher(pattern), allCombs)) | |
print(f"Matching passwords: {len(allCombs)}") | |
print(allCombs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment