In the encryption of MixColumn you use the constants 01, 02 and 03. I don't understand why the inverse of 01 becomes both 0D and 09. I also don't understand how you get 01, 02 and 03 in the first place which is probably why the decryption doesn't make sense to me. I would appreciate any help with understanding how to calculate these values.
-
$\begingroup$ Note that the elements of the inverse matrix are not the inverses of the individual elements; hence 0D and 09 are not "inverses" of 01 $\endgroup$– ponchoCommented Dec 10, 2018 at 19:35
-
$\begingroup$ and, you calculate the inverse of the matrix in $GF(2^8)$ see How to invert matrix in finite field $\endgroup$– kelalakaCommented Dec 10, 2018 at 19:36
1 Answer
The MixColumns
$MC$ and InvMixColumns
$IMC$ implement matrix multiplications. These two matrices defined over Galois Field $GF(2^8)$ and they are inverse of each other.
$$MC \times IMC = I_4$$
To find the inverse, one can use the Gaussian Elimination method. But finding the inverse a bit tricky, since you will need the inverse of the pivot elements. The inverse in $GF(2^8)$ can be found by using the Extended Euclidean Algorithm.
In general, instead of calculating the inverse, the invMixColumn matrix copied from FIPS 197 or AES submission of Rijndael.