AES Algorithm
AES Algorithm
Acknowledgment
I am borrowing slides from those sources:
Lecture slides by Lawrie Brown for Cryptography and Network Security, 4/e, by William Stallings, Chapter Chapter 5 Advanced Encryption Standard. Earlier project reports
Encryption
Encryption is transforming information (referred to as plaintext) using an algorithm (referred to as cipher) to make it unreadable to anyone except those possessing special key. The result of the process is encrypted information (referred to as ciphertext). The reverse process, i.e., to make the encrypted information readable again, referred to as decryption
Encryption Key
Symmetric-key Encryption: both the sender and receiver share the same key for encryption and decryption Asymmetric-key Encryption: two different keys are used: a public key and a private key
public key is used for encryption, and it is freely distributed private or secret key is used for decryption and must remain secret. .
128/192/256-bit keys key is expanded to array of words has 9/11/13 rounds in which state undergoes:
byte substitution (1 S-box used on every byte) shift rows (permute bytes between groups/columns) mix columns (subs using matrix multipy of groups) add round key (XOR state with key material) view as alternating XOR key & scramble data bytes
Algorithm
Each round consist of four transformation functions: SubBytes, ShiftRows, MixColumns, and AddRoundKey. There is initial transformation before first round it is AddRoundKey (called Round 0). The final round has only three transformations
Initial Input
The input of each round is 4*4 matrixes and the output is 4*4 matrixes In the Cipher, the array is called State ( S), which consists of 4 rows of bytes, each row has 4 bytes, and each byte consists of 8 bits, thus total bits of the S is 4x4x8bits = 128 bits. Each individual byte has two indices row number r with range and column number
State Array
Each individual byte has two indices row number r with range and column number
4 Transformation
Byte Substitution ( SubByte) Shift Rows Mix Columns Add Round Key
Byte Substitution
a simple substitution of each byte uses one table of 16x16 bytes containing a permutation of all 256 8-bit values each byte of state is replaced by byte indexed by row (left 4-bits) & column (right 4-bits)
eg. byte {95} is replaced by byte in row 9 column 5 which has value {2A}
S-box constructed using defined transformation of values in GF(28) designed to be resistant to all known attacks
Byte Substitution
S-Box
Shift Rows
a circular byte shift in each each
1st row is unchanged 2nd row does 1 byte circular shift to left 3rd row does 2 byte circular shift to left 4th row does 3 byte circular shift to left
decrypt inverts using shifts to right since state is processed by columns, this step permutes bytes between the columns
Shift Rows
Mix Columns
each column is processed separately each byte is replaced by a value dependent on all 4 bytes in the column effectively a matrix multiplication in GF(28) using prime poly m(x) =x8+x4+x3+x+1
Mix Columns
15
b2
46
A6
AES Round