AES Encryption Algorithm: How It Works and Where It’s Used 

0
(0)

Have you ever wondered why no one can read your instant messaging messages or see your card number when paying online?

It’s not magic. It’s AES—one of the most secure and widely used encryption algorithms in the world. It works silently, yet protects everything literally: from bank transfers to medical records to your personal photos in the cloud.

In this article, we will discuss:

  • What is AES (Advanced Encryption Standard) and why it has become a world standard;
  • What is the difference between AES-128, AES-192 and AES-256;Step-by-stepp encryption process – from S-Box to MixColumns;
  • What is key expansion,n and why is the round constant Rcon needed?
  • Why ECB mode is dangerous, while CBC and GCM are safe- where you encounter AES every day;
  • Is it possible to crack AES—and how to use it correctly?

And most importantly, why you, even if you are not a cryptographer, should know about this algorithm.

AES – what is it? In simple terms

AES (Advanced Encryption Standard) is a symmetric block encryption algorithm adopted as an official US standard in 2001. Today, it is used worldwide, from smartphones to military systems.

Symmetric means that the same key is used for encryption and decryption. 

Block encryption means that the data is divided into blocks of a fixed size. In the case of AES, this is 128 bits (16 bytes). If the message is shorter, it is padded. If it is longer, it is split into parts.

AES replaced the outdated DES algorithm and quickly became the gold standard due to its combination of high security, high speed, and ease of implementation even on low-end devices, including microcontrollers.

Interesting fact: the original name of the algorithm was Rijndael, after the Belgian cryptographers Joan Daemen and Vincent Rijmen. NIST adapted it slightly to suit its requirements and came up with AES.

Why did AES replace DES?

Before AES, the dominant standard was DES (Data Encryption Standard), a 1970s algorithm with a 56-bit key. By the 1990s, it was clear that it could be cracked by brute force. In 1998, the Electronic Frontier Foundation built a machine called Deep Crack, which cracked DES in 56 hours.

3DES, a triple implementation of DES, was introduced. It was more secure, but three times slower and still less secure.

NIST announced an open competition for a new standard. Requirements:

  • open algorithm;
  • high speed on all platforms;
  • resistance to known attacks;
  • ease of implementation in hardware.

Rijndael emerged victorious from 15 contenders, balancing speed, safety, and flexibility.

AES-128, AES-192, AES-256: What’s the Difference?

All three variants use the same algorithm, but differ in key length and number of rounds.

AlgorithmKey lengthNumber of rounds
AES-128128 bits10
AES-192192 bits12
AES-256256 bits14

The longer the key, the more possible combinations. Trying all possible combinations for AES-128 would take billions of years even on the most powerful supercomputers. Meanwhile, AES-256 is considered virtually invulnerable even to quantum attacks.

It’s important to note that AES-128 is sufficient for most applications. AES-256 is only justified in systems with higher requirements, such as in banking or the military.

How AES Works: Step-by-Step

AES transforms a 128-bit block of data in several repeated steps called rounds. All operations occur on a 4×4 byte matrix—this is your block.

Each round (except the last one) consists of four steps:

1. SubBytes – Nonlinear Substitution via S-Box

Each byte is replaced by another according to a special table called the S-Box. This table is based on the mathematics of the finite field GF(2⁸) and makes the cipher nonlinear, which is critical for protection against analysis.

First, the inverse of a byte is found in a Galois field. Then, an affine transformation—a complex bit permutation—is applied to the result. This ensures an “avalanche” effect: even changing a single bit in the original data radically alters the ciphertext.

Why is this important? Without nonlinearity, the cipher could be cracked using linear cryptanalysis.

The Galois field GF(2⁸) is a special mathematical system in which numbers from 0 to 255 are added and multiplied according to strict rules that differ from ordinary arithmetic. These rules are what make the cipher resistant to cracking.

2. ShiftRows – shift rows

The rows of the matrix are cyclically shifted to the left:

  • 1st – does not change;
  • 2nd – 1 position;
  • 3rd – by 2;
  • 4th – by 3.

This creates diffusion: bytes from one column are moved to different ones, and in the next step will be mixed with different data.

3. MixColumns – mixing columns

Each column is multiplied by a fixed matrix in the Galois field GF(2⁸). This ensures that every byte in a column influences every other byte.

Simplified:

A’ = 2 A ⊕ 3 B ⊕ C ⊕ D

(where ⊕ is XOR, and multiplication is in a Galois field).

In the last round, MixColumns is not applied – by this point the data is already sufficiently mixed.

4. AddRoundKey – adding a round key

The state is XORed modulo 2 with the round key, which is part of the extended secret key. This is the only step that depends on the key. Everything else is a public algorithm.

XOR is a reversible operation: if C = A ⊕ K, то A = C ⊕ K. This allows for easy decryption of data given the key.

How are round keys generated? Key Expansion

The initial key (128/192/256 bits) is not used directly. Key Expansion is performed first, a process that generates Nr + 1 round keys.

It works like this:

  1. The original key is split into 4-byte words.

New words are generated using the formula:

W [ i ] = W [ i- 1 ] ⊕ T ( W [ i- 4 ]) ,
  1. where T is a function that includes:
    • cyclic shift;
    • replacement via S-Box;
    • XOR with round constant Rcon.

Why is Rcon needed? Without constants, all round keys would be symmetric, and the cipher would be vulnerable. Rcon breaks this symmetry.

Example: AES-128 requires 11 keys (10 rounds + seed). The 16 bytes of the seed key generate 176 bytes of the schedule.

AES operating modes: CBC, ECB, GCM, and others

AES itself only encrypts a single block (128 bits). To encrypt a longer message, operating modes are used.

ECB (Electronic Codebook) – simple but dangerous

Each block is encrypted independently. Identical blocks → identical ciphertext.

A simple example of the vulnerability of this mode of operation: if you encrypt an image in ECB, the silhouettes of objects will remain visible—because identical pixels produce the same ciphertext.

Never use ECB in real systems.

CBC (Cipher Block Chaining) is the de facto standard

Each block is XORed with the previous ciphertext before encryption. For the first block, an initialization vector (IV)—a random value—is used.

Requirements for IV:

  • Must be unique for each encryption;
  • It may be public, but it is not predictable.

CBC is used in TLS, BitLocker, and OpenVPN.

GCM (Galois/Counter Mode) is a modern standard

Combines counter-mode encryption (CTR) with Galois field authentication. It verifies that the ciphertext has not been tampered with.

Advantages of this operating mode:

  • High speed (parallelization);
  • Built-in protection against data substitution.

Used in HTTPS (TLS 1.2+), Wi-Fi (WPA3), SSH.

Is AES secure today?

Of course it is safe if implemented correctly.

  • Brute-forcing an AES-128 key requires ~2¹²⁸ operations. This is physically impossible even for supercomputers.
  • AES-256 is even more resistant to quantum attacks (Grover’s algorithm reduces the difficulty to 2¹²⁸, which is still unrealistic).

But the vulnerabilities arise not in AES itself, but in its implementation:

  • Timing attacks: if encryption time depends on the key.
    Protection: use AES-NI hardware acceleration.
  • Cache attacks: leak through the processor cache.
    Defense: constant execution time.
  • Weak IV: Repeating vector in CBC.
    Security: Always use a cryptographically strong random number generator.

Where is AES used?

  • HTTPS/TLS — encryption of web traffic between the browser and the server.
  • Wi-Fi – WPA2 and WPA3 use AES in CCMP mode (based on CBC/GCM).
  • Disk encryption – BitLocker (Windows), FileVault (macOS), LUKS (Linux).
  • Messengers — Signal, WhatsApp, Telegram (local storage encryption).
  • Blockchain and cryptocurrencies – protecting private keys in wallets.
  • Government and military systems – AES-256 is approved for protecting classified information.

AES is a mandatory component of FIPS 140-2/3, the standard for cryptographic modules in the United States.

Hardware implementation: AES-NI

Since 2010, Intel and AMD have been integrating AES-NI (Advanced Encryption Standard New Instructions) into their processors.

Advantages:

  • Encryption is 10-20 times faster;
  • Protection against timing attacks;
  • Energy efficiency (important for mobile devices).

Thanks to AES-NI, disk encryption or HTTPS traffic places almost no load on the CPU.

Practical Tips: How to Use AES Correctly

  1. Don’t write your own AES — use proven libraries: OpenSSL, libsodium, Bouncy Castle.
  2. Select mode: GCM > CBC > ECB (never).
  3. Generate IV randomly – via /dev/urandom or crypto.getRandomValues().
  4. Don’t use static keys – use session keys.
  5. Enable AES-NI if available.
  6. Test the implementation using NIST test vectors.

AES in Brief

  • AES is a symmetric block encryption algorithm with a 128-bit block.
  • There are three variants: AES-128, AES-192, and AES-256. The latter is the most secure.
  • Works in the following modes: ECB (dangerous), CBC (popular), GCM (recommended for new systems).
  • The initialization vector (IV) must be unique for each session.
  • Used everywhere: HTTPS, Wi-Fi, instant messengers, archivers, OS.
  • Considered virtually unhackable when used correctly.
  • Often works in tandem with RSA: RSA transmits the key, AES encrypts the data.

AES isn’t just an algorithm. It’s the foundation of trust in the digital world. Thanks to it, you can:

  • pay for purchases online with a card;
  • store your photos in the cloud;
  • communicate in instant messengers without fear of surveillance;
  • Connect to public Wi-Fi without risk.

It is reliable, fast, standardized, and proven over decades of use.

You don’t need to memorize how MixColumns or S-Box work. But it’s helpful to understand: if something says “AES-256 encryption,” that’s a good sign. However, if it says “AES in ECB mode,” that’s a warning sign.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?


Explore More IT Terms


Share this term: Facebook X LinkedIn WhatsApp Email

Leave a Reply

Your email address will not be published. Required fields are marked *