2
$\begingroup$

I am trying to understand how bits are spread in the PRESENT cipher. The bits that enter the permutation of PRESENT return to their original position after only three rounds. But I am told that in fact the S-boxes also affect how they spread. Specifically, when one bit enters the S-box, two or more come out. I cannot understand this as I see four going in and four coming out. A short numerical example using the PRESENT S-box would be much appreciated.

$\endgroup$
0
$\begingroup$

It's very simple. You've just gotten the wrong end of the stick. Yes, the s box is 4 bits wide. That means it contains 2^4 lookup values as:-

s box

So it can accept any input ranging from 0000 to 1111 in binary. When we say one bit goes in, we mean an active bit. This refers to the bit representing input data to the cipher that's not a zero. Think of the inputs to the s box as physical wires. Not all wires carry information all the time, but there are 4 wires permanently attached to each s box. For example, the value 0010 entering the s box is considered to be one active bit. There's just one "1", no matter it's position in the nibble. If 0010 goes in, 0110 comes out as per the PRESENT substitution above (2 → 6). There are now two "1"s to propagate further.

The concept of the active bit is important, as the combination of s boxes and permutation layers means the active bits can appear, disappear and wildly change relative position. In the above example, one active bit went in and two came out. The wires return to their original positions in three rounds, but the active bits will be all over the place as they will have effectively jumped wires. This is substitution and permutation leading to Shannon's confusion and diffusion.

There's an s box tag that will show you a huge list of related questions that might flesh out what I've written, as well as detail the nuances of a good s box. Not all s boxes are created equal.

$\endgroup$
  • $\begingroup$ The penny has dropped! $\endgroup$ – Red Book 1 Aug 8 '17 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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