Last active
August 29, 2015 13:58
-
-
Save mattypiper/10296386 to your computer and use it in GitHub Desktop.
obfuscates a file using 1-byte xor
This file contains 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 | |
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