Advanced Encryption Standard
Advanced Encryption Standard
The more popular and widely adopted symmetric encryption algorithm likely
to be encountered nowadays is the Advanced Encryption Standard (AES). It is
found at least six time faster than triple DES.
A replacement for DES was needed as its key size was too small. With
increasing computing power, it was considered vulnerable against exhaustive
key search attack. Triple DES was designed to overcome this drawback but it
was found slow.
Operation of AES
Interestingly, AES performs all its computations on bytes rather than bits.
Hence, AES treats the 128 bits of a plaintext block as 16 bytes. These 16 bytes
are arranged in four columns and four rows for processing as a matrix −
Unlike DES, the number of rounds in AES is variable and depends on the length
of the key. AES uses 10 rounds for 128-bit keys, 12 rounds for 192-bit keys and
14 rounds for 256-bit keys. Each of these rounds uses a different 128-bit round
key, which is calculated from the original AES key.
Here, we restrict to description of a typical round of AES encryption. Each round comprise of
four sub-processes. The first round process is depicted below −
Byte Substitution (SubBytes)
The 16 input bytes are substituted by looking up a fixed table (S-box) given in design. The
result is in a matrix of four rows and four columns.
Shiftrows
Each of the four rows of the matrix is shifted to the left. Any entries that ‘fall off’ are re-
inserted on the right side of row. Shift is carried out as follows −
MixColumns
Each column of four bytes is now transformed using a special mathematical function. This
function takes as input the four bytes of one column and outputs four completely new
bytes, which replace the original column. The result is another new matrix consisting of 16
new bytes. It should be noted that this step is not performed in the last round.
Explore our latest online courses and learn new skills at your own pace. Enroll and become
a certified expert to boost your career.
Decryption Process
The process of decryption of an AES ciphertext is similar to the encryption process in the
reverse order. Each round consists of the four processes conducted in the reverse order −
AES Analysis
In present day cryptography, AES is widely adopted and supported in both hardware and
software. Till date, no practical cryptanalytic attacks against AES has been discovered.
Additionally, AES has built-in flexibility of key length, which allows a degree of ‘future-
proofing’ against progress in the ability to perform exhaustive key searches.
However, just as for DES, the AES security is assured only if it is correctly implemented and
good key management is employed.
What is the Advanced Encryption Standard?
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
keys of 128, 192, and 256 bits. Once it encrypts these blocks, it joins them together to form
the ciphertext.
In this tutorial, you will go through some of the standout features that AES offers as a
globally standardized encryption algorithm.
Key Expansion: It takes a single key up during the first stage, which is later expanded to
multiple keys used in individual rounds.
Byte Data: The AES encryption algorithm does operations on byte data instead of bit data.
So it treats the 128-bit block size as 16 bytes during the encryption procedure.
Key Length: The number of rounds to be carried out depends on the length of the key being
used to encrypt data. The 128-bit key size has ten rounds, the 192-bit key size has 12
rounds, and the 256-bit key size has 14 rounds.
How Does AES Work?
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 matrix shown in the image above is known as a state array. Similarly, the key being used
initially is expanded into (n+1) keys, with n being the number of rounds to be followed in the
encryption process. So for a 128-bit key, the number of rounds is 16, with no. of keys to be
generated being 10+1, which is a total of 11 keys.
Add Round Key: You pass the block data stored in the state array through an
XOR function with the first key generated (K0). It passes the resultant state array
on as input to the next step.
Sub-Bytes: In this step, it converts each byte of the state array into hexadecimal,
divided into two equal parts. These parts are the rows and columns, mapped with
a substitution box (S-Box) to generate new values for the final state array.
Shift Rows: 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.
Mix Columns: 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.
Add Round Key: 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.
Now that you understand the basic steps needed to go through the encryption
procedure, understand this example to follow along.
As you can see in the image above, the plaintext and encryption convert keys to hex
format before the operations begin. Accordingly, you can generate the keys for the
next ten rounds, as you can see below.
You need to follow the same steps explained above, sequentially extracting the state
array and passing it off as input to the next round. The steps are as follows:
Add Round Key:
Mix Columns:
Now that you understand how AES works, go through some of the applications of
this encryption algorithm.