![]() |
UnicodeDecodeError: - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: UnicodeDecodeError: (/thread-26580.html) |
UnicodeDecodeError: - pratheep - May-06-2020 I'm working on a password cracking tool. The process of working: ->The user will give the md5 hash as input. ->The program then goes through a given file containing a wordlist, it searches for the correct match for the md5 hash given. ->If the correct match is found, it returns the word(password), else it returns "Password is not in the list". The python code is given below: import hashlib flag = 0 pass_hash = input("Enter md5 hash: ") wordlist = input("File name: ") try: pass_file = open(wordlist, "r") except: print("No file found") quit() for word in pass_file: enc_wrd = word.encode('utf-8') digest = hashlib.md5(enc_wrd.strip()).hexdigest() if digest == pass_hash: print("Password found") print("Password: ",word) flag = 1 break if flag == 0: print("Password is not in the list")This the Error I'm getting: I need a solution to this error.Any help would be appreciated. Thank You. |