Password cracker

Tell us what’s happening:
iv been trying to figure out where im going wrong with this one . iv changed everything so many times , iv went back to our practice and still not sure .

Your code so far

import hashlib
from hashlib import sha1


def crack_sha1_hash(hash):

password = open('r'\'top-10000-passwords.txt')
password_c=("hash","r")

top_1000= open(top)
password.readlines

for i in range(len(top_1000)):
password_c=hashlib.md5(top_1000[i].replace("").encode(shake.hexdigest))
   if password == password_c:
    return password
else:
  print("Password not found")

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 Edg/88.0.705.68.

Challenge: SHA-1 Password Cracker

Link to the challenge:

my output error :

 python main.py
Traceback (most recent call last):
  File "main.py", line 2, in <module>
    import password_cracker
  File "/home/runner/boilerplate-SHA-1-password-cracker-2/password_cracker.py", line 7
    password = open('r'\'top-10000-passwords.txt')
    ^
IndentationError: expected an indented block
1 Like

to have stuff inside the function it needs all to be more indented than the line with def

thank you , I appreciate the help . if you have any suggestions or examples i would really appreciate that .

it’s basic python syntax, you may want to review on that. indentation is really important for python syntax

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.