-
Notifications
You must be signed in to change notification settings - Fork 0
/
passwordCracking0.py
94 lines (77 loc) · 2.65 KB
/
passwordCracking0.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# password carching method - 0
import random
import hashlib
import pyttsx3
import pyautogui
engine = pyttsx3.init()
def speak(text):
print(text)
engine.say(text)
engine.runAndWait()
engine.stop()
chars = '\'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890qwertyuiopasdfghjklzxcv"bnm_!@#$%^&*()-=+<>,./?}][{\|'
insta_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-'
numbers = '1234567890'
chartype = input("Enter i for insta password: ")
if chartype == "i" or chartype == "I":
allchars = list(insta_chars)
else:
allchars = list(chars)
allnumbers = list(numbers)
hashed = input("Hashed y/n: ")
if hashed == "y" or hashed == "Y" or hashed == "YES" or hashed == "yes":
_password = pyautogui.password("Enter hashed password: ")
enc = _password.encode('utf-8')
hash_word = hashlib.md5(enc.strip())
digest = hash_word.hexdigest()
if digest == _password:
print("Password: ", digest)
speak("Password Cracked Successfully")
else:
type = input("Enter type of password: ")
hit_password = ""
if type == "number":
try:
password = input("Enter a password: ")
# while hit_password != password:
# hit_password = random.choices(allnumbers, k=len(password))
# print(">>>[" + ",".join(hit_password) + "]<<<")
# if hit_password == list(password):
# print("The Password is: " + "".join(hit_password))
# speak("Password Cracked Successfully")
# break
for i in range(len(password)):
hit_char = ""
while hit_char != password[i]:
hit_char = random.choice(allnumbers)
print("Cracking character " + str(i+1) + " of " + str(len(password)) + ": " + hit_char)
hit_password += hit_char
if hit_password == password[:i+1]:
i+=1
print("The Password is: " + hit_password)
speak("Password Cracked Successfully")
except ValueError:
print("Enter a valid password")
speak("Enter Valid Password")
elif type == "char" or type == "characters":
i = 0
password = pyautogui.password("Enter your password: ")
# while (hit_password != password):
# hit_password = random.choices(allchars, k=len(password))
# print(">>>" + str(hit_password) + "<<<")
# i+=1
# print(i)
# if (hit_password == list(password)):
# print("The Password is: " + "".join(hit_password))
# speak("Password Cracked Successfully")
# break
for i in range(len(password)):
hit_char = ""
while hit_char != password[i]:
hit_char = random.choice(allchars)
print("Cracking character " + str(i+1) + " of " + str(len(password)) + ": " + hit_char)
hit_password += hit_char
if hit_password == password[:i+1]:
i+=1
print("The Password is: " + hit_password)
speak("Password Cracked Successfully")