# How to solve this S Box?

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.

• Thanks for the clarification. I am just starting with the cryptography and trying to learn the basics. Feb 9 at 17:33
• With little work, you can make a table for this, too. See the update. Feb 9 at 17:39
• Does this homework, I was considered not, however, could you clarify this? Feb 9 at 18:10
• 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 🙂 Feb 9 at 19:00
• 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. Feb 9 at 19:04

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.