Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python3 hashlib
#1
Quote:Hello, I'm trying to read and compare from an online list, through a given hash, but I'm getting this error:
Quote:Does anybody can help me please?

Error:
Traceback (most recent call last): File "c:\Users\Orlando\Documents\SandBox\MasterHckPython\hack\bruteforce1.py", line 23, in <module> main() File "c:\Users\Orlando\Documents\SandBox\MasterHckPython\hack\bruteforce1.py", line 16, in main z = hashlib.md5(p).encode() TypeError: Strings must be encoded before hashing
Quote:Used Hash: 21232f297a57a5a743894a0e4a801fc3

import hashlib
import urllib.request


def main():
    hashpass = input('Hash: ')
    req = urllib.request.urlopen('https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt')
    
    passwordlist = req.read().decode('utf-8')
    print(type(passwordlist))
    for p in passwordlist.split('\n'):        
        z = hashlib.md5(p).hexdigest()
        if z == hashpass:
            print('Password: {}     HASH: {}'.format(p,z))
    
    

if __name__ == '__main__':
    main()
Quote:Regards!
Reply


Messages In This Thread
Python3 hashlib - by ogautier - Mar-28-2022, 02:42 AM
RE: Python3 hashlib - by snippsat - Mar-28-2022, 04:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] How to crack hash with hashlib Milan 0 1,432 Mar-09-2023, 08:25 PM
Last Post: Milan
  Gnuradio python3 is not compatible python3 xmlrpc library How Can I Fix İt ? muratoznnnn 3 4,952 Nov-07-2019, 05:47 PM
Last Post: DeaD_EyE
  how can I generate a password in hashlib go127a 20 8,684 May-19-2019, 09:26 AM
Last Post: buran
  Confusion about Hashlib Vysero 2 2,999 Jun-25-2018, 04:05 PM
Last Post: DeaD_EyE
  Using SHA3 (keccak) from Hashlib CryptoFlo 0 7,749 Mar-14-2018, 10:56 AM
Last Post: CryptoFlo

Forum Jump:

User Panel Messages

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