Created
January 24, 2016 16:20
-
-
Save Jackdod/61a9d7a8b664de8c270a 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/python | |
from itertools import permutations | |
from itertools import product | |
def leet2(): | |
leetout = [] | |
for c in "".join(p): | |
if leet.has_key(c): | |
leetout += [leet[c]] | |
else: | |
leetout += [c] | |
for t in product(*leetout): | |
wordlist = open("leet.txt", "a") | |
wordlist.write("".join(t)) | |
wordlist.write("\n") | |
wordlist.close() | |
# print "".join(t) | |
return | |
def capitalize(): | |
leetout = [] | |
for c in "".join(p): | |
if capital.has_key(c): | |
leetout += [capital[c]] | |
else: | |
leetout += [c] | |
for t in product(*leetout): | |
wordlist = open("capitalize.txt", "a") | |
wordlist.write("".join(t)) | |
wordlist.write("\n") | |
wordlist.close() | |
# print "".join(t) | |
return | |
capital = { | |
"a" : ["a","A"], | |
"b" : ["b","B"], | |
"c" : ["c","C"], | |
"d" : ["d","D"], | |
"e" : ["e","E"], | |
"f" : ["f","F"], | |
"g" : ["g","G"], | |
"h" : ["h","H"], | |
"i" : ["i","I"], | |
"j" : ["j","J"], | |
"k" : ["k","K"], | |
"l" : ["l","L"], | |
"m" : ["m","M"], | |
"n" : ["n","N"], | |
"o" : ["o","O"], | |
"p" : ["p","P"], | |
"q" : ["q","Q"], | |
"r" : ["r","R"], | |
"s" : ["s","S"], | |
"t" : ["t","T"], | |
"u" : ["u","U"], | |
"v" : ["v","V"], | |
"w" : ["w","W"], | |
"x" : ["x","X"], | |
"y" : ["y","Y"], | |
"z" : ["z","Z"], } | |
leet = { | |
"a" : ["a","A","@","4"], | |
"b" : ["b","B","8"], | |
"c" : ["c","C"], | |
"d" : ["d","D"], | |
"e" : ["e","E","3"], | |
"f" : ["f","F"], | |
"g" : ["g","G","9"], | |
"h" : ["h","H"], | |
"i" : ["i","I","1"], | |
"j" : ["j","J"], | |
"k" : ["k","K"], | |
"l" : ["l","L","!","1"], | |
"m" : ["m","M"], | |
"n" : ["n","N"], | |
"o" : ["o","O","0"], | |
"p" : ["p","P"], | |
"q" : ["q","Q"], | |
"r" : ["r","R"], | |
"s" : ["s","S","5","$"], | |
"t" : ["t","T","7"], | |
"u" : ["u","U"], | |
"v" : ["v","V"], | |
"w" : ["w","W"], | |
"x" : ["x","X"], | |
"y" : ["y","Y"], | |
"z" : ["z","Z","2"], | |
"1" : ["1","I","l"], | |
"2" : ["2","5"], | |
"3" : ["3","E"], | |
"4" : ["4","A"], | |
"5" : ["5","S"], | |
"6" : ["6","b"], | |
"7" : ["7","T"], | |
"8" : ["8","B"], | |
"9" : ["9","g","q"], | |
"0" : ["0","o","O"], } | |
xlist = [] | |
keywords = raw_input("give the keywords seperated by coma: ") | |
xlist = keywords.split(",") | |
m = input("give the minimum word lengh: ") | |
M = input("give the MAXIMUM word lengh: ") | |
multi = raw_input("want to multiple? ") | |
comb = raw_input("want to leet? ") | |
if multi == "y": | |
for n in range(1, len(xlist)+1): | |
for p in product(xlist, repeat=n): | |
if len("".join(p)) >= m and len("".join(p)) <= M: | |
if comb == "y": | |
leet2() | |
else: | |
capitalize() | |
else: | |
for n in range(1, len(xlist)+1): | |
for p in permutations(xlist, n): | |
if len("".join(p)) >= m and len("".join(p)) <= M: | |
if comb == "y": | |
leet2() | |
else: | |
capitalize() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment