Created
March 15, 2015 05:25
-
-
Save shunkp/ecf358aba90e7cd2fbba to your computer and use it in GitHub Desktop.
This file contains 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 characters
from hashlib import sha1 | |
import itertools | |
import time | |
chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
match = 'ff7b948953ac' | |
i = 1 | |
start = time.time() | |
while True: | |
gen = itertools.combinations_with_replacement(chars,i) | |
for password in gen: | |
tmp = ''.join(password).encode('utf-8') | |
if sha1(tmp).hexdigest()[:12] == match: | |
print('Match: {0}\n'.format(tmp)) | |
break | |
print('{0} done ({1})'.format(i,str(time.time() - start))) | |
start = time.time() | |
i += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment