AES internal structure (encrypted portion)

Content Reference:
layman Cryptography - principles and application of commonly used encryption technology Tsinghua University Press
Chapter 4 Advanced Encryption Standard

AES's internal structure

AES is byte-oriented code:

A state is assumed by 16 bytes consisting of a matrix manner:

Corresponding to the key K is the same in the form of a matrix.

SubBytes layer

As shown in FIGS. 4-3, the first layer of each byte is a substitution layer.
Byte substitution layer 16 can be seen as parallel cartridge s, s inputs and outputs of each cartridge are 8 bits.
Notably, 16 s using AES cartridge is identical
in this layer, each of the status bytes A I have been replaced by another byte B I : S (A I ) = B I
s cartridge substitution is a two-way mapping, i.e. 256 possible input (8) with a unique one-output, this property allows us to uniquely reversed s box, which is required for the decryption operation.
Mathematical s cassette described:
the AES s-box has a very strong algebraic structure, can be seen as a two-step mathematical transformation.

Because not realize and understand the relationship between this part of the AES are interested can look at the original book, very clear.
S to achieve some hardware box, in the end is to use a lookup table to achieve good, or calculate step by step, this first issue aside, the original book says:

Diffusion layer

AES diffusion layer consists of two sublayers confusion shift rows and columns. Diffusion refers to the influence of diffusion to the entire single bit state. It is a linear operation.

Line shift sublayer

Shift Rows transformation second row matrix state cyclically shifted to the right three bytes, the third row is moved rightward two bytes, one byte of the fourth row move to the right, the first row remains change

Column confusion sublayer

If the state after the row shift expressed as B, the state of the output column confusion represented by C, i.e. MixColumn (B) = C.
The first four output bytes is calculated, 4 * 4 matrix are fixed:

Layer key addition

Two inputs are the key addition layer and the current state matrix 16-byte length is 16 bytes subkey.
These two inputs by bitwise XOR operations together.
There are ten 128-bit AES key requires sub 11, the length is 128 bits.
Calculating sub-key is recursive, i.e., in order to obtain sub-key K I , must know K I. 1-
organized sub 128-bit AES key, K is the original key:

calculated leftmost word: i = 1 , ..., 10

remaining three words: I =. 1, ..., 10, J = l, 2,3

G () function first four bytes inverting input, and executes a byte (?) s-box substitution, addition and finally the wheel RC coefficients. Non-linear increase, the elimination of symmetry.
Round coefficient will change each round, the rules are:

Guess you like

Origin www.cnblogs.com/zhanghaha-zzz/p/11716571.html