0
$\begingroup$

I'm given the following table: enter image description here

I'm told to find the output given an hexidecmal input of 2B. I know that 2B in binary = 001 01 011

So I took the first two and last two outer bits (0011) to find the first row which is row 3.Then I took the remaining bits (10 10) to find number 10 on the top row. Matching up the values I get a final answer of 3, which is 11 in binary. But the correct answer is 1001 which is 9 in decimal. I have no idea where I have gone wrong here. I followed the procedure for 6 bit number, but I do feel like I'm missing a key element on how to solve this for a 8 bit number.

$\endgroup$
1
$\begingroup$

The S-Boxes of DES map from 6 bits to 4 bits. $2b$ written in binary representation is $10\ 1011$, not $001\ 01\ 011$ as you said. Now taking the first and last bit (as usual for DES S-boxes) yields us $11_{bin} = 3_{dec}$ which is the last row in your table. Taking the middle 4 bits equals to $0101_{dec} = 5_{dec}$. Now we can read the final result from the table as $9_{dec} = 1001_{bin}$

$\endgroup$
  • $\begingroup$ Isn't the first bit 0, and the last bit 1? How come the first bit is 1? I see 001, do I not include leading zeroes? $\endgroup$ – rrrrrr Apr 19 '18 at 3:15
  • $\begingroup$ Yes, you need leading zeroes, but only until you got 2 digits for the first digit of your s-box input. 6 bits go from $00_{hex}$ to $3f_{hex}$, so the first digit always has two digits in binary representation and the second one always has four. $0_{dec} = 00_{bin}, 1_{dec} = 01_{bin}, 2_{dec} = 10_{bin}, ...$ $\endgroup$ – Nova Apr 19 '18 at 3:31

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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