AES - Perfect Notes
AES - Perfect Notes
In the AES (Advanced Encryption Standard) algorithm, the state array is a fundamental data structure
used during the encryption and decryption processes. It consists of a 4x4 matrix (or array) of bytes,
which holds the intermediate values and the input data.
Structure:
Data: Each byte in the state array corresponds to an 8-bit value, allowing it to represent the
128 bits of the AES block.
Purpose:
1. Data Storage: The state array initially holds the plaintext (or ciphertext during decryption).
2. Transformation: Throughout the AES algorithm, various operations are performed on this
state array, including:
o AddRoundKey: Combining the state with the round key using bitwise XOR.
Process:
During encryption, the state undergoes multiple rounds of transformations based on the AES key
schedule, ultimately resulting in the ciphertext. During decryption, the operations are reversed to
retrieve the original plaintext.
*************************************************************
3)we have learnt about des algorithm right which is data encryption standard
so now we are going to learn how aes algorithm will work and what are the;; how many rounds we
have in each round what happens and everything we are going to learn now
6) i'll explain you what input array state array and key array are,
7)and i will explain show you the diagram as well and as we already know this is a block cipher
algorithm; under block cipher, we have des aes blowfish idea ide algorithm and rc5 algorithm
9) first it has an array; means it has a state array and it has a input array; state array and a key array
13)so each cell is equal to 8 bits total; how many cells you have you have in total of 16 cells so that
will be equal to 16* 8 which is 128 cells we got it
14)so what is the size of the input; in case of AES alg; the size of the plain text is 128 bits got it done
now
and the size of each word will be equal to 32 bits again 4 * 32 will give you 128 okay
so the plain text whatever plain text we are having that plain text is represented as this input array
okay
so in each cell you'll have have 8 8 8 like the total 16 * 8 which is equal to 128
what is the second one we have that is the state array right
2. Structure:
o The state array consists of 16 bytes, organized in 4 rows and 4 columns. Each
element in this matrix is an 8-bit byte (0-255).
*******************************************************************
i'll show you what state array is so basically this state array is used to store all the intermediate
states
{{{{{Chat GPT explanation : Intermediate State: As the AES algorithm processes the input data
(plaintext or ciphertext), it performs a series of transformations through multiple rounds. Each of
these rounds produces a new version of the state array, which is referred to as an intermediate
state.}}
18) so, what do you mean by intermediate states, simply we can say when we are performing rounds
as i said we have 10 rounds right and
in each and every round also, you will have 3 to 4 additional steps right
whatever input see here you have total of 10 rounds right here
you are giving the plain text and here you are getting the cipher text {{{if you see below dia }}}
20)whatever you're getting in this round 1 in round2 and round 3 4 whatever it is we are not
bothered about that right
intermediate results are used can be stored in this state array right and those results will be stored in
the form of 4 words okay
21)so here this is 0th word, 1st word, 2nd word and 3rd word
so here Is 0 comma 0; means this first 0 will represent the byte and the second 0 will represent the
word
22)here also first will represent byte and the second will represent the word okay first byte of zero
with the word zero at the byte of zeroth word
second byte of zeroth word zero at the byte of first word like that
so in this way you are using the state array in order to store the intermediate results got itright
now so actually key array ; many words you have in this ; you know AES algorithm as i said in the
beginning we have four words right
and you'll have an additional round which is called as the add round key
that you will i will explain in detail when i explain this got it
Key Array :
see actually we have four words and those four are expanded into 44 got it
and i also already told you; why we need 44 words right so this is the key array
next we have the state array and then we have the key array got it
if i explain also you can easily understand the decryption since it is the reverse process of the ;
and what is the input for this 128 bit plain text and also words
here you have N rounds and for this you are giving 4 for this you are giving4
so here add round key , you will have total of ten rounds
each round will take up four words so total 44 along with add round key and then finally you will be
getting the 128 bit cipher text okay
as you know encryption is nothing but the conversion of plain text to ciphertext right
now here on this side what happens here decryption will happen
in decryption what will happen ciphertext is converted into plain text right
your decryption process also will start with add round key
but here also same process but here you will get round 10 here all right don't get confused
again in this shift rows you'll be doing the left circular shift {LCS} only like how we did in the DES
algorithm the same we will do here left circular shift is done and
the third is mixed columns and the fourth is add round key okay
in round 10 you have only 3 steps substitute bytes ;;shift rows ;;add round key only these three you
will have
you will not have the mix column step in the round 10
Useally what we will perform in Add round key means you will be performing XOR operation
between the plain text and key
it is very simple you will be performing the xor operation between the plain text and the key
so first you have the plain text right in case of encryption here you have the plain text and you have
the key as well so you will be performing the xor operation between these two got it and
here in case of decryption what we will do in add round key xor operation will be performed
between this key and the cipher text got it
the main thing that you have to remember it is it has an input array;; state array and a key
array ;;right
No of rounds 10
Blowfish algortihm