Create a gist now

Instantly share code, notes, and snippets.

anonymous /decrypt.py
Created Dec 14, 2016

import sys, base64, re
from lxml import etree
tree = etree.parse(sys.argv[1])
root = tree.getroot()
values = {}
for data in root.findall('data'):
key = data.get('name')
value = data.find('value').text
values[key] = base64.b64decode(value)
lod = values['lodpxyirK']
table = []
for string in re.findall('[A-Za-z]{3,}', lod):
table.append(values[string])
table = ''.join(table)
key = table[:74]
data = table[74:]
result = []
for i, c in enumerate(data):
result.append(chr(ord(c) ^ ord(key[i%74])))
print sys.argv[2]
f = open(sys.argv[2], 'w')
f.write(''.join(result))
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment