''' Prints the XOR of two hex strings as input arguments Author: Tim Pierson, Dartmouth CS55, Winter 2021 code is from Wenliang Du https://github.com/kevin-w-du/BookCode/blob/master/Encryption/xor.py Usage: python3 xor.py ''' from sys import argv script, first, second = argv aa = bytearray.fromhex(first) bb = bytearray.fromhex(second) xord = bytearray(x^y for x,y in zip(aa,bb)) print(xord.hex())