Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

XOR 0000
  = 0001 

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

Now we XOR X1 and X2 first:

 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?)

share|improve this question
Your XOR looks like XNOR. – otus Oct 2 '15 at 5:42
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. – fgrieu Nov 19 '15 at 10:21

Your XOR equations are wrong. You wrote:

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:

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

XOR 0000
  = 1110

and for x1 xor x2:

XOR 0000001
  = 0000001 
share|improve this answer
x1, x2, and x1 XOR x2 are bitstrings of 6 bits, not 7 bits as shown. – fgrieu Nov 19 '15 at 10:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.