# Does changing the order of the steps within a round affect the security of AES?

I was trying to understand the internal structure of AES (Advanced Encryption Standard)

Standard order of steps within a round:

1. Substitute Bytes
2. Shift Rows
3. Mix Columns

Substitute Bytes, Shift Rows & Mix Columns satisfies the two most important properties required for a secure cipher i.e confusion and diffusion

Substitute Bytes provides Confusion i.e. that each binary digit (bit) of the ciphertext should depend on several parts of the key.

Shift Rows along with Mix Column provides Diffusion i.e. if we change a single bit of the plaintext, then (statistically) half of the bits in the ciphertext should change

Changing order of Step 1 and Step 2 won't have any affect. But to what extent can we change the order of other steps? Does it weaken the security of AES, and if so, how?

Changing the order of the operations does not weaken the security of $\mathop{AES}$ (nor does it increases it).

Remark: While ShiftRows and SubBytes are commutative ($f\ g : A \rightarrow A,\ f \circ g = g \circ f$). They are not commutative MixColumns. Therefore changing the order of operations will not produce the same result. But this is not relevant because we are looking from the security point of view.
• He also mentioned the fact that the MixColumns had to be the last step so that you can apply it to the key and therefore have a similar structure for encryption and decryption (also explained in the end of Chapter 3 of his book). – Biv Oct 27 '16 at 14:58