Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (8 sloc) 380 Bytes
def xor(data, key):
l = len(key)
return bytearray((
(data[i] ^ key[i % l]) for i in range(0,len(data))
))
data = bytearray(open('myfile.bin', 'rb').read())
key = bytearray([0x31,0x44,0x65,0x77,0x78,0x48,0x70,0x64,0x72,0x47,0x32,0x58,0x65,0x32,0x78,0x57,0x56,0x61 ,0x31,0x58,0x77,0x46,0x47,0x36,0x68,0x4a,0x31,0x43,0x74,0x69,0x33,0x30])
print xor(data,key)