A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Authenticated Encryption

Research Depth 98 in the knowledge graph ☐ I know this ☆ Set as goal
517prerequisites beneath it
See this on the map →
Message Authentication Codes (MACs)Modes of Operation: CBC, CTR, and GCM→
aead encrypt-then-mac gcm chacha20-poly1305 chosen-ciphertext

Core Idea

Authenticated encryption (AE) combines confidentiality and integrity in a single primitive, guaranteeing that ciphertext cannot be read or tampered with. AEAD (AE with Associated Data) additionally authenticates unencrypted metadata (headers, routing info). The correct generic composition is encrypt-then-MAC (encrypt first, then MAC the ciphertext). MAC-then-encrypt and encrypt-and-MAC have led to devastating attacks (padding oracles, BEAST, Lucky13). Dedicated AEAD constructions (GCM, ChaCha20-Poly1305, OCB) integrate encryption and authentication for efficiency and resistance to misuse. AE is the modern standard — standalone encryption without authentication is considered a design error.

Explainer

For decades, cryptographic textbooks taught encryption and authentication as separate concerns. Encryption hides the message; MACs ensure integrity. In practice, you need both — but how you combine them matters critically. Authenticated encryption (AE) integrates confidentiality and integrity into a single primitive, eliminating the composition pitfalls that have caused some of the most devastating attacks in the history of deployed cryptography.

The history of composition failures is instructive. MAC-then-Encrypt (compute MAC on plaintext, then encrypt both) was used in TLS through version 1.2. The problem: the receiver must decrypt before checking the MAC, and the decryption process can leak information through error behavior. CBC-mode decryption produces different error types for valid and invalid padding, creating a padding oracle that an attacker can exploit to decrypt the entire ciphertext byte by byte. The BEAST, Lucky 13, and POODLE attacks all exploited this pattern in real TLS implementations. Encrypt-and-MAC (encrypt plaintext, separately MAC plaintext) risks leaking plaintext information through the MAC tag, since MACs are not required to hide their input. Only Encrypt-then-MAC (encrypt plaintext, MAC the ciphertext) is generically secure: the MAC is verified before any decryption occurs, so invalid ciphertexts are rejected without processing, eliminating oracle attacks entirely.

Modern cryptography avoids these pitfalls by using dedicated AEAD (Authenticated Encryption with Associated Data) constructions that integrate both operations. AES-GCM combines CTR-mode encryption with a polynomial MAC (GHASH) computed over the ciphertext and any unencrypted associated data. ChaCha20-Poly1305 pairs the ChaCha20 stream cipher with the Poly1305 MAC, offering excellent performance on platforms without hardware AES acceleration. Both are AEAD schemes: a single function call takes a key, nonce, plaintext, and associated data, and produces a ciphertext with an integrated authentication tag. Decryption either succeeds (tag verifies, plaintext returned) or fails atomically (tag invalid, nothing returned) — no partial decryption leakage.

The "associated data" in AEAD is a crucial feature. Some data must be authenticated (tamper-proof) but not encrypted (visible to intermediaries). Network headers, database row identifiers, and protocol version numbers are examples: they provide context that must be bound to the ciphertext but readable by routing infrastructure. AEAD binds all of this — the encrypted payload plus the unencrypted associated data — under a single authentication tag. Modifying any bit of either the ciphertext or the associated data invalidates the tag. This comprehensive binding is why AEAD is the mandatory encryption mode in TLS 1.3, IPsec, QUIC, and essentially every modern security protocol. Standalone encryption — encryption without built-in authentication — is now considered a deprecated practice.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Finite State Machines (FSMs) → Deterministic Finite Automata (DFA) → Nondeterministic Finite Automata (NFA) → Two-Way Finite Automata → NFA to DFA Conversion (Subset Construction) → DFA Properties and Minimization Algorithms → Regular Languages: Definition and Characterization → Context-Free Grammars (CFGs) → Pushdown Automata (PDA) → Equivalence of CFGs and Pushdown Automata → Closure Properties of Context-Free Languages → Limitations of Context-Free Languages → Pumping Lemma for Context-Free Languages → Turing Machines → Variants of Turing Machines and Equivalence → Nondeterministic Time Complexity and NP → The P vs. NP Problem → Complexity Class P: Polynomial Time → Hash Functions and Collision Resistance → Message Authentication Codes (MACs) → Authenticated Encryption

Longest path: 99 steps · 517 total prerequisite topics

Prerequisites (2)

Leads To (0)

No topics depend on this one yet.