如何异或 cipher_text 和十六进制值?

How to Xor cipher_text and and hex value?

如何使用 python Xor cipher-text1 XOR cipher-text2 = "3c0d094c1f523808000d09" 和 "746865" 得到这个 "48656c"?谢谢

基于此 https://crypto.stackexchange.com/questions/59/taking-advantage-of-one-time-pad-key-reuse

enter image description here

您可以在每个字节上使用 ^ bitwise exclusive or operator

>>> a = bytes.fromhex('3c0d094c1f523808000d09')
>>> b = bytes.fromhex('746865')
>>> bytes(x ^ y for x, y in zip(a, b)).hex()
'48656c'