Say I wanted to change the order of the 4 steps within a round in AES, would it change the final result?
Asked
Active
Viewed 478 times
1 Answers
4
We have four components of AES round function:
SubBytesperforms per-byte substitution operation.ShiftRowsis a permutation of bytes of the state.MixColumnsis a function that works on each column of the state.AddRoundKeyadds 128 bits of the round key to the corresponding bytes of the state.
The only two operations (that follow each other in the original order) that commute are SubBytes and ShiftRows since the first works independently on each byte (and the operation for each byte is the same) and the second one just reshuffles the bytes.
If you swap e.g. MixColumns and AddRoundKey you will get a different result, because instead of adding the round key $rk$ you will effectively add MixColumns($rk$) which is a different value for non-zero round key.
Kris
- 632
- 4
- 8
-
1Yet the swap of
MixColumnsandAddRoundKeyis possible, if one adjust the key injected byAddRoundKeyby first applyingInvMixColumnsto the key (that's necessary to obtain the same result as the original AES). That's part of why there is noMixColumnsin the last round:AddRoundKeyandMixColumnsare close enough to commutative thatMixColumnsin the last round would have little cryptographic value. – fgrieu Nov 30 '20 at 14:47 -
1@fgrieu: Correct, it's possible but as you pointed out it needs a modification of the key schedule, so it may not count as the original AES. – Kris Dec 02 '20 at 09:17
ShiftRows and SubBytes are commutative, They are not commutative MixColumns– kelalaka Apr 10 '20 at 13:13