enter image description here

I have performed the XOR and the result comes as 1001. Now my confusion is that in standard S-Box (DES) the input is 6 bit where the first and last bit together specifies row and 4-middle bits column. Even if I append two zeros on the left making the XOR result 001001, then row 01 does not exist in the problem. If I don't then row 11 i.e 3 also does not exist.

The permutation table again consists of 4-bit positions suggesting the S-Box output to be represented in 4 bits(No problem in that). I am confused with the S-Box part. Please help.

  • $\begingroup$ Thanks for the clarification. I am just starting with the cryptography and trying to learn the basics. $\endgroup$
    – Bukaida
    Feb 9, 2022 at 17:33
  • $\begingroup$ With little work, you can make a table for this, too. See the update. $\endgroup$
    – kelalaka
    Feb 9, 2022 at 17:39
  • $\begingroup$ Does this homework, I was considered not, however, could you clarify this? $\endgroup$
    – kelalaka
    Feb 9, 2022 at 18:10
  • 1
    $\begingroup$ I just came across with this problem in a website while searching for s-box related problems. I am quite grown up and fortunately do not have to do any academic home work 🙂 $\endgroup$
    – Bukaida
    Feb 9, 2022 at 19:00
  • $\begingroup$ Ok, It was better to mention it this way and provide the link, too. Normally, we only provide hints to HW questions in the comments. $\endgroup$
    – kelalaka
    Feb 9, 2022 at 19:04

1 Answer 1


You restrict yourself to DES Sbox as the only possible one. No this is not the only way, and also, DES SBox has 6-bit input and 4-bit output. Your SBox is actually a permutation and invertible. DES SBoxes are not invertible.

Your Sbox is just a row and valid. 1001 is 9 and the output of the Sbox is 10 that is 1010 in binary. You can see the AES's SBox as an alternative and note that one can write a single line for AES's Sbox, too.

Now, this is the table version of your Sbox; the least two bits determine the columns, and the rest determines the rows. For example 0100 represents column 00 and row 01

\begin{array}{|c|c|c|c|c|c|}\hline & \color{red}{00}& 01 & 10 & 11\\ \hline 00 & 7&9&1&0\\ \hline \color{red}{01}& \color{red}{2}&4&11&6\\ \hline 10& 15&10&14&13\\ \hline 11& 8&3&12&15\\ \hline \end{array}

There is no magic here. Any single line table that has $2^{2n}$ elements can be turned into $2^n \times 2^n$ table by simply writing the table in $2^n$ line and giving the first $n$bit to the column number and the rest to row numbers.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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