import hashlib

def md5_crack(passwords, encrypted):
	for password in passwords:
		guess = hashlib.md5(password.encode('utf-8')).hexdigest()
		if guess == encrypted:
			print(f'[+] Password found: {password}')
			exit(0)
		else:
			print(f'[-] Guess: {password} incorrect... {guess}')
	print(f'Password not found in wordlist...')

def main():
	encrypted = 'ac58b1e8c4d2d0dc8b69b553d36c2758'

	with open('passwords.txt') as f:
		passwords = f.read().splitlines()
	
	md5_crack(passwords, encrypted)
	
if __name__ == '__main__':
	main()