AES Encryption: How It Works and Why It's Everywhere

AES Encryption: How It Works and Why It's Everywhere

A deep dive into AES โ€” the encryption standard that protects everything from government secrets to your WhatsApp messages. Learn how it works, why it was chosen, and why it remains unbroken.

Passwordly Team
10 min read

What Is AES

The Advanced Encryption Standard (AES) is the most widely used encryption algorithm in the world. It protects classified government communications, encrypts your banking transactions, secures your messaging apps, guards your stored files, and forms the cryptographic backbone of virtually every secure digital system.

AES is a symmetric block cipher, meaning it uses the same key for encryption and decryption, and it processes data in fixed-size blocks of 128 bits (16 bytes) at a time. It transforms plaintext into ciphertext through a series of well-defined mathematical operations that are easy to perform with the key and computationally infeasible to reverse without it.

What makes AES remarkable isn't just its security โ€” it's the combination of security, speed, and efficiency. AES runs fast on everything from powerful servers to tiny embedded processors. Modern CPUs include dedicated AES-NI hardware instructions that accelerate AES operations, making encryption and decryption nearly free in terms of performance.

Since its adoption in 2001, AES has been subjected to intense cryptanalytic scrutiny by researchers worldwide. No practical attack has ever been found. AES-256, the highest key-size variant, is approved by the US National Security Agency (NSA) for protecting information classified as TOP SECRET.

How AES Was Chosen

The AES story begins with the decline of its predecessor, the Data Encryption Standard (DES). DES, adopted in 1977, used a 56-bit key โ€” strong enough for the 1970s but increasingly vulnerable as computing power grew. By the late 1990s, DES could be brute-forced in under 24 hours using specialized hardware.

In 1997, the National Institute of Standards and Technology (NIST) initiated an open, international competition to select a replacement. This transparency was deliberate and unprecedented โ€” rather than developing a secret algorithm, NIST invited the world's cryptographers to submit and scrutinize candidates.

The competition process:

  1. 15 algorithms submitted from teams worldwide
  2. 5 finalists selected after initial analysis: Rijndael, Serpent, Twofish, MARS, and RC6
  3. Years of public analysis โ€” academics and security professionals attacked each finalist, looking for weaknesses
  4. Rijndael selected as AES in October 2000, officially adopted in November 2001

Rijndael, designed by Belgian cryptographers Joan Daemen and Vincent Rijmen, won for its combination of security, performance, memory efficiency, and flexibility. Serpent was considered slightly more secure (more conservative design), but Rijndael was significantly faster and more efficient โ€” a trade-off NIST judged favorably.

The open selection process is a key reason for AES's trustworthiness. It wasn't designed in secret by a government agency. It was scrutinized by the global cryptographic community before adoption and has continued to be analyzed for over two decades since.

How AES Works (Simplified)

AES processes data in 128-bit blocks through multiple rounds of transformation. Each round applies four operations:

1. SubBytes (Substitution). Each byte in the block is replaced with a different byte according to a fixed lookup table called the S-box. This introduces non-linearity โ€” a crucial property that prevents mathematical shortcuts for cracking the cipher.

2. ShiftRows (Permutation). The bytes in each row of the 4ร—4 state matrix are shifted cyclically. The first row stays in place, the second shifts by one position, the third by two, the fourth by three. This ensures that bytes from different columns get mixed in the next step.

3. MixColumns (Mixing). Each column of the state matrix is transformed using a fixed matrix multiplication in a mathematical field (GF(2โธ)). This operation spreads the influence of each input byte across multiple output bytes, creating diffusion โ€” a small change in input produces widespread changes in output.

4. AddRoundKey (Key mixing). The state is combined with a portion of the expanded key using XOR. This is where the secret key actually enters the computation. Without knowing the key, the attacker can't reverse this step.

These four operations are repeated for a number of rounds:

  • AES-128: 10 rounds
  • AES-192: 12 rounds
  • AES-256: 14 rounds

More rounds = more security, at the cost of slightly more computation. The final round omits MixColumns (because it wouldn't contribute to security at that point).

The brilliance of AES lies in the interaction between these operations. SubBytes provides confusion, ShiftRows and MixColumns provide diffusion, and AddRoundKey ties everything to the secret key. After just a few rounds, every bit of the output depends on every bit of the input and every bit of the key โ€” making any attack other than brute force infeasible.

AES Key Sizes: 128, 192, and 256

AES supports three key lengths, each providing a different level of security:

AES-128 (128-bit key):

  • 2ยนยฒโธ possible keys โ‰ˆ 3.4 ร— 10ยณโธ
  • Brute-force time at 1 billion keys/second: ~10ยฒยฒ years
  • 10 encryption rounds
  • Secure for the foreseeable future against classical computers
  • Used by most consumer applications

AES-192 (192-bit key):

  • 2ยนโนยฒ possible keys โ‰ˆ 6.3 ร— 10โตโท
  • 12 encryption rounds
  • Rarely used in practice โ€” AES-128 is sufficient for most purposes and AES-256 is used when higher security is required

AES-256 (256-bit key):

  • 2ยฒโตโถ possible keys โ‰ˆ 1.2 ร— 10โทโท
  • 14 encryption rounds
  • Required for US government TOP SECRET classification
  • Used by password managers, VPNs, and applications requiring maximum security
  • Provides a safety margin against future attacks, including quantum computing

Which should you use? For most personal purposes, AES-128 is more than sufficient. AES-256 is recommended for high-value targets, long-term data protection, and compliance requirements. The performance difference between AES-128 and AES-256 is negligible on modern hardware with AES-NI support.

To put the numbers in perspective: if every atom in the observable universe (approximately 10โธโฐ) were a computer, and each could test a billion keys per second, exhaustively searching the AES-256 key space would take longer than the age of the universe. Brute force simply isn't a viable attack against AES.

Modes of Operation

AES by itself encrypts a single 128-bit block. To encrypt data larger than 16 bytes (which is virtually all real data), AES is used with a mode of operation that defines how blocks are chained together.

ECB (Electronic Codebook): The simplest mode โ€” each block is encrypted independently. Never use ECB. Identical plaintext blocks produce identical ciphertext blocks, which leaks patterns. The famous "ECB penguin" example shows that encrypting a bitmap image with ECB preserves the visual pattern of the original image.

CBC (Cipher Block Chaining): Each block is XORed with the previous ciphertext block before encryption. This hides patterns but requires an Initialization Vector (IV) and is sequential (can't be parallelized). Widely used but being replaced by newer modes.

CTR (Counter): Uses a counter that increments for each block, generating a keystream that's XORed with the plaintext. Can be parallelized and doesn't require padding. Used in many modern protocols.

GCM (Galois/Counter Mode): Combines CTR mode encryption with authentication (GMAC). This provides both confidentiality and integrity โ€” it encrypts your data and verifies it hasn't been tampered with. GCM is the recommended mode for most applications. Used in TLS 1.3, SSH, IPsec, and many other protocols.

XTS: Specifically designed for disk encryption. Each block's encryption depends on its position on the disk, preventing blocks from being moved or swapped. Used by BitLocker and FileVault.

The key takeaway: the mode matters as much as the algorithm. AES-256 with ECB is insecure. AES-128 with GCM is excellent. Always use authenticated encryption (GCM or similar) when possible.

Where AES Is Used

AES is effectively everywhere:

Internet communications. TLS 1.3 โ€” the protocol securing HTTPS connections โ€” uses AES-GCM (or ChaCha20-Poly1305) as its encryption algorithm. Every time you see the padlock in your browser, AES is likely protecting your data.

Messaging. WhatsApp, Signal, and iMessage all use AES as part of their end-to-end encryption. The Signal Protocol (used by both Signal and WhatsApp) uses AES-256 in CBC mode for message encryption.

Disk encryption. BitLocker (Windows), FileVault (macOS), and LUKS (Linux) all use AES-256. iPhone and Android device encryption also uses AES โ€” with modern phones including dedicated hardware for AES acceleration.

Password managers. Bitwarden, 1Password, Dashlane, and KeePass all use AES-256 to encrypt your password vault. Your master password derives the AES key through a key derivation function like Argon2 or PBKDF2.

VPNs. OpenVPN uses AES-256-GCM by default. IPsec can use AES with various modes. WireGuard uses ChaCha20 instead of AES, but the two are considered equivalent in security.

Government and military. AES-256 is the standard for protecting US government classified information. NATO and numerous other governments have adopted it for the same purpose.

Financial systems. Banking networks, payment processors, and ATMs use AES to protect transaction data. The Payment Card Industry Data Security Standard (PCI DSS) requires strong encryption, and AES is the de facto choice.

Is AES Breakable?

As of 2026, no practical attack against AES exists. The best known theoretical attacks against AES-256 reduce the key space from 2ยฒโตโถ to approximately 2ยฒโตโดยทโด โ€” a mathematical achievement but completely impractical. The attack still requires vastly more computation than the entire computational capacity of the planet.

Known theoretical attacks:

  • Biclique attack (2011): Reduces AES-256 complexity from 2ยฒโตโถ to 2ยฒโตโดยทโด. This is a factor of approximately 4ร— improvement โ€” mathematically interesting but practically irrelevant.
  • Related-key attacks: Can break AES-256 under specific conditions where the attacker can observe encryption under multiple related keys. This doesn't apply to standard usage where each key is independently generated.
  • Side-channel attacks: Don't break the algorithm itself but exploit physical implementation flaws โ€” timing variations, power consumption, electromagnetic emissions, or cache behavior. Mitigated through constant-time implementations and hardware AES-NI instructions.

What could break AES?

  • A fundamental breakthrough in mathematics that finds a shortcut through AES's computational structure. No evidence suggests this is likely.
  • Implementation bugs in specific software. The algorithm is secure; the software using it may not be. This is why open-source, audited implementations are important.
  • Quantum computing (see next section).

AES and Quantum Computing

Quantum computing poses a theoretical threat to many cryptographic systems, but AES fares better than most.

Grover's algorithm โ€” a quantum search algorithm โ€” could theoretically halve the effective key length of symmetric ciphers. This means:

  • AES-128 would have effective security of 64 bits (potentially vulnerable)
  • AES-192 would have effective security of 96 bits (safe)
  • AES-256 would have effective security of 128 bits (definitely safe)

This is why many organizations are moving to AES-256 specifically: even with a future quantum computer running Grover's algorithm, AES-256 provides 128 bits of security โ€” well beyond the threshold for practical attacks.

However, there are important caveats:

Grover's algorithm requires a quantum computer large enough to process the entire AES computation simultaneously. Current quantum computers have at most a few thousand noisy qubits. Running Grover's against AES-256 would require millions of stable, error-corrected qubits โ€” a capability that most experts place at least 15โ€“30 years away, if achievable at all.

AES isn't the weak link in the quantum threat. Asymmetric algorithms (RSA, ECC) used for key exchange are far more vulnerable to quantum attack (Shor's algorithm breaks them completely). The industry priority is replacing RSA and ECC with post-quantum alternatives (ML-KEM, ML-DSA) while keeping AES for symmetric encryption.

The bottom line: AES-256 is expected to remain secure against quantum computers. Using AES-256 today provides robust future-proofing against both classical and quantum threats.


AES is the quiet workhorse of internet security โ€” protecting trillions of dollars in transactions, billions of messages, and the classified communications of governments worldwide. Its strength lies not in secrecy but in transparency: a publicly selected algorithm that's been attacked by the world's best cryptographers for over two decades and has never been broken. When you see AES-256 protecting your data, you can trust it.

Related Articles

Continue exploring related topics