Skip to main content
Links
Source Link
fgrieu
  • 145.4k
  • 12
  • 319
  • 611

This question is about the properties of the bitwise eXclusive-ORbitwise eXclusive-OR operator (also known as XOR or $\oplus$), which is very common in cryptography. It's the bitwise operatorbitwise operator for the similarly named and noted bit operator $\oplus$bit operator XOR, which truth table is

$$\begin{array}{c|c|c|c|c|c} \text{first/left input}&a&0&0&1&1\\ \text{second/right input}&b&0&1&0&1\\ \hline \text{output}&a\oplus b&0&1&1&0 \end{array}$$

A bitwise operatorbitwise operator operates on bitstrings of equal length, and applies a boolean operator to bits of equal ranks in its inputs to form the bit of that rank in the output. Thus the bitwise XOR operator simply applies the above table for each bits of the input. An example with $8$-bit bitstrings:

$$\begin{array}{c|c|c|c} &\text{bitstrings}&\text{binary}&\text{hexadecimal}\\ \hline \text{first/left input}&A&00110001&\tt{31_h}\\ \text{second/right input}&B&01011100&\tt{5c_h}\\ \hline \text{output}&A\oplus B&01101101&\tt{6d_h}\\ \end{array}$$

The bitwise XOR operator $\oplus$ inherits the properties of the bit operator $\oplus$:

  • associativity: $\forall X$, $\forall Y$, $\forall Z$, $\ (X\oplus Y)\oplus Z\,=\,X\oplus(Y\oplus Z)$
  • commutativity: $\forall X$, $\forall Y$, $\ X\oplus Y\,=\,Y\oplus X$
  • there's an identity element, that's the all-zero bitstring: $$\forall X,\ X\oplus{\underbrace{0\ldots0}_{|X|\text{ bits}}}\,=\,X\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}\oplus X$$ where $|X|$ is the bit width of $X$.
    Equivalently: $\forall X$, $\ X\oplus0^{|X|}\,=\,X\,=\,0^{|X|}\oplus X$.

    For $8$-bit operands as in the example above, $0^{|X|}$ is $00000000$ or $\tt{00_h}$.
  • Each element is it's own inverse (or opposite): $\forall X$, $\ X\oplus X\,=\,0^{|X|}\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}$

The first three properties are that of the internal law (equivalently: operation) of a commutative group (equivalently: Abelian group).

The last property makes the group a Boolean group. Specifically, the Boolean group of bitstrings of $n$ bits, noted $\left(\{0,1\}^n,\oplus\right)$

The question operates on that group for $n$ of eleven. It boils down to writing the statement a equations, and solving these by applying the stated properties. If one gets stuck, there are hints in comment, and a worked solution in the other answer.

This question is about the properties of the bitwise eXclusive-OR operator (also known as XOR or $\oplus$), which is very common in cryptography. It's the bitwise operator for the similarly named and noted bit operator $\oplus$, which truth table is

$$\begin{array}{c|c|c|c|c|c} \text{first/left input}&a&0&0&1&1\\ \text{second/right input}&b&0&1&0&1\\ \hline \text{output}&a\oplus b&0&1&1&0 \end{array}$$

A bitwise operator operates on bitstrings of equal length, and applies a boolean operator to bits of equal ranks in its inputs to form the bit of that rank in the output. Thus the bitwise XOR operator simply applies the above table for each bits of the input. An example with $8$-bit bitstrings:

$$\begin{array}{c|c|c|c} &\text{bitstrings}&\text{binary}&\text{hexadecimal}\\ \hline \text{first/left input}&A&00110001&\tt{31_h}\\ \text{second/right input}&B&01011100&\tt{5c_h}\\ \hline \text{output}&A\oplus B&01101101&\tt{6d_h}\\ \end{array}$$

The bitwise XOR operator $\oplus$ inherits the properties of the bit operator $\oplus$:

  • associativity: $\forall X$, $\forall Y$, $\forall Z$, $\ (X\oplus Y)\oplus Z\,=\,X\oplus(Y\oplus Z)$
  • commutativity: $\forall X$, $\forall Y$, $\ X\oplus Y\,=\,Y\oplus X$
  • there's an identity element, that's the all-zero bitstring: $$\forall X,\ X\oplus{\underbrace{0\ldots0}_{|X|\text{ bits}}}\,=\,X\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}\oplus X$$ where $|X|$ is the bit width of $X$.
    Equivalently: $\forall X$, $\ X\oplus0^{|X|}\,=\,X\,=\,0^{|X|}\oplus X$.

    For $8$-bit operands as in the example above, $0^{|X|}$ is $00000000$ or $\tt{00_h}$.
  • Each element is it's own inverse (or opposite): $\forall X$, $\ X\oplus X\,=\,0^{|X|}\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}$

The first three properties are that of the internal law (equivalently: operation) of a commutative group (equivalently: Abelian group).

The last property makes the group a Boolean group. Specifically, the Boolean group of bitstrings of $n$ bits, noted $\left(\{0,1\}^n,\oplus\right)$

The question operates on that group for $n$ of eleven. It boils down to writing the statement a equations, and solving these by applying the stated properties. If one gets stuck, there are hints in comment, and a worked solution in the other answer.

This question is about the properties of the bitwise eXclusive-OR operator (also known as XOR or $\oplus$), which is very common in cryptography. It's the bitwise operator for the similarly named and noted bit operator XOR, which truth table is

$$\begin{array}{c|c|c|c|c|c} \text{first/left input}&a&0&0&1&1\\ \text{second/right input}&b&0&1&0&1\\ \hline \text{output}&a\oplus b&0&1&1&0 \end{array}$$

A bitwise operator operates on bitstrings of equal length, and applies a boolean operator to bits of equal ranks in its inputs to form the bit of that rank in the output. Thus the bitwise XOR operator simply applies the above table for each bits of the input. An example with $8$-bit bitstrings:

$$\begin{array}{c|c|c|c} &\text{bitstrings}&\text{binary}&\text{hexadecimal}\\ \hline \text{first/left input}&A&00110001&\tt{31_h}\\ \text{second/right input}&B&01011100&\tt{5c_h}\\ \hline \text{output}&A\oplus B&01101101&\tt{6d_h}\\ \end{array}$$

The bitwise XOR operator $\oplus$ inherits the properties of the bit operator $\oplus$:

  • associativity: $\forall X$, $\forall Y$, $\forall Z$, $\ (X\oplus Y)\oplus Z\,=\,X\oplus(Y\oplus Z)$
  • commutativity: $\forall X$, $\forall Y$, $\ X\oplus Y\,=\,Y\oplus X$
  • there's an identity element, that's the all-zero bitstring: $$\forall X,\ X\oplus{\underbrace{0\ldots0}_{|X|\text{ bits}}}\,=\,X\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}\oplus X$$ where $|X|$ is the bit width of $X$.
    Equivalently: $\forall X$, $\ X\oplus0^{|X|}\,=\,X\,=\,0^{|X|}\oplus X$.

    For $8$-bit operands as in the example above, $0^{|X|}$ is $00000000$ or $\tt{00_h}$.
  • Each element is it's own inverse (or opposite): $\forall X$, $\ X\oplus X\,=\,0^{|X|}\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}$

The first three properties are that of the internal law (equivalently: operation) of a commutative group (equivalently: Abelian group).

The last property makes the group a Boolean group. Specifically, the Boolean group of bitstrings of $n$ bits, noted $\left(\{0,1\}^n,\oplus\right)$

The question operates on that group for $n$ of eleven. It boils down to writing the statement a equations, and solving these by applying the stated properties. If one gets stuck, there are hints in comment, and a worked solution in the other answer.

Change notation since k could be understood as the key, and is used as such in the other answer
Source Link
fgrieu
  • 145.4k
  • 12
  • 319
  • 611

This question is about the properties of the bitwise eXclusive-OR operator (also known as XOR or $\oplus$), which is very common in cryptography. It's the bitwise operator for the similarly named and noted bit operator $\oplus$, which truth table is

$$\begin{array}{c|c|c|c|c|c} \text{first/left input}&a&0&0&1&1\\ \text{second/right input}&b&0&1&0&1\\ \hline \text{output}&a\oplus b&0&1&1&0 \end{array}$$

A bitwise operator operates on bitstrings of equal length, and applies a boolean operator to bits of equal ranks in its inputs to form the bit of that rank in the output. Thus the bitwise XOR operator simply applies the above table for each bits of the input. An example with $8$-bit bitstrings:

$$\begin{array}{c|c|c|c} &\text{bitstrings}&\text{binary}&\text{hexadecimal}\\ \hline \text{first/left input}&A&00110001&\tt{31_h}\\ \text{second/right input}&B&01011100&\tt{5c_h}\\ \hline \text{output}&A\oplus B&01101101&\tt{6d_h}\\ \end{array}$$

The bitwise XOR operator $\oplus$ inherits the properties of the bit operator $\oplus$:

  • associativity: $\forall X$, $\forall Y$, $\forall Z$, $\ (X\oplus Y)\oplus Z\,=\,X\oplus(Y\oplus Z)$
  • commutativity: $\forall X$, $\forall Y$, $\ X\oplus Y\,=\,Y\oplus X$
  • there's an identity element, that's the all-zero bitstring: $$\forall X,\ X\oplus{\underbrace{0\ldots0}_{|X|\text{ bits}}}\,=\,X\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}\oplus X$$ where $|X|$ is the bit width of $X$.
    Equivalently: $\forall X$, $\ X\oplus0^{|X|}\,=\,X\,=\,0^{|X|}\oplus X$.

    For $8$-bit operands as in the example above, $0^{|X|}$ is $00000000$ or $\tt{00_h}$.
  • Each element is it's own inverse (or opposite): $\forall X$, $\ X\oplus X\,=\,0^{|X|}\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}$

The first three properties are that of the internal law (equivalently: operation) of a commutative group (equivalently: Abelian group).

The last property makes the group a Boolean group. Specifically, the Boolean group of bitstrings of $k$$n$ bits, noted $\left(\{0,1\}^k,\oplus\right)$$\left(\{0,1\}^n,\oplus\right)$

The question operates on that group for $k$$n$ of eleven. It boils down to writing the statement a equations, and solving these by applying the stated properties. If one gets stuck, there are hints in comment, and a worked solution in the other answer.

This question is about the properties of the bitwise eXclusive-OR operator (also known as XOR or $\oplus$), which is very common in cryptography. It's the bitwise operator for the similarly named and noted bit operator $\oplus$, which truth table is

$$\begin{array}{c|c|c|c|c|c} \text{first/left input}&a&0&0&1&1\\ \text{second/right input}&b&0&1&0&1\\ \hline \text{output}&a\oplus b&0&1&1&0 \end{array}$$

A bitwise operator operates on bitstrings of equal length, and applies a boolean operator to bits of equal ranks in its inputs to form the bit of that rank in the output. Thus the bitwise XOR operator simply applies the above table for each bits of the input. An example with $8$-bit bitstrings:

$$\begin{array}{c|c|c|c} &\text{bitstrings}&\text{binary}&\text{hexadecimal}\\ \hline \text{first/left input}&A&00110001&\tt{31_h}\\ \text{second/right input}&B&01011100&\tt{5c_h}\\ \hline \text{output}&A\oplus B&01101101&\tt{6d_h}\\ \end{array}$$

The bitwise XOR operator $\oplus$ inherits the properties of the bit operator $\oplus$:

  • associativity: $\forall X$, $\forall Y$, $\forall Z$, $\ (X\oplus Y)\oplus Z\,=\,X\oplus(Y\oplus Z)$
  • commutativity: $\forall X$, $\forall Y$, $\ X\oplus Y\,=\,Y\oplus X$
  • there's an identity element, that's the all-zero bitstring: $$\forall X,\ X\oplus{\underbrace{0\ldots0}_{|X|\text{ bits}}}\,=\,X\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}\oplus X$$ where $|X|$ is the bit width of $X$.
    Equivalently: $\forall X$, $\ X\oplus0^{|X|}\,=\,X\,=\,0^{|X|}\oplus X$.

    For $8$-bit operands as in the example above, $0^{|X|}$ is $00000000$ or $\tt{00_h}$.
  • Each element is it's own inverse (or opposite): $\forall X$, $\ X\oplus X\,=\,0^{|X|}\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}$

The first three properties are that of the internal law (equivalently: operation) of a commutative group (equivalently: Abelian group).

The last property makes the group a Boolean group. Specifically, the Boolean group of bitstrings of $k$ bits, noted $\left(\{0,1\}^k,\oplus\right)$

The question operates on that group for $k$ of eleven. It boils down to writing the statement a equations, and solving these by applying the stated properties. If one gets stuck, there are hints in comment, and a worked solution in the other answer.

This question is about the properties of the bitwise eXclusive-OR operator (also known as XOR or $\oplus$), which is very common in cryptography. It's the bitwise operator for the similarly named and noted bit operator $\oplus$, which truth table is

$$\begin{array}{c|c|c|c|c|c} \text{first/left input}&a&0&0&1&1\\ \text{second/right input}&b&0&1&0&1\\ \hline \text{output}&a\oplus b&0&1&1&0 \end{array}$$

A bitwise operator operates on bitstrings of equal length, and applies a boolean operator to bits of equal ranks in its inputs to form the bit of that rank in the output. Thus the bitwise XOR operator simply applies the above table for each bits of the input. An example with $8$-bit bitstrings:

$$\begin{array}{c|c|c|c} &\text{bitstrings}&\text{binary}&\text{hexadecimal}\\ \hline \text{first/left input}&A&00110001&\tt{31_h}\\ \text{second/right input}&B&01011100&\tt{5c_h}\\ \hline \text{output}&A\oplus B&01101101&\tt{6d_h}\\ \end{array}$$

The bitwise XOR operator $\oplus$ inherits the properties of the bit operator $\oplus$:

  • associativity: $\forall X$, $\forall Y$, $\forall Z$, $\ (X\oplus Y)\oplus Z\,=\,X\oplus(Y\oplus Z)$
  • commutativity: $\forall X$, $\forall Y$, $\ X\oplus Y\,=\,Y\oplus X$
  • there's an identity element, that's the all-zero bitstring: $$\forall X,\ X\oplus{\underbrace{0\ldots0}_{|X|\text{ bits}}}\,=\,X\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}\oplus X$$ where $|X|$ is the bit width of $X$.
    Equivalently: $\forall X$, $\ X\oplus0^{|X|}\,=\,X\,=\,0^{|X|}\oplus X$.

    For $8$-bit operands as in the example above, $0^{|X|}$ is $00000000$ or $\tt{00_h}$.
  • Each element is it's own inverse (or opposite): $\forall X$, $\ X\oplus X\,=\,0^{|X|}\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}$

The first three properties are that of the internal law (equivalently: operation) of a commutative group (equivalently: Abelian group).

The last property makes the group a Boolean group. Specifically, the Boolean group of bitstrings of $n$ bits, noted $\left(\{0,1\}^n,\oplus\right)$

The question operates on that group for $n$ of eleven. It boils down to writing the statement a equations, and solving these by applying the stated properties. If one gets stuck, there are hints in comment, and a worked solution in the other answer.

Polish
Source Link
fgrieu
  • 145.4k
  • 12
  • 319
  • 611

This question is about the properties of the bitwise eXclusive-OR operator (also known as XOR or $\oplus$), which is very common in cryptography. It's the bitwise operator for the similarly named and noted bit operator $\oplus$, which truth table is

$$\begin{array}{c|c|c|c|c|c} \text{first/left input}&a&0&0&1&1\\ \text{second/right input}&b&0&1&0&1\\ \hline \text{output}&a\oplus b&0&1&1&0 \end{array}$$

A bitwise operator operates on bitstrings of equal length, and applies a boolean operator to bits of equal ranks in its inputs to form the bit of that rank in the output. Thus the bitwise XOR operator simply applies the above table for each bits of the input. An example with $8$-bit bitstrings:

$$\begin{array}{c|c|c|c} &\text{bitstrings}&\text{binary}&\text{hexadecimal}\\ \hline \text{first/left input}&A&00110001&\tt{31_h}\\ \text{second/right input}&B&01011100&\tt{5c_h}\\ \hline \text{output}&A\oplus B&01101101&\tt{6d_h}\\ \end{array}$$

The bitwise XOR operator $\oplus$ inherits the properties of the bit operator $\oplus$:

  • associativity: $\forall X$, $\forall Y$, $\forall Z$, $\ (X\oplus Y)\oplus Z\,=\,X\oplus(Y\oplus Z)$
  • commutativity: $\forall X$, $\forall Y$, $\ X\oplus Y\,=\,Y\oplus X$
  • there's an identity element, that's the all-zero bitstring: $$\forall X,\ X\oplus{\underbrace{0\ldots0}_{|X|\text{ bits}}}\,=\,X\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}\oplus X$$ where $|X|$ is the bit width of $X$.
    Equivalently: $\forall X$, $\ X\oplus0^{|X|}\,=\,X\,=\,0^{|X|}\oplus X$.

    For $8$-bit operands as in the example above, $0^{|X|}$ is $00000000$ or $\tt{00_h}$.
  • Each element is it's own inverse (or opposite): $\forall X$, $\ X\oplus X\,=\,0^{|X|}\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}$

The first three properties are that of the internal law (equivalently: operation) of a commutative group (equivalently: Abelian group).

The last property makes saidthe group a Boolean group. Specifically, the question operates on the Boolean group of bitstrings of $k$ bits, noted $\left(\{0,1\}^k,\oplus\right)$,

The question operates on that group for $k$ of eleven.


The question It boils down to writing the statement a equations, and solving these by applying the stated properties. Follow theIf one gets stuck, there are hints in comment, orand a worked solution in the other answer.

This question is about the properties of the bitwise eXclusive-OR operator (also known as XOR or $\oplus$), which is very common in cryptography. It's the bitwise operator for the similarly named and noted bit operator $\oplus$, which truth table is

$$\begin{array}{c|c|c|c|c|c} \text{first/left input}&a&0&0&1&1\\ \text{second/right input}&b&0&1&0&1\\ \hline \text{output}&a\oplus b&0&1&1&0 \end{array}$$

A bitwise operator operates on bitstrings of equal length, and applies a boolean operator to bits of equal ranks in its inputs to form the bit of that rank in the output. Thus the bitwise XOR operator simply applies the above table for each bits of the input. An example with $8$-bit bitstrings:

$$\begin{array}{c|c|c|c} &\text{bitstrings}&\text{binary}&\text{hexadecimal}\\ \hline \text{first/left input}&A&00110001&\tt{31_h}\\ \text{second/right input}&B&01011100&\tt{5c_h}\\ \hline \text{output}&A\oplus B&01101101&\tt{6d_h}\\ \end{array}$$

The bitwise XOR operator $\oplus$ inherits the properties of the bit operator $\oplus$:

  • associativity: $\forall X$, $\forall Y$, $\forall Z$, $\ (X\oplus Y)\oplus Z\,=\,X\oplus(Y\oplus Z)$
  • commutativity: $\forall X$, $\forall Y$, $\ X\oplus Y\,=\,Y\oplus X$
  • there's an identity element, that's the all-zero bitstring: $$\forall X,\ X\oplus{\underbrace{0\ldots0}_{|X|\text{ bits}}}\,=\,X\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}\oplus X$$ where $|X|$ is the bit width of $X$.
    Equivalently: $\forall X$, $\ X\oplus0^{|X|}\,=\,X\,=\,0^{|X|}\oplus X$.

    For $8$-bit operands as in the example above, $0^{|X|}$ is $00000000$ or $\tt{00_h}$.
  • Each element is it's own inverse: $\forall X$, $\ X\oplus X\,=\,0^{|X|}\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}$

The first three properties are that of the internal law (equivalently: operation) of a commutative group (equivalently: Abelian).

The last property makes said group a Boolean group. Specifically, the question operates on the Boolean group of bitstrings of $k$ bits, noted $\left(\{0,1\}^k,\oplus\right)$, for $k$ of eleven.


The question boils down to applying the stated properties. Follow the hints in comment, or the other answer.

This question is about the properties of the bitwise eXclusive-OR operator (also known as XOR or $\oplus$), which is very common in cryptography. It's the bitwise operator for the similarly named and noted bit operator $\oplus$, which truth table is

$$\begin{array}{c|c|c|c|c|c} \text{first/left input}&a&0&0&1&1\\ \text{second/right input}&b&0&1&0&1\\ \hline \text{output}&a\oplus b&0&1&1&0 \end{array}$$

A bitwise operator operates on bitstrings of equal length, and applies a boolean operator to bits of equal ranks in its inputs to form the bit of that rank in the output. Thus the bitwise XOR operator simply applies the above table for each bits of the input. An example with $8$-bit bitstrings:

$$\begin{array}{c|c|c|c} &\text{bitstrings}&\text{binary}&\text{hexadecimal}\\ \hline \text{first/left input}&A&00110001&\tt{31_h}\\ \text{second/right input}&B&01011100&\tt{5c_h}\\ \hline \text{output}&A\oplus B&01101101&\tt{6d_h}\\ \end{array}$$

The bitwise XOR operator $\oplus$ inherits the properties of the bit operator $\oplus$:

  • associativity: $\forall X$, $\forall Y$, $\forall Z$, $\ (X\oplus Y)\oplus Z\,=\,X\oplus(Y\oplus Z)$
  • commutativity: $\forall X$, $\forall Y$, $\ X\oplus Y\,=\,Y\oplus X$
  • there's an identity element, that's the all-zero bitstring: $$\forall X,\ X\oplus{\underbrace{0\ldots0}_{|X|\text{ bits}}}\,=\,X\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}\oplus X$$ where $|X|$ is the bit width of $X$.
    Equivalently: $\forall X$, $\ X\oplus0^{|X|}\,=\,X\,=\,0^{|X|}\oplus X$.

    For $8$-bit operands as in the example above, $0^{|X|}$ is $00000000$ or $\tt{00_h}$.
  • Each element is it's own inverse (or opposite): $\forall X$, $\ X\oplus X\,=\,0^{|X|}\,=\,{\underbrace{0\ldots0}_{|X|\text{ bits}}}$

The first three properties are that of the internal law (equivalently: operation) of a commutative group (equivalently: Abelian group).

The last property makes the group a Boolean group. Specifically, the Boolean group of bitstrings of $k$ bits, noted $\left(\{0,1\}^k,\oplus\right)$

The question operates on that group for $k$ of eleven. It boils down to writing the statement a equations, and solving these by applying the stated properties. If one gets stuck, there are hints in comment, and a worked solution in the other answer.

Polish
Source Link
fgrieu
  • 145.4k
  • 12
  • 319
  • 611
Loading
Polish
Source Link
fgrieu
  • 145.4k
  • 12
  • 319
  • 611
Loading
Polish
Source Link
fgrieu
  • 145.4k
  • 12
  • 319
  • 611
Loading
Source Link
fgrieu
  • 145.4k
  • 12
  • 319
  • 611
Loading