# AES MDS matrix: can we maintain security if we change the arrangement of elements in the matrix?

Apologies for 'unclear' question. And, 'yes' it is similar to an earlier one. I hope this is clearer.

AES uses the matrix below for the mix columns: Would security be affected if the columns (or rows) were swapped around? For example, if the first and second column were swapped to give: Would this matrix be just as secure for the mix columns?

• I am having a hard time determining exactly what you're asking. Also, this question looks very similar to a previous question of yours, and a second one as well – Ella Rose Aug 6 '16 at 20:26
• Is the resulting matrix still MDS? Which is to say, is every square submatrix invertible? If so, then it would be just as secure. If not, then not as secure. – J.D. Aug 7 '16 at 14:35

An $n\times n$ circulant matrix $A$ with all entries nonzero is known to generate an MDS matrix. Here $n$ is 4, with alphabet $GF(2^8).$

An MDS matrix guarantees maximum diffusion in the MixColumns step. See the answer to the following question how-to-calculate-active-s-boxes-from-branch-number on why the fact that the minimum (symbol) Hamming weight achieving the maximum possible value of $n+1$ is important.

As pointed out by @Amin235 the new matrix you obtain is still MDS, but not being circulant, you've sacrificed computational speed. Since all MDS codes have the same weight distribution, not only the minimum possible diffusion, but all diffusion properties for all input/output vectors are identical between your new matrix and the original AES MDS matrix.

Your new matrix is a MDS matrix. I wrote a procedure with Maple for determination of a matrix $m\times n$ like $C$ over $GF(2^n)$ with irreducible polynomial like $f$, is MDS or not.

In this procedure, $C$ is a $m\times n$ matrix and $f$ is an irreducible polynomial over $GF(2)$.