Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env pypy
- # -*- coding: utf-8 -*-
- import itertools
- import string
- TARGET = 0x1E1EAB437EEB0
- ALPHABET = string.ascii_letters + string.digits
- MOD = 0x38D7EA4C68025
- COEFF = 0x241
- def decode_full_hash_value(value):
- res = ''
- while value:
- code = value % COEFF
- res += chr(code)
- value /= COEFF
- return ''.join(reversed(res))
- for i in itertools.count(): # 0, 1, 2, ...
- try:
- decoded = decode_full_hash_value(TARGET + MOD * i)
- except ValueError:
- # Can be raised if a code of some character >= 256,
- # then we'll just skip this string
- continue
- cur_score = sum(ch in ALPHABET for ch in decoded)
- wanted_score = len(decoded)
- if cur_score + 2 >= wanted_score:
- print '{} / {}'.format(cur_score, wanted_score),
- print ''.join('\\x' + hex(ord(ch))[2:].zfill(2) for ch in decoded)
- if cur_score == wanted_score:
- print 'Found:', decoded
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement