2
$\begingroup$

Can someone please check my work and correct me if I am wrong, I am just starting to learn about DES. I am trying to solve the following problem:

Show that S1(x1) XOR S1 (x2) != S1(x1 XOR x2).
x1 = 000000, x2 = 000001

So, we get S1(x1) first: 00 is our row, and 0000 is our column which is (0,0) and in the S1 Box table is the value 14. 14 in binary is 1110.

Now we get S1(x2): 01 is our row, and 0000 is our column which is (1,0) and in the S1 Box table is the value 0. In binary, it's 0000.

Now we XOR the two outputs:

 1110 XOR 0000 = 0001 

Thus, S1(x1) XOR S1(x2) = 0001.

Now we XOR X1 and X2 first:

 0000000 XOR 0000001 = 1111110 

Now we lookup our output in the S1 table: Our row is 10, and our column is 1111 which is (2,15) and in the S1 Box Table is the value 08 which is 1000.

Thus, 0001 != 1000. Is that correct? (And in case it isn’t, where did I take a wrong turn?)

$\endgroup$
2
  • 3
    $\begingroup$ Your XOR looks like XNOR. $\endgroup$ Commented Oct 2, 2015 at 5:42
  • $\begingroup$ In addition to using XNOR (which made you lookup from an incorrect input), it looks like you read the S1table at (1,15) rather than (2,15) as you wrote you would. And you did not detail how you split the 6 input bits into those for row and column. See page marked 14 of FIPS 46-3 for theses important details. $\endgroup$ Commented Nov 19, 2015 at 10:21

1 Answer 1

1
$\begingroup$

Your XOR equations are wrong. You wrote:

 1110 XOR 0000 = 0001 

But it's not how the XOR works. 1 xor 0 = 1, and in your example it somehow turns into 0 wich is an error. Reference the xor table: https://en.wikipedia.org/wiki/Exclusive_or

So, the correct answer for S1(x1) XOR S1(x2) is:

 1110 XOR 0000 = 1110 

and for x1 xor x2:

 0000000 XOR 0000001 = 0000001 
$\endgroup$
1
  • 1
    $\begingroup$ x1, x2, and x1 XOR x2 are bitstrings of 6 bits, not 7 bits as shown. $\endgroup$ Commented Nov 19, 2015 at 10:27

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.