How to solve a system of XOR equations?

792 Views Asked by At

When I'm trying to solve this system of equations:

$$\begin{aligned} k_1 \oplus k_2 = a \end{aligned}$$ $$\begin{aligned} k_2 \oplus k_3 = b \end{aligned}$$ $$\begin{aligned} k_3 \oplus k_1 = c \end{aligned}$$

I don't get any adequate result, except like $\begin{aligned} a \oplus c = b \end{aligned}$. I can't solve this system. But when I try to solve a similar system with more unknowns:

$$\begin{aligned} k_1 \oplus k_2 \oplus k_3 = a \end{aligned}$$ $$\begin{aligned} k_2 \oplus k_3 \oplus k_4 = b \end{aligned}$$ $$\begin{aligned} k_3 \oplus k_4 \oplus k_1 = c \end{aligned}$$ $$\begin{aligned} k_4 \oplus k_1 \oplus k_2 = d \end{aligned}$$

I do get a solution:

$$\begin{aligned} k_1 = a \oplus c \oplus d \end{aligned}$$ $$\begin{aligned} k_2 = a \oplus b \oplus d \end{aligned}$$ $$\begin{aligned} k_3 = a \oplus b \oplus c \end{aligned}$$ $$\begin{aligned} k_4 = b \oplus c \oplus d \end{aligned}$$

How do I solve the first system? Is it even possible?

2

There are 2 best solutions below

0
On

Hint: XOR is equivalent to addition in $GF(2)$.

0
On

We need $$a \oplus c = b$$ for consistency.

Once you check that it is consistent, choose $k_2$ to be anything and you can recover $k_1$ and $k_3$. $$k_1 = a \oplus k_2$$ $$k_3 = b \oplus k_2$$