Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UnicodeDecodeError:
#1
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:
Error:
Traceback (most recent call last): File "/Users/admin/Desktop/Pythontests/passwordcracker/passcrack.py", line 15, in <module> for word in pass_file: File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 5884: invalid continuation byte
I need a solution to this error.
Any help would be appreciated.
Thank You.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 16: invalid cont Melcu54 3 5,088 Mar-26-2023, 12:12 PM
Last Post: Gribouillis
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 34: character Melcu54 7 19,200 Sep-26-2022, 10:09 AM
Last Post: Melcu54
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 error from Mysql call AkaAndrew123 1 3,477 Apr-28-2021, 08:16 AM
Last Post: AkaAndrew123
Question UnicodeDecodeError . . . JohnnyCoffee 5 3,605 Feb-28-2021, 02:32 AM
Last Post: JohnnyCoffee
  open(file, 'rb') raises UnicodeDecodeError binnybit 1 2,496 Sep-28-2020, 06:55 AM
Last Post: Gribouillis
  unicodedecodeerror:utf codec can't decode byte 0xe3 in position 1 mariolopes 3 2,846 Oct-14-2019, 10:17 PM
Last Post: mariolopes

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020