Can someone please help me with the question below?

Explain why 0 ⊕ x ≠ 1 ⊕ x, whatever the value of the bit x.

Hence, explain why flipping a bit in the plaintext produces a predictable change in the ciphertext when using a stream cipher that XORs the plaintext with the keystream to produce a ciphertext.

What is the name of the circle in the middle ?


migrated from stackoverflow.com May 5 '15 at 16:15

This question came from our site for professional and enthusiast programmers.

  • $\begingroup$ Welcome to Stack Overflow! I've edited your question a bit for readability, hope you don't mind. Your question reads like it might be for homework, so I suggest you read this as well as the general question guide. $\endgroup$ – Patrick M Apr 28 '15 at 16:51
  • $\begingroup$ BTW, questions like this are probably better suited for Cryptography Stack Exchange than for Stack Overflow. I've flagged this one for moderator attention, and asked them to migrate it there. $\endgroup$ – Ilmari Karonen Apr 30 '15 at 21:18

The symbol of the circle with the + in it is one of many symbols for exclusive-or. XOR, EOR, EXOR, ⊻, ⊕, ↮, and ≢. Binary OR is true when either input is true; binary XOR is true when exactly one input is true. If both inputs are true, the XOR result is false.

One property of this is that if either input bit flips, the output bit will also flip. That's sort of the definition of XOR, so you'll have to figure out how to reword that for your stream cipher question.

A XOR B Truth Table
Input   | Output
A   B   |
0   0   | 0
0   1   | 1
1   0   | 1
1   1   | 0

1 = TRUE
  • 1
    $\begingroup$ It's also written as ^ in many programming languages. Also known as "diff", it's true where the bits are different. $\endgroup$ – Steve Peltz May 5 '15 at 17:18

It's exclusive or (or XOR), corresponds to $x \oplus y := x+y \pmod 2$ for single bits, i.e., scalars. It is sometimes used for binary vectors as well, whereby two bitvectors of length $n$ $$ \mathbf{x}=(x_1,\ldots,x_n)$$ and $$ \mathbf{y}=(y_1,\ldots,y_n)$$ result in $$ \mathbf{x}\oplus \mathbf{y}=(x_1\oplus y_1,\ldots,x_n \oplus y_n) $$ i.e., a bitwise operation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy