In [4]:
#!/usr/bin/python
import hashlib
import re
salt = "yzbqklnj"
found1 = False
star1 = "00000"
found2 = False
star2 = "000000"
i = 1
while not (found1 and found2):
if i % 1000000 == 0:
print ("%i no match" % i)
md5 = hashlib.md5()
md5.update((salt + str(i)).encode())
if (md5.hexdigest().startswith(star1)):
if not found1:
print("Star 1 answer: %s%s (value: %s)" % (salt, i, md5.hexdigest()))
found1 = True
if (md5.hexdigest().startswith(star2)):
print("Star 2 answer: %s%s (value: %s)" % (salt, i, md5.hexdigest()))
found2 = True
i += 1
In [ ]: