Wednesday, 16 March 2016

AES Mix Column Transformation With Example


The Advanced Encryption standard (AES) is a symmetric-key block cipher published by NIST in 2001.

To provide Security, AES uses four types of transformations:
  1. SubBytes
  2. ShiftRows
  3. MixCloumns
  4. AddRoundKey
Mix Column transformation operates at the column level.The bytes in the state column and constants matrix are interpreted as 8-bit words (or polynomials) with coefficients in GF(2)
  • Multiplication of bytes is done in GF(2^8) with modulus  (x^8+x^4+x^3+x+1)
  • Addition is the same as XORing of 8 bit words
  • In AES a byte that can be treat as a single entity ,it represented in Hex form.
     Example 8 bit 10001100  represent in 8A  in Hex




[ 02 * d4 ]  + [ 03 * bf ] [01 * 5d ] [01 * 30 ]

convert each Hex data into Binary  Example:

  • convert  binary to equivalent polynomial              
  • Example: 11010100 -> x^7 + x^6 + x^4 +x^2


t1=[ 02 * d4 ]   
   =[00000010] * [11010100]  
   =convert binary to equivalent polynomial  
   =x * (x7 + x6 + x4 + x2 )
t1= x8 + x7 + x5 + x3


t2 =[ 03 * bf ]   
    =[00000011] * [10111111]  
    =(x+1) * (x7 + x5 + x4 + x3 + x2 + x +1)
t2=(x8+x6+x5+x4+x3+x2+x+x7+x5+x4+x3+x2+x+1)
in GF(2) Addition is performed with XOR so same polynomial degree is cancelled out.
t2 =x8 + x6 + x7 +1 


t3=[01 * 5d ]  
   =[00000001] * [01011101]   
   =1 * (x6 + x4 + x3 +x2 +1)
t3=x6 + x4 + x3 +x2 +1


t4=[01 * 30 ]
   =[0000 0001] * [0011 0000]
   =1 * (x5 + x4)
t4= x5 + x4


final ans=  t1+ t2 + t3 + t4
             = x8 + x7 + x5 + x3 +x8 +x7 +1 +x6 +x6 +x4 +x3 +x2                                    +1 +x5 +x4 
  in GF(2) Addition is performed with XOR so same polynomial degree is cancelled out.
             =x2
             =0000 0100

final ans=04 (in Hex)