Tuesday, January 30, 2024

AES Algorithm

A quantum-safe symmetric key encryption, and fast due to the block cipher techniques used. 
  • Convert to State Array
  • Transformations (and inverses)
    • AddRoundKey
    • SubBytes
    • ShiltRows
    • MixColumns
  • Key Expansion
1. Convert to state array

2a. AddRoundKey






2b. SubBytes (S-box)



for index 55, the s-box value is fc


2c. ShiftRows


2d. MixColumns






3. Key Expansion (new round key)



#AES round key (128 bits)
current round key = w0, w1, w2, w3 (column, vertical)
w0=column 1, w1 = c.2, w2 = c.3, w3 = c.4
g(w3) calculation:
   1) shift left, 2) apply s-box,
   3) add round constant (01,00,00,00)
new roundkey: w4, w5, w6, w7
   w4 = w0 xor g(w3), w5 = w4 xor w1,
   w6 = w5 xor w2,    w7 = w6 xor w3 
 

Example


Calculation of round key (round 1)
w3 = 01 02 14 13, shift left = 02 14 13 01, after s-box 77 fa 7b 7c, after + 1000h = 76 fa 7b 7c.
so g(w3) = 76 fa 7b 7c, then w4 = wo xor g(w3) = 74, fb 6a 7c (column one of round 1 key)
 

Algorithm



10 round = 128-bit keys
12 round = 196-bit keys
14 round = 256-bit keys 

AES-256 is considered to be quantum resistant. 







References:
1. Rijndael-Inspector - Rijndael_Animation_v4-eng.exe|swf - A flash application
2. AES-example.pdf
3. Zhou-Xuan-fulltext.pdf (Univ. of Manchester)