-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmd5.py
More file actions
28 lines (22 loc) · 930 Bytes
/
md5.py
File metadata and controls
28 lines (22 loc) · 930 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
import string
from itertools import product
import hashlib
from colorama import Fore
def main(message, start, min, max):
letters = string.ascii_letters + string.digits + "!@#$%&*"
while min <= max:
for word in map(''.join, product(letters, repeat=min)):
new = start + word
md5 = hashlib.md5(new.encode('utf-8')).hexdigest()
if md5 == message:
print(Fore.GREEN +
f'\nMD5 Hash: {Fore.GREEN + md5} {Fore.GREEN + new}')
quit()
print(Fore.RED + f'MD5 Hash: {md5} {new}')
min += 1
if __name__ == "__main__":
start = input("Enter what you know: ")
message = input("Hash Message: ").lower()
msg_min = int(input("Min # of chars in message after what you entered:"))
msg_max = int(input("Max # of chars in message after what you entered:"))
main(message, start, msg_min, msg_max)