Skip to content

Instantly share code, notes, and snippets.

@mattypiper
Last active August 29, 2015 13:58
Show Gist options
  • Save mattypiper/10296386 to your computer and use it in GitHub Desktop.
Save mattypiper/10296386 to your computer and use it in GitHub Desktop.
obfuscates a file using 1-byte xor
#!/usr/bin/env python
from struct import unpack, pack
import sys
x = ''
with open(sys.argv[1], 'rb') as f:
x = f.read()
with open(sys.argv[2], 'wb') as f:
for i in xrange(0,len(x)):
y = unpack('b', x[i])[0]
y ^= 0x55
f.write(pack('b', y))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment