The AES Encryption algorithm (also known as the Rijndael algorithm) is a symmetric block cipher algorithm with a block/chunk size of 128 bits.
It converts these individual blocks using key of 128 bits. Once it encrypts these blocks, it joins them together to form the ciphertext.
To understand the way AES works, you first need to learn how it transmits information between multiple steps.
Since a single block is 16 bytes, a 4x4 matrix holds the data in a single block,
with each cell holding a single byte of information.
The hexadecimal text is mapped with a AES substitution box (S-Box) to generate new values i.e, creating confusion.
It swaps the row elements among each other. It skips the first row.
It shifts the elements in the second row, one position to the left.
It also shifts the elements from the third row two consecutive positions to the left,
and it shifts the last row three positions to the left.
It multiplies a constant matrix with each column in the state array
to get a new column for the subsequent state array.
Once all the columns are multiplied with the same constant matrix,
you get your state array for the next step.
This particular step is not to be done in the last round.
The respective key for the round is XOR’d with the state array is obtained in the previous step.
If this is the last round, the resultant state array becomes the ciphertext for the specific block;
else, it passes as the new state array input for the next round.
In AES algorithm the key is expanded into 10 keys successively by an operation called key schedule round.
We take the last column of the previous round key and move the top byte to the bottom.
Then, we pass each byte through an SBOX to create confusion
Then,we XOR the column with a specific round constant different for each round
We XOR it with the first column of the previous round to get the first column of the key of this round.
We XOR the previous column with the same column of the previous round key
Voila! We are done with the explanation for how AES works.