Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created February 10, 2016 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AndyNovo/dc83b8d8d189b46cce7e to your computer and use it in GitHub Desktop.
Save AndyNovo/dc83b8d8d189b46cce7e to your computer and use it in GitHub Desktop.
import hashlib, cProfile
f=file('dictionary.txt','r')
words = [word.strip() for word in f]
f.close()
secretHash=hashlib.sha512("banana").hexdigest()
def checkDictionary(secret):
return [word for word in words if hashlib.sha512(word).hexdigest() == secret]
cProfile.run('checkDictionary(secretHash)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment