moth/doc/2010-10-NMT/decode

19 lines
272 B
Plaintext
Raw Normal View History

2010-10-26 22:35:08 -06:00
#! /usr/bin/python
import sys
def xor(s, t):
return ''.join(chr(ord(a) ^ ord(b)) for (a,b) in zip(s,t))
acc = None
for line in sys.stdin:
l = line.strip().decode('hex')
print l
if not acc:
acc = l
else:
acc = xor(acc, l)
print acc