小编Ayo*_*b.A的帖子

类型错误:必须在散列之前对字符串进行编码

在此代码上:


##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:字符串必须在散列之前进行编码

有人能帮我吗 ?

python-3.9

9
推荐指数
1
解决办法
8117
查看次数

标签 统计

python-3.9 ×1