I'm quite new to coding and trying to crack a password with the help of a .txt file. This is my code so far:
import pyautogui
import random
dictionary = ()
real_pwd = pyautogui.password('Enter password: ')
# posibilities = len(chars) ** len(real_pwd)
# guess_pwd = ""
password = ""
with open("TinyButMighty.txt", "r") as wordlist:
for line in wordlist:
password = line.strip()
print("denied:", str(password))
if password == real_pwd:
print("\nAccess Granted: ~ ", "".join(password))
break
However when i run it with the TinyButMighty.txt i get:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb2 in position 125: invalid start byte
If i make a short list of words myself it doesn't run into any trouble.
Does anyone have an idea on how to surpass this problem?