0
$\begingroup$

I am aware that MixColumns is a mixing operation which operates on the columns of the state, combining the four bytes in each column. So we multiply our state with the special matrix. To multiply, we’re computing many dot products. And for each dot product, we’re multiplying bytes as Galois fields $\pmod 2$, then reducing the answers $\bmod$ the magic polynomial: $x^8+x^4+x^3+x^1+x^0$.

Thankfully, the entire task can be greatly sped up by using a few look-up tables. The multiplication matrix consists of Galois fields for $1,2,3$. So we can pre-compute the results of all 256 eight-bit Galois fields (the possible bytes in our state) multiplied by these values.

How will I implement the inverse MixColumns for decryption process?

$\endgroup$
  • 1
    $\begingroup$ Hint: to undo multiplication by a matrix, multiply by the inverse of the matrix. $\endgroup$ – fgrieu Sep 25 '18 at 8:25
  • 1
    $\begingroup$ Please don't cross site question stackoverflow.com/questions/52491440/… $\endgroup$ – kelalaka Sep 25 '18 at 17:15
4
$\begingroup$

MixColumns implements a matrix multiplication, so InvMixColumns is the multiplication by the inverse of that matrix. Thus, it boils down to computing the inverse of the matrix. It can be tedious to do by hand, but it involves only straightforward computations. Alternatively, look up the AES standard itself (FIPS 197): the inverse matrix is spelled out explicitly in section 5.3.3.

More generally, FIPS 197 is quite readable (as standards go) and if you want to know how AES works, it is recommended to read it through (and in particular section 4, that gives some details on the underlying mathematics).

$\endgroup$
1
$\begingroup$

Once you inverted the Mix Column Matrix,

$$ InverseMix Column = \begin{bmatrix} 0E & 0B & 0D & 09\\ 09 & 0E & 0B & 0D\\ 0D & 09 & 0E & 0B\\ 0B & 0D & 09 & 0E\\ \end{bmatrix} $$

you can use the E and L tables. see an example at

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.