Path: blob/main/foundations/03-galois-fields-aes/connect/aes-in-tls13.ipynb
483 views
Connect: AES in TLS 1.3
Module 03 | Real-World Connections
Every HTTPS connection you make runs the field arithmetic from Module 03.
Introduction
TLS 1.3 (RFC 8446) is the protocol that secures virtually all web traffic. When your browser shows a padlock icon, TLS is running underneath.
TLS 1.3 mandates exactly five cipher suites. Three of them use AES:
| Cipher Suite | Encryption | Key Size | Auth Tag |
|---|---|---|---|
TLS_AES_128_GCM_SHA256 | AES-128-GCM | 128 bits | 128 bits |
TLS_AES_256_GCM_SHA384 | AES-256-GCM | 256 bits | 128 bits |
TLS_AES_128_CCM_SHA256 | AES-128-CCM | 128 bits | 128 bits |
The AES we built in Module 03 --- with its GF() S-box, MixColumns matrix, and round structure --- is the engine inside all of these. Let's trace exactly where each Module 03 concept appears.
The TLS 1.3 Handshake (Simplified)
Before any encrypted data flows, client and server perform a handshake:
Messages in {} braces are already encrypted with AES-GCM. The handshake:
Key exchange (ECDH or X25519) produces a shared secret
Key derivation (HKDF-SHA256/384) derives AES keys and IVs from the shared secret
Bulk encryption uses AES-GCM to encrypt all subsequent traffic
Step 3 is where Module 03 lives. Let's zoom in.
How Module 03 Maps to TLS 1.3
Every AES round applies four operations. All of them are field theory:
SubBytes = GF() Inversion
Each byte of the AES state is replaced by its multiplicative inverse in GF(), followed by an affine transformation. This is the S-box from notebook 03d.
In a TLS 1.3 session encrypting your HTTP request, SubBytes runs 10 times per block (AES-128 has 10 rounds), processing 16 bytes per round. That's 160 GF() inversions per 128-bit block of web traffic.
MixColumns = GF() Matrix Multiplication
Each 4-byte column of the state is multiplied by a fixed MDS matrix over GF(). This is the MixColumns operation from notebook 03e.
The matrix entries are and their rotations. Multiplication by is the xtime operation, multiplication by is xtime + XOR --- all GF() arithmetic.
Key Schedule = S-box Again
The AES key schedule expands the 128-bit (or 256-bit) master key into round keys. It uses the S-box (SubWord) and round constants (Rcon), both of which are GF() operations.
The round constants are successive powers of in GF():
Where GF() Appears in a TLS 1.3 Connection
Let's count exactly how many GF() operations happen when your browser loads a typical web page.
Concept Map: Module 03 to TLS 1.3
| Module 03 Concept | Where It Appears in TLS 1.3 |
|---|---|
| GF(2) arithmetic (03a) | Every XOR in AES = GF(2) addition |
| GF() construction (03b) | The field underlying all AES byte operations |
| GF(256) multiplication (03c) | MixColumns matrix multiplication |
| GF(256) inversion (03c-03d) | S-box = SubBytes = the core nonlinear step |
| Affine map over GF(2) (03d) | Second half of the S-box construction |
| MDS matrix over GF(256) (03e) | MixColumns diffusion layer |
| AES round composition (03f) | Each TLS record is encrypted block-by-block |
| Irreducible polynomial (03b) | is hardcoded in every TLS implementation |
Summary
| Concept | Key idea |
|---|---|
| SubBytes in TLS | Every AES block runs 160 GF() inversions (10 rounds, 16 bytes each) for the S-box |
| MixColumns in TLS | Matrix multiplication over GF() with constants 0x01, 0x02, 0x03, running 9 times per block |
| Key schedule | Uses the S-box again, plus round constants that are successive powers of in GF() |
| AddRoundKey | GF(2) vector addition (XOR), the step that mixes in the secret key |
| Scale of operations | A 2 MB web page requires millions of GF() field operations, all happening transparently |
| GCM authentication | TLS 1.3 wraps AES in GCM mode, adding a second Galois field, GF(), for authentication tags |
The field from Module 03 is not an abstraction. It is the exact algebraic structure that protects your passwords, banking sessions, and private messages every time you open a browser.
Back to Module 03: Galois Fields and AES