Created
June 6, 2016 15:10
-
-
Save idiom/fd4013643018eccf6e22fcb690a2e185 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/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