×

Advanced Encryption Standard (AES)

What is Encryption?

In cryptography, encryption is a way to convert data into secret data so that nobody can understand that except those with encryption keys.

There are various algorithms for encrypting the data, and AES is one of them, which is considered to be a very secure and fast algorithm available.

The secret converted data by the encryption is called cipher-text.

When encrypted data reaches its destination, it is decrypted by the decryption key. For various algorithms, encryption and decryption keys are different, but in AES, the same key is used for encryption and decryption. This is also called a symmetric key.

In 2001, the National Institute of Standards and Technology (NIST) established the AES algorithm.

As we know, data size can vary from KBs to GBs, so AES breaks the data into specified size blocks and then converts that block into encrypted data, and then it is transferred to the destination point.

The block size in AES is 128 bits or 16 bytes.

There are different numbers of rounds in the AES algorithm for encrypting one block of data and based on the number of different rounds, there are different sizes of keys used.

  • If there are 10 rounds, then a 128-bit key is used. It is also called the AES-128 version.
  • If there are 12 rounds, then a 192-bit key is used. It is also called the AES-192 version.
  • If there are 14 rounds, then a 256-bit key is used. It is also called the AES-256 version.

In each block, there is a key expansion algorithm that expands the key into more number of bits to encrypt the data for different rounds.

  • If there are 10 rounds, then the key is expanded into 44 words.
  • If there are 12 rounds, then the key is expanded into 52 words.
  • If there are 14 rounds, the key is expanded into 60 words.

Upper 4 words are always used in the Pre-round transformation (w0 to w3), and later at each round, 4 words are used in the AddRoundKey step.

As we have discussed, there is 128-bit data or 16-byte data in a block, so this data will be available in the form of a 4X4 matrix where each block of the matrix represents one byte of data. This matrix is called a state. After each stage, this state is updated.

By key expansion algorithm, if there are 10 rounds, the key is expanded into 44 words.

Before each round, there is a pre-round transformation where the state matrix is bitwise xor with 4 words of the key.

At each round, there are 4 steps:

1. SubBytes

In this stage, there is an s- block of 16X16 size where hexadecimal values are written. Each byte of state represents the row and column, and the value at that row and column in S-block is written back in that particular byte of state.

Suppose, there is a value 00010101 in the one-byte block of the state matrix, then the upper half byte will represent. So, the row number will be 1, and the column number will be 5.

So, in the S-block, the value at the (1,5) position will be written into the state matrix’s that particular byte.

2. ShiftRows

 In this stage, the rows of the state matrix are shifted left by some bytes.

  • The 0th row is not shifted.
  • The 1st row is shifted 1 byte left.
  • The 2nd row is shifted left 2 bytes.
  • The 3rd row is shifted left by 3 bytes.

3. MixColumns

In this stage, every column of the state matrix is multiplied by a constant matrix of size 4X4. So there are changes in the values of the state matrix.

4. Add Round Key

Now in this stage, the state matrix is XORed with 4-word keys of that round.

So these 4 steps are followed in this order for a round, and the output of this round world is input for the next round. If there is the last round, then the matrixColumns step is skipped, and the output is said as encrypted text.

If we talk about the decryption, the same steps are followed but in the reverse order.

For each round, the steps are:

  1. Add round keys
  2. MixColumns
  3. shiftRows
  4. SubBytes

In the sub bytes, an inverse S-block is used to write back the value in the state matrix.

In the mix columns, there is a different matrix used to get back the values in the state matrix.


Related Topics

What is Barcode Reader?

A barcode reader is an optical scanner and handheld or stationary input device, also known as a price scanner or point-of-sale (POS). It is an input device because it brings...

5 minutes read.

What does ALT + Q do?

It is a useful shortcut that can open the ‘tell me’ box in recent versions of the Office software. The user has to press the Alt key while holding the...

4 minutes read.

Uninstalling Software or Apps in Windows

How to uninstall software in Windows? Unwanted software can be removed from your computer's hard drive using several third-party programs and the built-in tools that Windows 10 and Windows 11 provide. Applications...

4 minutes read.

Advantages and disadvantages of Email

What is Email? A fast method of business communication is email. It is difficult to imagine a workplace where email is not used for internal and external communication. The advantages of...

3 minutes read.

How to associate a file with a program?

How to associate a file with a program in Windows? By default, a particular program is selected by the Windows to open each file type, but you may re-associate a file...

4 minutes read.

Why does my Laptop not turn on?

Your laptop's power button is pressed, but nothing happens. When your laptop doesn't turn on, there aren't many technological hiccups more annoying. You are not required to accept that your...

4 minutes read.

Autoexec.bat and config.sys Information

Basically, the Config.sys and Autoexec.bat files are made for MS-DOS and Windows 3. x to load the device and operating system to work effectively. The most recent versions of MS-DOS...

7 minutes read.

What is MsConfig?

Microsoft Windows starting issues can be resolved using the system application MSConfig. In Windows Vista, Windows 7, Windows 8, and Windows 10, it is officially called System Configuration or Microsoft...

3 minutes read.

How does a computer convert text into binary or 0's and 1's?

Before moving to know how does a computer convert text into binary, you should first know about the binary, what it is, and why it is important for a computer. When...

3 minutes read.

What is EHCI?

EHCI stands for "Enhanced Host Controller Interface." It is a specification that defines the interface between a host controller (such as a computer or other device) and a device controller...

4 minutes read.

Mouse not detected or working in Windows

One or more issues could be blocking the mouse from functioning properly in Microsoft Windows if it stops moving or doesn't appear on your monitor. Solutions on this page may...

5 minutes read.

What is accessibility

Accessibility means that website, tools and Technologies are designed and developed so that people with disabilities can use them. We usually relate accessibility with persons with disabilities, but keeping websites...

6 minutes read.

Basic Network Troubleshooting

The term Basic Network Troubleshooting means to determine the issue related to the network through a continuous process and solve them using practically examined and reliable solutions. The methods that...

9 minutes read.

What is Data?

In our daily life, you can see everybody is dealing with information and data to analyze things. Data can be of different forms and can be converted to the required...

6 minutes read.

First Generation of Computer

Computers in our world have become an integral part of our livelihood. Each task of our daily routine is related to the concept of a computer. From the Sector of...

10 minutes read.

High-Level Language in Computer

High-Level Language The high-level language is the programming language such as BASIC,C,C++,COBOL,FORTRAN,Java, Perl,PHP,Python,Ruby, Visual Basic, and Pascal, etc. These languages have strong abstraction, the style and the context which are more...

5 minutes read.

What is a Digital Assistant?

It is a voice assistant or a predictive chatbot that is programmed in such a manner that it can answer the queries of the user or can perform certain simple...

8 minutes read.

Output devices of Computer

The output devices are the hardware parts which can create the whole computer system with the combination of all hardware parts. The user can get the desired output via output...

10 minutes read.

What is Firmware?

Firmware is essential software required to perform all the tasks in your device. It is present in all the hardware equipment, allowing them to perform basic input and output operations....

10 minutes read.

What is Select All?

Selecting everything in a list or display means choosing all of the text, files, or other items. Ctrl+A selects (highlights) everything in the active window in the majority of apps....

3 minutes read.