×

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

How to find out how much hard drive space is available?

A certain kind of non-volatile data storage device is a hard disc (called a hard drive, HD, or HDD). It is frequently installed inside a computer and attached directly to...

4 minutes read.

What is HDMI: High Definition Multimedia Interface

HDMI is one of the most frequently used audio/video interfaces, which is a connector and cable that can send high-definition, high-bandwidth audio and video streams between devices. It stands for...

3 minutes read.

How To Replace the CMOS Battery

CMOS(Complementary Metal Oxide Semiconductor) stores the information, including date, time, and system firmware setting. The CMOS battery is responsible for powering up the BIOS firmware in laptops, and that BIOS is...

3 minutes read.

What is a Taskbar?

A taskbar is a graphical user interface component that serves several functions. Usually, a list of the running apps is displayed on it. The taskbar's arrangement and specific appearance vary...

4 minutes read.

Where can I ask questions on the internet?

The internet is a great resource of knowledge and information where you can find all types of questions like imaginable questions, past answers, and much more. However, there are times...

6 minutes read.

Edge Computing

What is Edge Computing? Topics Covered What is Edge Computing?Need of Edge computingBenefits of Edge ComputingPotential industries using Edge ComputingChallenges of Edge Computing We all know about data existing in the cloud, but...

10 minutes read.

What are the disadvantages of the Internet?

Disadvantages of the Internet Every invention has two aspects, good and bad. However, for all its advantages and positive perspectives, every technology has its obscure and nasty side.  Similarly, the Internet...

5 minutes read.

Is my computer 64 bit?

While using computers and smartphones, we have often heard the term ’32-bit’ or ‘64-bit’. But many of us do know what these terms mean. And the first question which arises...

5 minutes read.

What is a Program

A program can be defined as an application used to perform a specific function. It constitutes stepwise instructions to perform a dedicated task. Multiple programs working together can form a...

4 minutes read.

What is a touch screen?

The touch screen has been proved a revolution for every sector, such as electronics, communication, the service industry and the daily lifestyle, etc. It is one of the types of...

6 minutes read.

What is an Asterisk?

The asterisk (*) is a symbol with various uses in different contexts. In mathematics, it is often used as a multiplication operator, while in computer programming, it can be used...

7 minutes read.

What is Cable Modem?

A common piece of gear that links computers to your ISP is the cable modem. A cable modem, unlike other types of modems, uses coax cable to proxy that connection...

7 minutes read.

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.

Who invented Computer?

Who invented Computer? I know this is the vert standard question which we have learned at standard 2. But, it’s not a surprise that most of the people fail to answer...

4 minutes read.

What is a Username?

As we know that technology is increasing day by day, so we must have to aware about this. In this modern world, everyone is using computer and the internet. So,...

4 minutes read.

What is Windows?

Microsoft created the desktop operating system called Windows. An operating system is a type of software that acts as an interface between the user and the hardware of a computer....

18 minutes read.

What are the Advantages of Computers?

A computer is an electrical device capable of storing, processing, and retrieving data. It can usually accomplish a range of things that make life easier. Computers conduct instructions written in...

7 minutes read.

What is Multitasking?

Multiple programs can be run simultaneously, thanks to this logical expansion of a multiprogramming system. In a contemporary computer system, the word "multitasking" is employed. The ability to multitask in...

4 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.

Receiving S.M.A.R.T. status bad backup and replacing error

S.M.A.R.T. or SMART stands for self-monitoring, analysis, and reporting technology. The computer hard drives, including HDDs and S.S.D.s, have a mechanism built into them. It is possible to utilize it...

4 minutes read.