-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMD5-dehasher.py
More file actions
21 lines (18 loc) · 778 Bytes
/
MD5-dehasher.py
File metadata and controls
21 lines (18 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import hashlib
import argparse
parser = argparse.ArgumentParser(description = "MD5 Cracker")
parser.add_argument("-md5", dest="hash", help="md5 hash", required=True)
parser.add_argument("-w", dest="wordlist", help="wordlist", required=True)
parsed_args = parser.parse_args()
def main():
hash_cracked = ""
with open(parsed_args.wordlist) as file:
for line in file:
line = line.strip()
if hashlib.md5(bytes(line,encoding="utf-8")).hexdigest() == parsed_args.hash:
hash_cracked = line
print("\nMD5-hash has been successfully cracked; the value is %s."%line)
if hash_cracked == "":
print("\nFailed to crack hash. Try larger dictionary.")
if __name__ == "__main__":
main()