#!/bin/bash
read -p "The IV used: " IV_OLD
read -p "Next IV: " IV_NEXT

python3 - "$IV_OLD" "$IV_NEXT" <<'PY'
import sys

def xorb(a, b):
    return bytes(x ^ y for x, y in zip(a, b))

iv_old  = bytes.fromhex(sys.argv[1].strip())
iv_next = bytes.fromhex(sys.argv[2].strip())

m_yes = b"Yes" + bytes([13]) * 13
m_no  = b"No"  + bytes([14]) * 14

p_yes = xorb(xorb(m_yes, iv_old), iv_next)
p_no  = xorb(xorb(m_no,  iv_old), iv_next)

print(p_yes.hex())
print(p_no.hex())
PY
