Skip to content

Instantly share code, notes, and snippets.

@miketweaver
Created October 13, 2017 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miketweaver/a56253da32e47f034d6486a8a6d0ab20 to your computer and use it in GitHub Desktop.
Save miketweaver/a56253da32e47f034d6486a8a6d0ab20 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import hashlib
score = 0
plaintext = "plaintext.txt"
hashes = "hashes.txt"
plainfile = open(plaintext)
hashfile = open(hashes)
hash = hashfile.readline()
plain = plainfile.readline()
while plain:
if (hashlib.sha1(plain.strip()).hexdigest() == hash.strip()):
score+=1
#print(plain.strip() + ":" + hash.strip())
hash = hashfile.readline()
plain = plainfile.readline()
plainfile.close()
hashfile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment