Symmetric Cryptography
Structure of AES
KeyExpansion
In this phases, the 11 separate 128 bit round_key are derived from our input key (with AES-128). Every one to be used in each AddRoundKey step.
AddRoundKey
The bytes of the first round_key are XOR'd with the bytes of the initial state.
Round
Confusion
Keep others from knowing or understanding what happened.
-
SubBytes
- each byte of the state is substituted for a different byte according to a lookup table (S-box).According to Shannon's Information Theory, for the secure cipher, just with given ciphertext, we have no way to learn anything about the key. Otherwise, we can express the relationship between ciphertext and key. For example, the Caesar cipher with
ciphertext = plaintext + key
relationship.For the linear transformations can be solved using techniques like Gaussian elimination. Even low-degree polynomials, e.g. an equation like \(x^4 + 51x^3 + x\) can be solved efficiently by algebraic methods. However, the high-degree of a polynomials can only be approximated by a larger and larger amount of linear functions.
Diffusion
Cause change of one bit in the plaintext to lead to a change as much as possible the bits of the ciphertext
-
ShiftRows
- the last three rows of the state matrix are transposed -> shifted over a column or two or three.
-
MixColumns
- matrix multiplication is performed on the columns of the state, combining the four bytes in each column. This is skipped in the final round.
AddRoundKey
- the bytes of the current round_key are XOR'd with the bytes of the state.
Encrypt Flow Chart
Decrypt Flow Chart
Modes of Operation
ECB
Property: Blocks encrypt/decrypt independently.
CBC
OFB (Stream Cipher)
The advantage of stream ciphers is that they can work plaintext of arbitrary length, with no padding required.