Created
November 26, 2012 14:21
-
-
Save jrglee/4148460 to your computer and use it in GitHub Desktop.
Script to xor hex strings
This file contains hidden or 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 | |
import sys | |
a = sys.argv[1].decode("hex") | |
b = sys.argv[2].decode("hex") | |
def tohex(v): | |
return chr(v).encode("hex") | |
out = [tohex(ord(x) ^ ord(y)) for (x, y) in zip(a, b)] | |
print " ".join(out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment