import hashlib
digest = ["sha1", "sha256", "md5"]
s = "5UA@/Mw^%He]SBaU".encode('utf-8')
h = "3281e6de7fa3c6fd6d6c8098347aeb06bd35b0f74b96f173c7b2d28135e14d45"
dictionary = open("dictionary.txt", "r")
for i in digest:
for line in dictionary:
testString = bytes(line, 'utf-8')
h2 = hashlib.digest[i](testString + s).hexdigest()
print(h2)
if h in h2:
print("the password is:", line)
I am trying to figure out a way to iterate the digests of hashlib. Is a list viable for this? (I know it doesn't work as I'm passing it a string).
Alternatively, what options exist for doing this sort of iteration?