Simultaneous equations and XOR

70 Views Asked by At

I've just finished some homework on cryptography. I have the right answer, but I think it's more from luck than skill.

(I'm trying to phrase this without breaching the honour code.)

$F(k,x)$ is some function that takes a key $k := \{0,1\}^5$ and an input $x:=\{0,1\}^4$.

I never know what $k$ is, however I have three examples of inputs and outputs.

i.e.,

  1. $F(k,a)=a'$
  2. $F(k,b)=b'$
  3. $F(k,c)=c'$

(In the question I have concrete values for $a$, $b$, $c$, $a'$, $b'$ and $c'$.)

Given this, I have to find $d'$ for $F(x,d)$.

I have done it, and got the right answer like so:

I noticing that $a \oplus b \oplus c = d$, so I tried the following:

$d' = F(k,a) \oplus F(k,b) \oplus F(k,c)$

$\therefore$

$d' = a' \oplus b' \oplus c'$

Given I know what $a'$, $b'$ & $c'$ this is solvable.

Where I'm struggling is why.

$ F(k,a) \oplus F(k,b) \neq F(k \oplus k,a \oplus b)$

$ F(k,a) \oplus F(k,b) \neq F(0,a \oplus b)$

Which is, unfortunately, how I solved the problem.

So... Is there any generic rule for XORing functions like this?