Decrypt simple CBC message with known IV using XOR encryption I've been given a ciphertext message, encrypted using CBC. I know that the block size is 12 bytes and I know the plaintext value of the first block.

I also know that the encryption function is a simple XOR: 

$$C_i = K \oplus (M_i \oplus C_{i-1})$$

where $C_0 = IV$.

Now I supposedly should be able to deduce the complete plain text message, but I'm lost. What sort of XOR'ing magic should I perform here to get hold of the plain text?
That's easy: $C_1 = K \oplus (M_1 \oplus C_0)$. You know $C_1$, $M_1$ and of course $C_0$, the IV. You can easily rewrite this as $K = C_0 \oplus C_1 \oplus M_1$.

What is left is simply decryption with $K$. In case of XOR encryption, decryption is the same as encryption, so $M_i = (K \oplus C_i) \oplus C_{i-1}$.



Notes:


XOR is associative and commutative, so you can leave out the parentheses in the formulas and rewrite the formulas like I did above.
this will obviously not work with secure block ciphers since retrieving $K$ is not supposed to be possible, even when given a known plaintext / ciphertext pair.