Created
June 10, 2018 14:37
-
-
Save AhnMo/5914393dc49c9d158d3e2c484ba3e25d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/python | |
from binascii import crc32 | |
sample_str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" | |
target = 77236792 | |
def check(x): | |
return crc32(x) == target | |
def crack(cur, size): | |
for i in sample_str: | |
if len(cur) + 1 < size: | |
if crack(cur + i, size): | |
return True | |
elif check(cur + i): | |
print 'Found' | |
print cur + i | |
return True | |
return False | |
for i in range(10): | |
print '%04d' % i | |
if crack('', i + 1): | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment