Python Forum
[SOLVED] How to crack hash with hashlib
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] How to crack hash with hashlib
#1
Hello team,

Could someone please shed some light on how to crack SHA3-512 hashes using hashlib or any other way?

What I have so far:

import hashlib

hash = b'a2099f4c2c2de141afb474dfe4b765ce83448100e77f4359314d94807b00862d53316c03963fc60cbdbd7bc6915778f1830f0f4fd9364a4bc71a09c5e83a0a67'

unhash = hashlib.sha3_512(hash.decode())
This is the error I get:

Error:
AttributeError: 'str' object has no attribute 'hexdigest'
I went through its documentation, but could not find anything helpful, nor anything online.

Thanks in advance

[EDIT]

SOLUTION:
from urllib.request import urlopen
import hashlib

sha3_512hash = input("[+] Enter sha3-512 Hash value: ")

password_list = str(urlopen('https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt').read(), 'utf-8')
for password in password_list.split('\n'):
    guess = hashlib.sha3_512(bytes(password,'utf-8')).hexdigest()
    if guess == sha3_512hash:
        print("[+] The password is: "+str(password))
        break
    elif guess != sha3_512hash:
        continue
    else:
        print("The password does not matched in the list…")
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python3 hashlib ogautier 1 1,552 Mar-28-2022, 04:42 AM
Last Post: snippsat
  Not able to crack a simple visualization – missing something basic – plz guide darpInd 4 2,824 Mar-27-2020, 09:26 AM
Last Post: darpInd
  Hash command works differently for me in CMD and Spyder ZweiDCG 3 2,361 Sep-10-2019, 01:10 PM
Last Post: DeaD_EyE
  length constraint on phrase hash to password javaben 0 1,924 Aug-21-2019, 05:34 PM
Last Post: javaben
  Create file archive that contains crypto hash ED209 1 2,066 May-29-2019, 03:05 AM
Last Post: heiner55
  how can I generate a password in hashlib go127a 20 8,656 May-19-2019, 09:26 AM
Last Post: buran
  Fastest dict/map method when 'key' is already a hash? tasket 6 4,014 Apr-20-2019, 06:40 PM
Last Post: tasket
  Confusion about Hashlib Vysero 2 2,995 Jun-25-2018, 04:05 PM
Last Post: DeaD_EyE
  hash v2 and v3 help Normalitie 7 4,357 Mar-22-2018, 01:57 PM
Last Post: DeaD_EyE
  Using SHA3 (keccak) from Hashlib CryptoFlo 0 7,735 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