Skip to content

Instantly share code, notes, and snippets.

@AhnMo
Created June 10, 2018 14:37
Show Gist options
  • Save AhnMo/5914393dc49c9d158d3e2c484ba3e25d to your computer and use it in GitHub Desktop.
Save AhnMo/5914393dc49c9d158d3e2c484ba3e25d to your computer and use it in GitHub Desktop.
#!/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