Cryptographic algorithms can be ordered into two unique classes dependent on the key they use for encryption and decryption. The class of cryptographic algorithms that utilizes two distinct keys for both encryption and decoding are known as asymmetric key algorithms. RSA is a case of such a class. The cryptographic algorithms that depend on utilizing a similar key for both the processes are known as symmetric key algorithms. Data Encryption Standards (DES), Blowfish, Advanced Encryption Standards are a few instances of this class. AES works by encoding a block of size 128 bits and has a key length of 128 bits, 192 bits, and 256 bits so giving the AES principles the name as AES-128, AES-192 and AES-256 with every standard utilizing a series of 10, 12 and 14 separately. In AES, the whole information is handled in equal during each round. At present AES-128 is most commonly in use. So, the description of AES is based on the implementation of this particular standard.
Three most important criteria based on which the AES standards were formulated are:
-
The algorithm should resist all known attacks.
-
The algorithm should be designed in a simple way.
-
The algorithm should be effective in terms of speed and code compactness on different platforms.
The general working progression of AES is shown in Fig. 1 underneath. A solitary 128-piece block is taken care of as contribution for both encryption and decryption and is known as the in matrix. This block is duplicated into a state array and afterward replicated to a output matrix. The state array is changed at each phase as the calculation advances. The key is then ventured into a variety of the key array of words which is known as the w matrix.
3.1. Inner Working of Each Round in AES-128
AES starts with an AddRoundKey stage followed by four sub-stages for the first 9 rounds and three sub-stages for the tenth round. This process is the same for both encryptions is decryption with the only difference being that in decryption each of the sub-stages is inversed. The four stages of encryption are: Substitute Bytes, Shift Rows, Mix Columns, Add Round Key
The tenth round is left to work only with three sub-stages and hence the Mix column step is not formulated. Similarly, the inverse all these steps is used in decryption.
The four steps of the encryption process are briefed herein.
Substitute Bytes
This stage ordinarily known as SubBytes is basically a table query from a s-box which is a 16X16 network of bytes. The originator of AES concentrated on planning the s-box which is impervious to all conceivable cryptanalytic attacks. Thus, a low relationship between's the info bits and the output bits was of most extreme significance. This was made conceivable by limiting both the relationship between's straight changes of information/output bits and contrast proliferation likelihood simultaneously. The reverse SubByte utilizes a converse s-box.
Shift Rows Transformation
This stage known as ShiftRows is a basic change where the first row of the state is left unaltered. A roundabout move by 1 byte to one side is done in the subsequent row followed by a round move by 2 bytes and 3 bytes to one side for the third and the fourth row individually. The backward ShiftRow activity is completed along with these rows by moving every one of the last three columns the other way.
Mix Columns Transformation
This progression known as MixColumn is fundamentally a replacement that utilizes arithmetic of the Galois Field regularly known as GF (28). The state containing the matrix works on the singular columns of the matrix independently. Every byte in a column is mapped into another column which is an element of each of the four bytes in the matrix. Every component of the resultant product matrix is the total of results of components of one row and one column where the individual augmentations and duplications are acted in GF (28).
Add Round Key Transformation
In this step, the bitwise xor activity is performed on the 128 bits of state and 128 bits of the round key.
3.2. Modes of Operations
Block ciphers mode of operations allows encrypt/decrypt of messages larger than the length of the block. Two of the modes namely Cipher Block Chaining (CBC) and Counter (CTR) are explained below
Cipher Block Chaining (CBC)
One of the most sought after characteristic of any encryption algorithm is that it should be capable of producing a different cipher text each time the same plain text is encrypted. The CBC mode of operation allows this. The first round is XORed using an Initialization Vector (IV). The same key is used for each block. The property of XOR operation is used herein which supports getting back the decrypted message by XORing the cipher texts. The CBC mode of operation for the process of encryption is shown in Fig. 2 below
Counter (CTR): In the CTR method of activity, a counter equivalent to the length of the plain content block size is utilized. The counter worth must be distinctive for each plain text block being encoded. During encryption, the counter is encrypted and afterward XORed with the plain content block to get the cipher text. For decoding, a similar counter an incentive for each block is XORed with the cipher text to get back the message in its original structure.
Computational Complexity of AES-128
The block cipher algorithms work normally on fixed block size. AES-128 works by encrypting a fixed block of length 128 bits and takes approximately the same time despite varying input. Thus AES-128 can be termed to be O (1) for both encryption and decryption. If one wants to encrypt messages larger than 128 bits then they need to put them into one of the modes of operations. In such case, as we have O (n) blocks of data to encrypt/decrypt, this brings the order of complexity to O (n), where n is considered to be the size of the message to be encrypted/ decrypted. So, the time complexity of AES-128 for both encryption and decryption in any of the standard modes of operations like CBC or CTR is polynomial or to be more precise is linear with respect to the size of the message. This can be justified in the following paragraph.
This concludes that AES-128 with any standard modes of operation has a run time complexity of O (n), where n is the length of the message.