Created
April 14, 2019 15:02
Revisions
-
stackola created this gist
Apr 14, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ from hashlib import sha256 import itertools import xxhash hashes = [387926980213842431, 2951043163173678585, 16720874773084141888, 17181926294437511708, 9312877567425344755, 8363454362106170326, 15029944785333505497, 6016790709393671791, 11525417821618867588, ] def ispass(guess, seed): hash = xxhash.xxh64(''.join(guess), seed=seed).hexdigest() hash = int(hash,16) #print ("".join(guess)) #print (seed) #print (hash) if hash in hashes: print ("Found it!!") print (guess) print (seed) return True return False def find_password(): seed = 0 alphabet= 'abcdefghijklmnopqrstuvwxyz' while True: attempt_length = 6 print(seed) guesses = itertools.product(alphabet, repeat=attempt_length) # Guess: list of all 6 letter combinations. for guess in guesses: if ispass(guess, seed): return guess break print("inc seed") seed = seed+1 find_password()