-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetWordList.py
More file actions
39 lines (30 loc) · 926 Bytes
/
getWordList.py
File metadata and controls
39 lines (30 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
f= open("wordlistByKshitij.txt","w+")
def generate(arr, i, s, len):
# base case
if (i == 0): # when len has
# been reached
# print it out
f.write("%s\n" % (s))
print(s)
return
# iterate through the array
for j in range(0, len):
# Create new string with
# next character Call
# generate again until
# string has reached its len
appended = s + arr[j]
generate(arr, i - 1, appended, len)
return
# function to generate
# all possible passwords
def crack(arr, len):
# call for all required lengths
for i in range(1 , len + 1):
generate(arr, i, "", len)
# Driver Code
#Enter alfabets seperated by comma enclosed by ''
arr = ['a', 'b', 'c', 'd']
len = len(arr)
crack(arr, len)
f.close()