**Challenge:** SHA-1 Password Cracker

Tell us what’s happening:
Hello guys!
Anyone here knows something about hash? Need help with my code! Why does it not work? I mean, why is not properly hashing ?

Your code so far

import hashlib
from hashlib import sha1

def crack_sha1_hash(hash, use_salts=False):
	HP = open("top-10000-passwords.txt", "r")
	if use_salts==True:
		print("Developing True")
		print("Developing False")
		#Reads all Archive
		for reading in HP:
			if hash in hashlib.sha1(reading.encode('utf-8')).hexdigest():
				print (reading)

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:78.0) Gecko/20100101 Firefox/78.0.

Challenge: SHA-1 Password Cracker

Link to the challenge:

Check to see if the password read from the file contains a new line or not.
Remove it if it is present before the comparison.

Hi @ebusinesstoken,
Your HP variable is actually a file handler at that stage; it doesn’t content anything.
Search for the readlines() method on Python’s documentation. Or, check out this documentation, it may lead you in the right direction.