For the complete documentation index, see llms.txt. This page is also available as Markdown.

Shift Row

The "Shift Rows" operates on the rows of the 4x4 state matrix.

It shifts each row cyclically to the left by a certain number of bytes, with the shift amount depending on the row number.

input :
+-------------+
| 00 01 02 03 |
| 10 11 12 13 |
| 20 21 22 23 |
| 30 31 32 33 |
+-------------+

output : 
+-------------+
| 00 01 02 03 | --> Row 0; no shift
| 11 12 13 10 | --> Row 1; Shift 1 to the left
| 22 23 20 21 | --> Row 2; Shift 2 to the left
| 33 30 31 32 | --> Row 3; Shift 3 to the left
+-------------+

This permutation operation provides diffusion and confusion in the state matrix, which enhances the security of the AES algorithm.

Python implementation

Last updated