What desirable properties should an S-box have?
My current standard selection process is to just pick them at random and verify that they fit the following criteria:
- The probability that any random two bits $S[a]_b$ and $S[c]_d$ are equal (for any random $a$, $b$, $c$ and $d$) is 50%.
- The probability that any random two bits $S[a]_n$ and $a_n$ are equal (for any random $a$ and $n$) is 50%.
- No entries exist such that $S[a] = a$
- No entries exist such that $S[a] = \bar{a}$
Are there any other important properties that need to be applied?
Edit My reasons for asking are that I wish to combine this S-Box design with a CBC mode cipher as discussed on this question.
S[a] = aprovides no benefit andS[a] = !awill always maintain the same bit "pattern" as its input. Since the idea of an S-box is to provide "confusion" (as defined by Shannon), it seems reasonable to ensure that neither of these cases are allowed. I may, however, be incorrect. – Polynomial Nov 23 '11 at 14:41