# Assignment: XOR-cipher [duplicate]

I am currently attending a IT-Security course at the Tel Aviv University and I stuck with the an assignment task.

Please DO NOT post the solution if you know it. But I would be very grateful for any hint that leads me to the correct result.

"Eve has managed to intercept the following messages, encrypted by Alice using a XOR cipher:

c1 = 0 0 1 0 0 1 1 1 0 1 0

c2 = 0 1 0 0 1 1 1 0 1 1 0

c3 = 1 1 0 1 0 1 1 0 1 0 1

Eve suspects Alice has been using the same key to encrypt all three messages; moreover, she suspects that the third message (m3) also happens to be m1 XOR m2.

Can you find the key k and the deciphered messages m1, m2, m3?"

• Write down the formula to obtain $c_n$ from $m_n$ and $k_n$, then apply the two special rules you have been given. See if you can figure out $k$ from that. – Marc Jun 9 at 8:13
• Correct. Now make use of the properties of $\oplus$ to work out the rest. The two formulas you are given are $k_1 = k_2 = k_3$ and $m_3 = m_1 \oplus m_2$. These alongside the three $c_n = m_n \oplus k_n$ are enough. – Marc Jun 9 at 8:33