from binascii import unhexlify, hexlify
s1 = '48656c6c6f'
s2 = '61736b'
hexlify(''.join(chr(ord(c1) ^ ord(c2)) for c1, c2 in zip(unhexlify(s1[-len(
    s2):]), unhexlify(s2))))
(Python) How to XOR two hex strings so that each byte is XORed separately?