AES Encryption Algorithm: How It Works and Where It’s Used
- AES – what is it? In simple terms
- Why did AES replace DES?
- AES-128, AES-192, AES-256: What’s the Difference?
- How AES Works: Step-by-Step
- How are round keys generated? Key Expansion
- AES operating modes: CBC, ECB, GCM, and others
- Is AES secure today?
- Where is AES used?
- Hardware implementation: AES-NI
- Practical Tips: How to Use AES Correctly
- AES in Brief
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.
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:
(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:
- The original key is split into 4-byte words.
New words are generated using the formula:
- 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
- Don’t write your own AES — use proven libraries: OpenSSL, libsodium, Bouncy Castle.
- Select mode: GCM > CBC > ECB (never).
- Generate IV randomly – via /dev/urandom or crypto.getRandomValues().
- Don’t use static keys – use session keys.
- Enable AES-NI if available.
- 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.
Explore More IT Terms
#
A
- A Guide to SQL Query Formatting
- A/B testing
- AES Encryption Algorithm: How It Works and Where It's Used
- Agile
- Algorithm
- Algorithm complexity in 5 minutes
- Algorithms and Data Structures in C#
- An overview of the C # programming language
- An overview of the Python programming language
- Anaconda Python
- Android
- Android App Bundle
- Android SDK
- Angular
- Ansible
- Apache
- Apache Airflow
- Apache Kafka
- Apache Tomcat
- App Store
- AppCode
- Applications of microcontrollers: From simple circuits in electronics to complex systems
- Applications of the derivative
- Arduino: How to Program It: Basics for Beginners
- Array-based stack
- ArrayList
- ASCII
- ASP.NET
- Assembly Language Lessons
B
C
D
- Data Analytics: applications of data analysis in companies
- Data Engineer - Who is it, what does a data engineer do, and an overview of the profession
- Data modeling: what it is, types, and process steps.
- Data preprocessing: a complete guide for beginners and professionals.
- Data structure
- Database Tests with Answers
- Deep Learning
- Defining Aliases
- Defining Arrays
- Deque
- Developing a Website from Scratch
- Differential Equations
- Differentiation of functions
- Digital data: understand the importance of this asset for businesses.
- Double integrals
- Doubly linked lists
E
F
H
- Handling errors and exceptions
- Heads or Tails? How Probability Theory Is Used in IT
- History of the development of computer science
- How to effectively organize your workflow
- How to Learn Java: Tips for Beginner Developers
- How to Learn PHP: A Beginner's Guide
- How to Use S3 Storage in Kubernetes with CSI
- HTML
- HTML and CSS: Definition, Application, and Operating Principles
- HTML and CSS. Layout from Scratch: What to Learn, Where to Learn, and How Long Will It Take?
- HTML Frame Structure
- HTML Link Formatting
I
- if..else construction
- Infinite sequences and series
- Information properties
- Inheritance in Java: A Complete Guide to Principles and Implementation
- Inserting an Image
- Integration of functions
- Interactive Python Tutorial – Learn Programming from Scratch
- Interpreter
- Interview Problem: Finding a Deleted Element in O(N)
- Interview Scare: The FizzBuzz Challenge
- Introduction to C++
- Introduction to Machine Learning
- Introduction to Networking | Network Fundamentals Part 1
- Introduction to Number Systems (Binary, Octal, Hexadecimal) | Math for CS Foundations #1
- IT Specialist Resume (CV)
J
K
M
- Machine Learning
- Machine Learning Basic Tool: NumPy
- Machine Learning Basic Tool: Pandas
- Machine Learning Mathematics
- Mathematics for programmers: what is really needed?
- MD5 encryption algorithm: What is it and why is it needed?
- Microcontroller and Microprocessor - what's the difference?
- ML Engineer: Who They Are, What They Do, How Much They Earn, and How to Become a Neural Network Specialist
- Monte Carlo Simulation: How It Works and What It's For
O
P
- PHP lessons
- Private DNS server and its configuration
- Program code
- Programmer's Dictionary
- Programming
- Programming with pseudocode
- Python Code Formatting Guide: PEP8
- Python for data analysis: how to do it and main libraries
- Python Lessons
- Python Superstar: 5 Ways to Use the * Operator
- Python vs. Julia: Should You Replace Python with Julia?
R
S
- SFML Graphics Library Tutorials
- Sorting Algorithms in Programming: Types, Descriptions, and Comparisons
- SQL commands: see what they are, what the main ones are + examples
- SQL Interview Questions and Tasks
- SQL Lessons
- SQL Stored Procedures
- SQL Syntactic Sugar: The COALESCE Function
- Stack
- Start in analytics: Python or R
- Statistical analysis: importance for decision making.
- String formatting in Python
- Structure of computer science
- Swift Lessons
- switch/match construct
- Syntax
T
- Terms in programming
- Text and paragraph formatting tags
- The concept of information and its transmission
- The Future of Python: Key Trends and Insights from Global Researc
- The Infrastructure of Code: A Complete Guide to Repositories for Languages, Frameworks, and Compilers
- The pip package manager in Python
- The role of informatization in the development of society
- Transfers
- Tutorials / Articles
- TypeScript: What It Is and Why Developers Need It
W
- What are databases, and why do they need DBMS and SQL?
- What do Linux distributions consist of?
- What is .NET and what is it used for?
- What is a GPU in a computer, in simple terms?
- What is Arduino: How it Works and the Platform's Capabilities
- What is Big Data? Introduction, Types, Characteristics, and Examples
- What is Golang and what is it used for?
- What is Haskell and what is it used for?
- What is Kotlin and what is it used for?
- What is Linux? The History of Linux
- What is machine learning, and how does it work?
- What is Power BI: everything about the data analytics software
- What is the C++ programming language?
- What is the OSI Model: A Complete Explanation of the Seven Layers and Their Role in Networking
- What's the difference between x86 and ARM processors?
- Where to start learning the C programming language?
- Which Linux distribution should you choose? A Linux distribution overview





