Skip to content

Instantly share code, notes, and snippets.

Created March 3, 2013 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5078264 to your computer and use it in GitHub Desktop.
Save anonymous/5078264 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys, argparse as g
p = g.ArgumentParser()
p.add_argument('filename', nargs='?')
a = p.parse_args()
def r(size):
kc = sys.stdin.read(size)
nf = open('.e','w')
nf.write(kc)
nf.close()
return kc
def p(t, b):
print ''.join([ chr(ord(a) ^ ord(b)) for a, b in zip(t, b) ])
if __name__ == "__main__":
x = open(a.filename)
x.seek(0,2)
l = x.tell()
x.seek(0,0)
x = x.read()
y = r(l)
p(x, y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment