Skip to content

Instantly share code, notes, and snippets.

@idiom
Created June 6, 2016 15:10
Show Gist options
  • Save idiom/fd4013643018eccf6e22fcb690a2e185 to your computer and use it in GitHub Desktop.
Save idiom/fd4013643018eccf6e22fcb690a2e185 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
###############################################################################################
##
## String obfuscation decoder for Boleto themed java downloader
## Sample SHA256: dbc180e8c8506d7f56016c86edc0cca1a30a3e4e4239a42b813c1fdfd85b1dcf
##
## @seanmw
##
#################################################################################################
def decrypt(string, key):
modifier = ord(string[0]) - 65
offset = 1
string = string[1:]
decoded = ""
while string:
decoded += chr((ord(string[0]) - 65) * 25 + (ord(string[1]) - 65) - modifier - key)
string = string[2:]
return decoded
def main():
parser = argparse.ArgumentParser(prog='boleto_decrypt', usage='%(prog)s [options]', description="String decrypter for Boleto string obfuscation")
parser.add_argument("cipher_text", help="String to decrypt")
parser.add_argument('key', help="Key")
args = parser.parse_args()
print decrypt(args.cipher_text, int(args.key))
return 0
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment