#!/usr/bin/python # -*- coding: UTF-8 -*- import sys from xortools import single_byte_xor if len(sys.argv) == 1: print "usage: " + __file__ + " filename" sys.exit() key = 0 argvs = sys.argv in_buf = open(argvs[1], 'rb').read() while key < 256: hkey = hex(key) output = str(argvs[1]) + '.' + str(hkey) + '.xor' out_buf = open(output, 'wb') out_buf.write(single_byte_xor(in_buf, key)) out_buf.close() key += 1