1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| from hashlib import sha3_256 import itertools import time
signed = [-102,-67,-68,88,121,42,126,-101,-1,34,73,-123,79,10,30,44,11,-53,40,-40,-109,-23,80,-5,-18,47,125,58,-67,-6,-99,-22] target = bytes([(x + 256) % 256 for x in signed])
charset = "abcdefghijklmnopqrstuvwxyz0123456789" start = time.time() count = 0
for combo in itertools.product(charset, repeat=4): v0 = bytes([ord(c) for c in combo]) h = sha3_256(sha3_256(v0).digest()).digest() count += 1 if h == target: print("FOUND v0 bytes:", v0) print("ASCII:", v0.decode('ascii')) break if count % 200000 == 0: print("tried", count, "elapsed", time.time()-start)
print("done, tried", count, "elapsed", time.time()-start)
|