-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHashComparingTool.py
49 lines (44 loc) · 1.3 KB
/
HashComparingTool.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
# Hash Comparing Tool
import os
import hashlib
def checkFromInput():
try:
inputhash = str(input("What's the hash?: "))
tocheck = "(Static Set MD5 Hash here)"
if inputhash == tocheck:
print("Hash is the same!!")
else:
print("Not the same!")
main()
except KeyboardInterrupt:
print("Quiting")
def checkFromFile():
try:
tocheck = input("MD5 Hash: ")
BDirs = "hashes.txt"
path = str(os.getcwd()+ "\\" + BDirs)
tFile = open(path,"r")
file = tFile.readlines()
i = 0
for line in file:
hs = file[i]
hashes = hashlib.md5(hs.encode())
if hashes == tocheck:
print("[+] Hash checks out: " + hashes)
else:
print("[-] Not the same!: " + hashes)
i = i + 1
except KeyboardInterrupt:
print("Quiting... HoLD ON!")
def main():
try:
choice = int(input("1 = From Input / 2 = From File?: "))
if choice == 1:
checkFromInput()
elif choice == 2:
checkFromFile()
else:
print("Give me the correct number!!")
except ValueError():
print("So you are giving me a wrong type of input god dammit!")
main()