4
$\begingroup$

I got an answer in the related question about Mixcolumn for encryption, but how about decryption?

what will I do?

Because it said that I will used this:

During decryption the Mix Column the multiplication matrix is changed to:

0E 0B 0D 09
09 0E 0B 0D
0D 09 0E 0B
0B 0D 09 0E

How does one implement this maxtrix multiplication?

$\endgroup$

2 Answers 2

12
$\begingroup$

It's pretty much the same as the forward Mix Column direction; it's a series of multiplications in $GF(2^8)$, however, instead of multiplying by 1, 2 and 3, you're multiplying by 9, 11, 13 and 14.

The multiplication rule isn't that complex; however, it is a bit fancier than the quick rule we got for $\times 2$ and $\times 3$. If you're happy with doing a table lookup, this wikipedia page gives tables of values for $x\times 9$, $x\times 11$, $x \times 13$ and $x \times 14$.

Another way to approach it is to take the rule you already know for $x \times 2$, and use it several times, as in:

$x \times 9 = (((x \times 2) \times 2) \times 2) + x$

$x \times 11 = ((((x \times 2) \times 2) + x) \times 2) + x$

$x \times 13 = ((((x \times 2) + x) \times 2) \times 2) + x$

$x \times 14 = ((((x \times 2) + x) \times 2) + x) \times 2$

(where $+$ is addition in $GF(2^8)$; you know it better as "exclusive-or")

Further explination would require me to get into the technicalities of what multiplication in a finite field actually is; I'm not sure you're quite ready for that; if you think you might be, you might want to start in on this article.

$\endgroup$
1
  • $\begingroup$ Thanks. It was very helpful. I have used the 2nd approach as I had implemented the multiplication by 2 and 3. $\endgroup$ Apr 3, 2019 at 8:27
0
$\begingroup$

For the MixColumn matrix $M$, it is true that $M^4 = I$. So, by performing this transformation trice you get its inverse ($M^3 = M^{-1}$). A little crazy, but it might be practical in certain situations.

$\endgroup$
1
  • 1
    $\begingroup$ It would be very constructive if you convert the As I remember into a real knowledge with a reference or calculation. Also, you can give and compare the number of operation required to calculate the inverse and 3rd power. $\endgroup$
    – kelalaka
    Mar 17, 2019 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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