在此代码上:
##script qui brute force les hashs
import hashlib
while True :
try :
wordlist_user = input("entrez votre wordlist: ")
wordlist = open(wordlist_user, "r", encoding='utf-8')
hash = input('entrez le hash que vous oulez cracker (sha224) : ')
break
except :
print('Error')
for word in wordlist.readlines():
word = word.strip()
wordlist_hash = hashlib.sha224(word).hexdigest()
if (hash == wordlist_hash):
print('password trouve: ' +word)
else :
print('password non trouve')
Run Code Online (Sandbox Code Playgroud)
我有这个错误
wordlist_hash = hashlib.sha224(word).hexdigest() TypeError:字符串必须在散列之前进行编码
有人能帮我吗 ?
Kel*_*lly 12
hashlib.sha224()占用字节但是word一个字符串。您需要将字符串转换为 utf-8 编码字节word.encode(encoding = 'UTF-8', errors = 'strict')
| 归档时间: |
|
| 查看次数: |
8117 次 |
| 最近记录: |