Symmetric key encryption is ubiquitous in today's world - storing and transmitting information, email, even watching videos on YouTube. Strong symmetric ciphers include well-formed S-boxes. In this post, I'll walk you through the different ways to create S-boxes and compare them.
1. What is S-block
S-block is a function that takes n bits at the input, transforms them according to a certain algorithm and returns m bits at the output. S-boxes are widely used in most block ciphers. They can differ in input and output sizes (n and m), can be generated deterministically or randomly, and can also be immutable (fixed) or generated based on a key. S-boxes can be represented either as a table (as in DES) or as an algebraic Boolean function (as in AES). Important criteria when composing an S-box are its nonlinearity and the criterion for the propagation of Boolean functions. In order to view the S-box as a sequence of Boolean functions, we first understand how Boolean functions generally relate to cryptography.
2. Boolean functions in cryptography
In traditional encryption systems that translate an open message into one encrypted with a secret key, the apparatus of boolean functions is very widely used. The main requirement for them is that they complicate the decoding of the message by a person who is not its addressee.
To illustrate the use of Boolean functions, we present a stream encryption scheme, when each incoming character is immediately converted into a ciphertext character. The original text, key and ciphertext are binary strings of the same length. In practice, most often the sender and the recipient choose a pseudo-random sequence instead of a key in the Vernam cipher, which is generated from a short secret key according to the agreed algorithm. This sequence is called keystream or gamma .
, (Linear Feedback Shift Register, LSFR).
. ( ) ( ). LSFR , , LSFR.
, , L. , , .
, .
3.
- 2 ( ), - .
S- :
:
, S- :
- (). .
.
( ) :
2.
, :
, () . "".
4.
, , .
, - . :
( - , - . - , . - , - . - .
( ) . , ,
-
, - , . -.
- .
5.-
- - , . - .
, -, .
- , - . , .
, , . .
6. -
6.1
- .
1.
: .
: - - 8 .
: , :
2.
: - , , - -.
: - .
:
( -) . . 4 6 . - "" (, ), .
3.
: , , - .
: - , .
: , -
- . - , -. .
6.2 -
"" - , . , , , .
, - 6 . . . - , , - .
- , . - , - . .
. , , . , , .
, .
- -, -. . . - ( ).
- , - . , , - .
. -, - . (, 6 ). -, - .
4. ( -)
:
- ( - )
, ,
:
(1.1) (1.2) , :
-
.
:
(1.1) (1.2) , :
1.1 , ,
1.2 1 .
.
.
, (3), , - -, ; (1).
, 4 . - (. - ), (4) - , , .
7. S-
S- - , , , . ,
S-, . S-.
S-, 8- .
1. S-, ,
2. S-, ,
1 2, , S-, , S- (98 100).
3. S-, ,
, S- , S- - ( 2) (. 3). , 98, S- .
4. S-, -,
S-, - (. 4). S- 112, ( , 104). 20 S- 100, S-, - .
, - S- .
, , - S- (80, ). S- (, ) S- .
8.
, S- . , , . S-, -.
. -
Anna Grocholewska-Czurylo and Janusz Stoklosa - Random Generation of S-Boxes for Block Ciphers
Meier, W., Staffelbach, O - Nonlinearity criteria for cryptographic functions
Wikipedia - S-box (computer science)
Wikipedia - S-box
Wikipedia - Bent functions