Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created November 8, 2016 15:33
Show Gist options
  • Save AndyNovo/a77af8b17b9a7e44a1c47e9c643eb083 to your computer and use it in GitHub Desktop.
Save AndyNovo/a77af8b17b9a7e44a1c47e9c643eb083 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