Some observations on this file: 0. This is a file of SHA1 hashes of short strings (i.e. passwords). 1. There are 3,521,180 hashes that begin with 00000. I believe that these represent hashes that the hackers have already broken and they have marked them with 00000 to indicate that fact. Evidence for this is that the SHA1 hash of 'password' does not appear in the list, but the same hash with the first five characters…
from hashlib import sha1
f = "combo_not.txt"
hashes = [x[0:40] for x in open(f)] # [0:40] to stripe off \n
# From another comment
def check_pass(plaintext, offset=5):
hashed = sha1(plaintext).hexdigest()
return (hashed, '0' * offset + hashed[offset:])
print check_pass("linkedin")[0] in hashes # -> False
print check_pass("linkedin")[1] in hashes # -> True (sanity check)
myHash, myHashBroken = check_pass("plaintextoflinkedinpassword")
print myHash in hashes # -> False
print myHashBroken in hashes # -> False