The first of three lessons rebuilt from the Security I TLS lecture. It recaps the three uses of public-key crypto on a hand-computed RSA key, follows a login across every machine between a cafe and a bank to show why plaintext is a postcard, sorts real incidents (Firesheep, the Great Cannon, a fake airport hotspot) into read, change and pretend, states the TLS threat model and its three guarantees, then walks through every SSL and TLS version as the design flaw that retired it and the fix that followed, ending with how compatibility kept broken versions alive and how to configure and verify a server that accepts only TLS 1.2 and 1.3.
Subject: Computer Security · 67 slides · code lesson
Open the interactive version of this deck
Title
Computer Security — TLS Lecture 1
Public-key crypto works. Now put it on a network that someone else owns.
Section
Public-key crypto works; whose key is it?
Objectives
The cryptography lecture ended with a working public-key toolkit and one unsolved problem: you cannot tell whose public key you are holding. TLS is the answer the whole Internet deployed. This first part sets the stage: why a secure channel is needed at all, exactly what it has to promise, and what went wrong in every version before the current one.
Security I, Lecture 3: TLS and the Web PKI slide s-title
Warm-up
Before public-key crypto, every scheme in the cryptography lecture had the same precondition.
Discussion prompt
What did AES and HMAC need before the first message, and how does a public key remove that need? What new problem does it leave behind?
Hint: What has to exist before Alice sends anything, and what can Mallory substitute?
Answer:
They needed a secret key already shared by both sides. A public key removes that: Bob publishes one half of a key pair, anyone can lock a message to him with it, and only his private half unlocks it. Nothing secret is arranged in advance.
The problem left behind is authenticity of the key itself. A public key is just a number. If Mallory hands you her own padlock and says it is Bob's, you will lock your secret to Mallory. Most of this TLS series is about that one question.
Security I, Lecture 3: TLS and the Web PKI slide s-recap-pk
Concept
Bob generates a matched key pair, publishes the public key PK and keeps the private key SK. Anyone can snap the padlock shut, which is encryption with PK. Only SK opens it.
Figure (svg): Bob's KeyGen makes PK for anyone and SK for Bob; Alice encrypts with PK; Mallory on the wire holds PK and the ciphertext and still cannot open it
Mallory, on the wire, holds both the padlock and the locked box, and neither lets her open it. The one hard part flagged in red is today's subject: making sure the padlock you grabbed is really Bob's.
Security I, Lecture 3: TLS and the Web PKI slide s-recap-pk
Concept
The instructor posts a public key once. Any student encrypts with it, and only the instructor, holding the private key, can read the result. Nobody arranged anything in advance.
| with AES | with a public key | |
|---|---|---|
| setup before the first message | a secret key shared with every student | post one public key |
| a 300-student class | 300 secrets delivered securely | nothing delivered secretly |
| who can read a student's message | anyone holding that shared key | only the private-key holder |
AES could protect the message too, but only after a separate secret was set up with each student. Public key removes the setup, which is the whole point.
Security I, Lecture 3: TLS and the Web PKI slide s-recap-use1
Concept
Run it the other way. The instructor signs an announcement with the private key, and every student checks it with the public key. Only the private-key holder could have produced a valid signature.
| property | MAC (shared key) | signature (key pair) |
|---|---|---|
| who can create a valid tag | everyone who can verify | only the private-key holder |
| who can verify | only holders of the shared key | anyone with the public key |
| proof to a third party | none | yes: non-repudiation |
A MAC cannot do this job: any student able to check the tag could also forge one, and could never prove to anyone else who wrote it. Certificates and software signing live on this row of the table, and so does a TLS server proving who it is.
Security I, Lecture 3: TLS and the Web PKI slide s-recap-use2
Concept
The most common use. A student picks a fresh random AES key k, locks it with the instructor's public key and sends it. Eve sees only the locked value. Both sides now hold k without ever having met, and they switch to AES for the real traffic.
Figure (svg): The student encrypts a random key k with PK and sends it; the instructor decrypts to get k; then both use AES with k in both directions
Why not use public key for everything? It is 100 to 1000 times slower than AES, so it only sets up k. This simple version, key transport, is how TLS 1.2 with RSA worked. Modern TLS uses Diffie-Hellman for the same job, which the next lecture builds.
Security I, Lecture 3: TLS and the Web PKI slide s-recap-use3
Sorting
Sort each scenario by the job public-key crypto does in it.
Sort into buckets
Private message, signature, or key agreement?
Security I, Lecture 3: TLS and the Web PKI slide s-recap-use3
Worked example
RSA is a key factory. Run it on the classic tiny example so every number can be checked: primes 61 and 53. Blue values in the figure are public, yellow ones secret.
p, q = 61, 53 # two random primes (real ones: ~300 digits each)
n = p * q # 3233, goes in the public key
phi = (p - 1) * (q - 1) # 3120, easy only if you know p and q
e = 17 # must share no factor with phi
d = pow(e, -1, phi) # 2753, the trapdoor
public = (e, n) # (17, 3233)
private = d # 2753; now delete p, q, phi| step | value | public or secret |
|---|---|---|
| choose p and q | 61 and 53 | secret |
| n = p times q | 3233 | public |
| phi = 60 times 52 | 3120 | secret |
| choose e | 17 | public |
| d with e times d leaving remainder 1 mod 3120 | 2753 | secret |
Figure (svg): p = 61 and q = 53 give n = 3233 and phi = 3120; e = 17 and d = 2753; factoring n back to p and q is the hard direction
Publish and delete
Why: The public key is (17, 3233) and the private key is 2753. Once d exists, p, q and phi are thrown away; anyone who learns phi or p can recompute d. Real keys use e = 65537 and a 2048-bit n.
Verify: e times d
Why: 17 times 2753 is 46801, which is 15 times 3120 plus 1, so d really does invert e mod 3120. In Python, pow(17, -1, 3120) returns 2753.
Security I, Lecture 3: TLS and the Web PKI slide s-recap-rsa
Socratic
The recipe says to pick e with no factor in common with phi = 3120. Try e = 2.
Discussion prompt
With e = 2, can any d satisfy e times d = 1 more than a multiple of 3120? What does that tell you about the rule?
Hint: Is 2 times anything ever odd?
Answer:
No. 2 times d is always even, and every multiple of 3120 is even, so 2d is never one more than a multiple of 3120. No d exists, so there is no private key and the scheme cannot decrypt.
In general an inverse of e mod phi exists exactly when e and phi share no factor. That is why 17 works (3120 = 2 times 2 times 2 times 2 times 3 times 5 times 13 has no factor 17) and why the standard choice 65537, a prime, almost always works.
Security I, Lecture 3: TLS and the Web PKI slide s-recap-rsa
Concept
A cheat sheet so the letters stop blurring together. Everything splits into two piles: what rides on the wire, and what never leaves the owner.
| symbol | what it is | relation | who sees it |
|---|---|---|---|
| p, q | the two prime factors | chosen at random | secret |
| n | the modulus | n = p times q | public |
| phi | Euler's totient of n | (p - 1) times (q - 1) | secret |
| e | encryption exponent | no common factor with phi | public |
| d | decryption exponent | e times d is 1 mod phi | secret |
| (e, n) | public key | encrypt, verify | public |
| (d, n) | private key | decrypt, sign | secret |
Memory hook: the secret pile is everything needed to build the key (p, q and phi) plus the trapdoor d. Only n and e are ever published.
Security I, Lecture 3: TLS and the Web PKI slide s-recap-symbols
Discrimination
A server is about to put some RSA values in a message to the world.
Sort into buckets
Which values may it publish, and which must never leave it?
Security I, Lecture 3: TLS and the Web PKI slide s-recap-symbols
Worked example
Same key: n = 3233, e = 17, d = 2753. Watch it do every job, then keep two of them in mind for the rest of the series.
n, e, d = 3233, 17, 2753
pow(65, e, n) # 2790 use 1: encrypt m = 65; only d undoes it
pow(2790, d, n) # 65
pow(123, d, n) # 2746 use 2: sign h = 123 (think: a hash)
pow(2746, e, n) # 123 anyone verifies with the public e
# use 3: the student picks k = 65, sends 2790, the instructor recovers 65| job | who computes | input | output |
|---|---|---|---|
| 1. private message | anyone, with e | m = 65 | c = 2790 |
| 1. read it | only the owner, with d | 2790 | 65 |
| 2. sign | only the owner, with d | h = 123 | s = 2746 |
| 2. verify | anyone, with e | 2746 | 123: matches |
| 3. key transport | student locks k = 65 | 65 | 2790, opened to 65 |
Figure (svg): Three lanes: 65 encrypts to 2790; 123 signs to 2746; key 65 travels as 2790; TLS needs the signature and the key-agreement lanes
What TLS takes from this
Why: TLS needs two of these: use 2 lets the server prove it is really Chase, and use 3, or its cousin Diffie-Hellman, gives both sides a shared key.
Verify: in Python
Why: pow(65, 17, 3233) returns 2790, pow(2790, 2753, 3233) returns 65, pow(123, 2753, 3233) returns 2746, and pow(2746, 17, 3233) returns 123.
Security I, Lecture 3: TLS and the Web PKI slide s-recap-nums
Missing information
Your browser has never talked to chase.com before. It wants to send a password.
Discussion prompt
Which of the three public-key jobs does the browser actually need here, and why is the private-message job alone not enough?
Hint: Encrypting to the wrong key is perfectly secure and completely useless.
Answer:
It needs key agreement, so that both sides end up with an AES key nobody else has, and it needs a signature from the bank, so that the other end is provably the bank. That is jobs 3 and 2.
Locking a message to a public key is useless if the public key came from an impostor: the message is then perfectly secret, and delivered to the attacker. Identity has to be proven, not assumed.
Security I, Lecture 3: TLS and the Web PKI slide s-recap-nums
Section
Your messages cross machines you do not control
Concept
TLS gives two programs a private, authenticated channel over a network the attacker controls. Three places you used it this week:
Figure (svg): Three tiles: the Web (github.com with a lock), messaging (WhatsApp Web), and APIs (a secret Bearer key in every request)
Email between servers, VPNs, card payments and software updates also run over TLS. If a connection is secure today, TLS is almost certainly underneath.
Security I, Lecture 3: TLS and the Web PKI slide s-roadmap
Real world
Your script sends a request with Authorization: Bearer sk-proj-... to an API, from a laptop on the campus Wi-Fi.
Discussion prompt
If that request were plain HTTP, who could read the key, and what could they do with it? What does TLS change?
Hint: List every machine between the laptop and the API server.
Answer:
Every machine on the path: the Wi-Fi access point, the campus network, the ISPs and the backbone. Anyone who copies the key can make requests as you and bill your account until you revoke it, and nothing in the request tells you it was copied.
With TLS the header is inside the encrypted channel, so the path sees only scrambled bytes and the host name. TLS also checks that the server really is the API provider, so the key is not handed to an impostor. Both properties matter, and they are the subject of this series.
Security I, Lecture 3: TLS and the Web PKI slide s-roadmap
Concept
Build it up from the two ends you care about: your laptop and the bank. Between them is a chain of machines, and none belongs to you or to the bank.
Figure (svg): Six boxes in a row: your laptop, cafe Wi-Fi, your ISP, the backbone, the bank's ISP, chase.com; the four middle machines belong to someone else
Your message is handed from one machine to the next, like a postcard going through the mail, and every hand that touches it can look at it.
Security I, Lecture 3: TLS and the Web PKI slide s-net-how
Security I, Lecture 3: TLS and the Web PKI slide s-div-bg
Ranking
You open your banking site from a cafe. Order the machines your login passes through.
Put in order
Why: Local first, then your provider, then the long-distance networks, then the provider on the far side, then the destination. Four of the five belong to neither you nor the bank, and on a plaintext network every one of them can read and change what passes.
Security I, Lecture 3: TLS and the Web PKI slide s-net-how
Concept
Make it concrete. Without encryption, a login is literally this text on the wire: the request line, the host, and the form with your password in plain characters.
POST /login HTTP/1.1
Host: www.chase.com
Content-Type: application/x-www-form-urlencoded
username=alice&password=hunter2| hop | what it sees | skill needed |
|---|---|---|
| cafe Wi-Fi | the whole request, password included | none: any packet capture tool |
| your ISP | the whole request | none |
| backbone carrier | the whole request | none |
| the bank's ISP | the whole request | none |
Figure (svg): The same six-hop path, with every middle hop marked as reading the postcard
For the first years of the Web, logins, email and everything else travelled exactly like this.
Security I, Lecture 3: TLS and the Web PKI slide s-net-plaintext
Prediction
Someone on the same open cafe Wi-Fi wants your plaintext password from the request on the last slide.
Predict first
What does it take?
Correct: Nothing beyond capturing packets: the password is in the bytes
Why: There is nothing to break. The password is a run of ordinary characters in the request body, so any machine that forwards the packet, or listens on a shared network, simply has it. That is what plaintext means.
Security I, Lecture 3: TLS and the Web PKI slide s-net-plaintext
Concept
Three dangers, and they map exactly onto what TLS must guarantee.
Figure (svg): Three cards: READ (eavesdrop on the password), CHANGE (tamper: pay 10 becomes pay 9000), PRETEND (impersonate chase.com with a fake login page)
Read, change, pretend. Every network attack in this series is one of the three.
Security I, Lecture 3: TLS and the Web PKI slide s-net-threats
Sorting
Classify each incident by the danger it is.
Sort into buckets
Eavesdrop, tamper, or impersonate?
Security I, Lecture 3: TLS and the Web PKI slide s-net-threats
Concept
A true story, from 2010. At any coffee shop, people used Facebook and Twitter over the shared Wi-Fi. The login page used encryption, but after logging in, the laptop talked to the site in plain HTTP, sending a session cookie with every request.
| what happened | why it worked |
|---|---|
| a free browser add-on, Firesheep, listened on the shared Wi-Fi | the session cookie crossed the network in plaintext |
| it listed everyone nearby who was logged in | each cookie identified one account |
| one click on a name opened that person's account | the site treats whoever presents the cookie as the user |
No skill was needed, which was the point its author wanted to make. Within months Facebook and Twitter offered encryption on every page, and soon after made it the default.
Security I, Lecture 3: TLS and the Web PKI slide s-story-eaves
Butler — Firesheep (ToorCon 12, October 2010) the original release post
Socratic
In the Firesheep story, the login form itself was sent over HTTPS. Only the pages after login were plain HTTP.
Discussion prompt
Why was protecting just the password not enough? What should have been protected, and what would a site do today to stop this?
Hint: What does the server check on every request after login?
Answer:
After login, the session cookie is as good as the password: the server lets in anyone who presents it. Protecting the login and then sending the cookie in plaintext just moves the secret the eavesdropper needs.
The fix is HTTPS on every page, plus marking session cookies Secure so the browser never sends them over plain HTTP. The general lesson: protect every message that carries a credential, not only the one where the user typed it.
Security I, Lecture 3: TLS and the Web PKI slide s-story-eaves
Concept
A true story about tampering, from 2015. Visitors all over the world loaded pages that pulled in a small analytics script from a popular Chinese search company, sent over plain HTTP.
| what happened | why it worked |
|---|---|
| on its way through China's network, the script was swapped for a different one | plain HTTP has no integrity: any machine on the path can rewrite it |
| the new script made each browser keep requesting pages from GitHub | the browser runs whatever script arrives, with no way to tell it changed |
| millions of innocent browsers became a flood, and GitHub struggled for days | every visitor became an unwitting attacker |
Researchers named the system that did the swapping the Great Cannon. Nobody read anything secret: the program was simply changed on the way. Integrity matters even for content that is not secret.
Security I, Lecture 3: TLS and the Web PKI slide s-story-tamper
Marczak et al. — China's Great Cannon (Citizen Lab, April 2015) Citizen Lab's analysis of the March 2015 GitHub attack
Counterexample
A colleague says: our site serves only public pages and public JavaScript, nothing secret, so plain HTTP is fine.
Discussion prompt
Give a counterexample from this lecture, and say which of the three guarantees the colleague forgot.
Hint: Which story involved no secrets at all?
Answer:
The Great Cannon: the swapped script was public, yet changing it in transit turned every visitor's browser into a weapon. Hotel and ISP ad injection is a gentler version of the same thing.
The colleague is thinking only about confidentiality. Integrity, knowing the bytes arrived exactly as the server sent them, matters for every page, and especially for code the browser will run. That is one reason browsers now treat all plain-HTTP pages as not secure.
Security I, Lecture 3: TLS and the Web PKI slide s-story-tamper
Concept
The third danger, as something that could happen to you next month. Any laptop can create a Wi-Fi network with any name, so Free Airport WiFi might be a stranger at the next gate.
| step | what you see | what is really happening |
|---|---|---|
| join the network | Free Airport WiFi | the stranger's laptop is now your router |
| open the bank's site | a page that looks exactly right | the stranger's copy of the login page |
| type your password | you are passed on to the real bank | the stranger keeps the password and relays you |
You never notice anything. What was missing is a way for your browser to check who really answered.
Security I, Lecture 3: TLS and the Web PKI slide s-story-imp
Missing information
Suppose the fake airport hotspot's copy of the bank page used perfect encryption between your laptop and the stranger.
Discussion prompt
Is your password safe? What extra piece of information does your browser need, and where could it come from?
Hint: Who is at the other end of the encrypted connection?
Answer:
No. The encryption is perfect, and it delivers your password safely to the stranger, because the stranger is the other end of the encrypted channel. Encryption protects a conversation; it says nothing about who you are talking to.
The browser needs proof that the key at the other end belongs to the real bank: a signature from someone the browser already trusts, binding the bank's name to the bank's key. That is the certificate, and it is the central topic of TLS Lecture 3.
Security I, Lecture 3: TLS and the Web PKI slide s-story-imp
Concept
The Web took off in the early 1990s and people wanted to buy things, which meant typing a credit-card number. On the plaintext Web that number travelled like a postcard.
| the postcard problem | the envelope property | the guarantee |
|---|---|---|
| anyone on the path can read it | sealed | confidentiality |
| anyone on the path can change it | tamper-evident | integrity |
| anyone can claim to be the shop | signed by the sender | authentication |
Netscape designed SSL, the Secure Sockets Layer, in 1994 to put the postcard inside a sealed, signed envelope. In 1999 the standards body renamed it TLS, Transport Layer Security. Same idea, renamed and improved.
Security I, Lecture 3: TLS and the Web PKI slide s-why-tls
Matching
Match each story to the guarantee that would have stopped it.
Match the pairs
Why: Firesheep only read; sealing the cookie stops it. The Great Cannon only changed bytes; integrity rejects the altered script. The hotspot answered as the bank; only checking who signed defeats it. TLS has to give all three at once.
Security I, Lecture 3: TLS and the Web PKI slide s-why-tls
Section
Pin down the enemy before any mechanism
Concept
Before any mechanism, say exactly who the enemy is. Setup: the attacker controls every machine between you and the bank.
| the attacker CAN | the attacker CANNOT (assumed) |
|---|---|
| read every packet | break good cryptography: invert AES without the key, factor a 2048-bit modulus |
| change packets in flight | reach into the bank's servers and steal its private key |
| drop or inject packets | run code on your laptop |
| answer your DNS lookups with any address it likes | make you click through a browser warning (that is a user problem, covered in Lecture 3) |
What it wants: your password and session cookie, to redirect your money, to pass itself off as the bank, and to do it all without you noticing. The right-hand column is a list of assumptions. If one fails, for example malware on your laptop, TLS cannot help you.
So the attacker cannot break the math directly. Every attack in this series wins through a weakness in the protocol or in the system around the math.
Security I, Lecture 3: TLS and the Web PKI slide s-what
Security I, Lecture 3: TLS and the Web PKI slide s-div-what
Discrimination
TLS promises protection only against the attacker it was designed for.
Sort into buckets
Is each attacker inside the TLS threat model (TLS must stop it) or outside it (TLS cannot help)?
Security I, Lecture 3: TLS and the Web PKI slide s-what
Concept
Each danger gets exactly one guarantee.
Figure (svg): Eavesdrop maps to confidentiality, tamper to integrity, both provided by AEAD; impersonate maps to authentication, marked as the hard part
The first two come from authenticated encryption, which the cryptography lecture already built. The third, knowing who is really at the other end, is the hard part, and most of the TLS series is about it.
Security I, Lecture 3: TLS and the Web PKI slide s-guarantees
Elimination
AES-GCM is authenticated encryption: it encrypts and attaches a tag. Rule out what it does provide.
Eliminate the wrong options
Even with a perfect, shared AES-GCM key, which guarantee is still missing?
Survives elimination: a
Why: A shared key proves only that the other end holds the same key. If you agreed on that key with an impostor, AES-GCM protects your conversation with the impostor perfectly. Authentication of the peer has to come from public-key crypto plus a trusted vouching party.
Security I, Lecture 3: TLS and the Web PKI slide s-guarantees
Concept
An analogy for the structure. Meeting a stranger for private business, you first check each other's ID and quietly agree on a code word. That is careful and slow, so you do it once. Then you talk in the code for the rest of the meeting.
Figure (svg): Step 1, the handshake: identity and a key, with slow public-key crypto, once per connection; step 2, the record layer: AEAD on every byte at gigabytes per second
TLS is the same: the handshake uses public-key crypto to authenticate and agree on keys, then the record layer uses fast symmetric authenticated encryption for everything else. Two steps, because the two jobs need two different tools. TLS Lecture 2 builds both.
Security I, Lecture 3: TLS and the Web PKI slide s-two-protocols
Hypothesis
Public-key crypto alone could, in principle, encrypt every record.
Predict first
What is the main reason TLS switches to symmetric encryption after the handshake?
Correct: Public-key operations are hundreds to thousands of times slower, and the data can be gigabytes
Why: A 2048-bit RSA private-key operation takes on the order of a millisecond; AES-GCM with hardware support moves gigabytes per second. So public key does the one-time job only it can do, meeting a stranger, and hands a key to AES for the bulk work.
Security I, Lecture 3: TLS and the Web PKI slide s-two-protocols
Pattern
Every design decision in the series follows from four lines, in this order.
When you meet a protocol flaw, ask which line it violated. The whole history that follows is a list of answers.
Section
Every version exists because the one before it broke
Concept
A short history, because it explains why TLS 1.3 looks the way it does.
Figure (svg): A timeline: SSL 1.0 (1994, never shipped), SSL 2.0 (1995, short keys), SSL 3.0 (1996, POODLE 2014), TLS 1.0 (1999, BEAST 2011), TLS 1.1 (2006, retired), TLS 1.2 (2008, FREAK and Logjam), TLS 1.3 (2018, current)
Six of the seven versions were broken or abandoned. TLS 1.2 is still widely used and still allowed, but was hit by FREAK and Logjam through old options it kept accepting. TLS 1.3, standardised in 2018 as RFC 8446, is current. The next slides take them one at a time, each as a design flaw and the fix it led to.
Security I, Lecture 3: TLS and the Web PKI slide s-history
Security I, Lecture 3: TLS and the Web PKI slide s-div-hist
RFC 8996 — Deprecating TLS 1.0 and TLS 1.1 (March 2021) TLS 1.0 and 1.1 formally deprecated, 2021
Prediction
The IETF has formally prohibited or deprecated versions one at a time: SSL 2.0 in 2011, SSL 3.0 in 2015, TLS 1.0 and 1.1 in 2021.
Predict first
Which versions should a public server accept in 2026?
Correct: TLS 1.2 and TLS 1.3
Why: RFC 6176, RFC 7568 and RFC 8996 removed SSL 2.0, SSL 3.0, TLS 1.0 and TLS 1.1. TLS 1.2, configured with modern AEAD cipher suites, and TLS 1.3 remain. Mozilla's modern profile goes further and accepts only TLS 1.3. Accepting everything is exactly the habit that the rest of this part shows to be dangerous.
Security I, Lecture 3: TLS and the Web PKI slide s-history
Concept
SSL 1.0 never shipped, and the reason is something you already know. It encrypted with RC4, a stream cipher designed by Ron Rivest in 1987: think of it as a one-time pad whose pad is generated from a short key, like CTR mode. It was the most used cipher on the Web for years, until RFC 7465 banned it from TLS in 2015.
Figure (svg): Plaintext pay 100 XOR an unknown keystream gives ciphertext; flipping a ciphertext bit flips the same plaintext bit; the CRC check has no key and can be recomputed by anyone
| design choice | why it fails |
|---|---|
| stream cipher: ciphertext = plaintext XOR keystream | a flipped ciphertext bit flips the same plaintext bit, so an edit lands exactly where the attacker wants |
| CRC checksum instead of a MAC | a CRC has no key, so whoever edits the message recomputes it |
| no sequence numbers | an old record could be replayed and would look fresh |
Netscape's reviewers caught this, and SSL 1.0 was scrapped before release.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-ssl1
Worked example
A checksum detects accidents, such as a flipped bit on a noisy line. To detect people, the check must need a secret the attacker lacks. See it with CRC-32, the family SSL 1.0 relied on.
import zlib
zlib.crc32(b"pay Bob 100") # 0xbb3640bd
zlib.crc32(b"pay Bob 900") # 0xb5251105
# no key anywhere: whoever edits the message
# recomputes the checksum in one call| message | CRC-32 | who can compute it |
|---|---|---|
| pay Bob 100 | 0xbb3640bd | anyone |
| pay Bob 900 | 0xb5251105 | anyone |
| HMAC-SHA256 of either message | depends on the key | only key holders |
Figure (svg): The SSL 1.0 picture again: an edit to the ciphertext plus a recomputed CRC passes the check
Read the table as the attacker
Why: The attacker changes the message and then simply computes the new CRC, as the second row shows. The receiver's check passes, because the check was never secret.
Verify: in Python
Why: zlib.crc32(b"pay Bob 100") returns 0xbb3640bd and zlib.crc32(b"pay Bob 900") returns 0xb5251105: two valid checksums, no key used. Replace the CRC with HMAC under a secret key and the second value can no longer be produced by an outsider.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-ssl1
Concept
SSL 2.0 shipped in 1995 with RC4 and DES; AES did not exist until 2001. Its root cause was short keys.
Figure (svg): Bars: 40-bit export keys take about 18 minutes at a billion keys per second, 56-bit DES about 2.3 years, 128-bit AES about 10 to the 22 years
Security I, Lecture 3: TLS and the Web PKI slide s-hist-ssl2
RFC 6176 — Prohibiting Secure Sockets Layer (SSL) Version 2.0 SSL 2.0 prohibited, 2011
Estimation
A 40-bit key space has 2 to the 40, about 1.1 trillion, keys. Assume one machine tries a billion keys per second, which is modest today.
Predict first
Roughly how long to try every key?
Correct: About 18 minutes
Why: 1.1 trillion divided by a billion is about 1,100 seconds, a little over 18 minutes, and on average the key turns up halfway. In 1995 it took days on a university's machines, which was already too little. Each extra bit doubles the work, so 128 bits is out of reach for any computer that could ever be built.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-ssl2
Concept
The client sends a menu of ciphers it supports; the server picks one. In SSL 2.0 nothing checked afterwards that both sides had seen the same menu.
Figure (svg): The client offers RC4-128, DES-56 and RC4-40; an attacker on the path deletes the first two; the server sees only RC4-40 and picks it
So an attacker on the path could delete the strong options and leave only the 40-bit one. Both sides were honest and both were fooled, and the attacker then had to break only a 40-bit key. This is the first downgrade attack, and the shape returns again and again. The fix, in SSL 3.0 and every version since, is a final handshake message that authenticates everything both sides said.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-ssl2
Concept
SSL 3.0 lasted almost twenty years. It used MAC-then-encrypt with CBC mode, and the root cause of its death was one gap: the MAC covered the data but not the padding, and the padding bytes were never checked.
Figure (svg): An SSL 3.0 record: data and MAC covered by the MAC, padding covered by nothing, all of it CBC-encrypted
Bytes that nothing authenticates can be tampered with, and the server's reaction, accept or reject, then tells the attacker something about the plaintext. A server that reveals, one yes or no at a time, whether a tampered record was acceptable is called an oracle. Enough answers leak secrets such as a cookie.
POODLE, published by Google researchers in 2014, did exactly this to SSL 3.0, and browsers switched SSL 3.0 off for good. RFC 7568 prohibited it in 2015. The design lessons: authenticate every byte you decrypt, and use authenticated encryption so there is no separate padding step to get wrong.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-ssl3
Möller, Duong, Kotowicz — This POODLE Bites: Exploiting the SSL 3.0 Fallback (Google, 2014) the original POODLE advisory
RFC 7568 — Deprecating Secure Sockets Layer Version 3.0 SSL 3.0 prohibited
Socratic
A server decrypts a record, finds the padding malformed and replies with a specific error; for good padding but a bad MAC it replies with a different one, or takes a different time.
Discussion prompt
Each reply is only one bit. Why is a server that answers this question repeatedly a security problem, and what are two design changes that remove the question entirely?
Hint: Who chooses the questions, and how many can they ask?
Answer:
Because the attacker chooses what to ask. Each tampered record is a question about the plaintext, and many one-bit answers add up to whole bytes of a secret. Security has to assume the attacker can ask as often as it likes.
Fix one: authenticate the entire ciphertext before doing anything else with it, Encrypt-then-MAC, so a tampered record is rejected before padding is ever looked at. Fix two: use an AEAD mode such as AES-GCM, which has no padding at all. TLS 1.3 does the second, and also sends the same alert for every failure.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-ssl3
Concept
TLS 1.0's root cause was a predictable IV. CBC mode is secure only if each IV is unpredictable to the attacker before the plaintext is chosen. TLS 1.0 used the last ciphertext block of the previous record as the next record's IV, and that block had already crossed the wire.
| requirement from the CPA lecture | what TLS 1.0 did | consequence |
|---|---|---|
| IV unpredictable before encryption | IV = last ciphertext block already sent | the attacker knows the next IV in advance |
| same plaintext never recognisable | chosen-plaintext guesses become testable | secrets can be confirmed one guess at a time |
| fresh randomness per record | none | fails the CPA game outright |
Think of a lock whose next combination is printed on the last receipt. BEAST, in 2011, showed that a script in the victim's browser could use this to recover cookies. The fixes: TLS 1.1 gave every record a fresh random IV, browsers patched TLS 1.0 by splitting records, and TLS 1.3 removed CBC altogether.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-tls10
RFC 7457 — Summarizing Known Attacks on TLS and DTLS (BEAST, POODLE and others) section 2.4, BEAST
Two truths and a lie
Two of these statements are true and one is a myth.
Eliminate the wrong options
Which statement is the myth?
Survives elimination: t1
Why: IVs are not secret: CBC sends them in the clear all the time. What matters is that the attacker cannot know the IV before choosing what to get encrypted. TLS 1.0's chained IV was public before the next encryption, and that predictability, not visibility, was the flaw.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-tls10
Concept
TLS 1.1 (2006) fixed the IV with a fresh random one per record. TLS 1.2 (2008) added AES-GCM, encryption and MAC in one step, which ends padding problems. The protocol was finally good. The problem was compatibility.
| attack | year | old option still accepted | what the attacker did | fix |
|---|---|---|---|---|
| FREAK | 2015 | export-grade RSA, 512-bit modulus | tricked connections into it, then factored the 512-bit n | remove export suites; patch the client bug |
| Logjam | 2015 | export-grade Diffie-Hellman, 512-bit prime | the same idea against 512-bit Diffie-Hellman | 2048-bit or elliptic-curve groups only |
| POODLE fallback | 2014 | SSL 3.0 after a failed connection | made the newer handshake fail so clients retried on SSL 3.0 | disable SSL 3.0; signal fallback |
Remember the chain from why RSA is secure: factor n, get p and q, get phi, get d, read the traffic. FREAK did the factoring step for real: a 512-bit modulus fell in about seven hours for roughly a hundred dollars of rented cloud machines.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-tls12
Adrian et al. — Imperfect Forward Secrecy: How Diffie-Hellman Fails in Practice (CCS 2015; Logjam) Logjam and weakdh.org
Commit first
In 2015 the FREAK researchers needed to factor a 512-bit RSA export key quickly enough to matter.
Predict first
What did it cost them, roughly? Bet your confidence.
Correct: About seven hours and a hundred dollars of rented cloud machines
Why: 512-bit RSA was first factored publicly in 1999, and by 2015 the open-source CADO-NFS tool on rented machines did it in hours. Export-grade crypto was designed in the 1990s to be breakable by governments; twenty years later it was breakable by anyone with a credit card. Key sizes must anticipate the future, not the present.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-tls12
Concept
Step back and the history is a loop.
Figure (svg): A loop: a version ships, someone breaks it, a new version fixes it, servers keep the old one for old clients, and in the middle a downgrade forces both sides back
SSL 2.0 cipher stripping, POODLE fallback, FREAK and Logjam are all this loop. TLS 1.3 breaks it: its designers deleted the weak options instead of keeping them around. Old clients that cannot speak 1.3 still use 1.2, but 1.3 itself carries none of the old baggage.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-pattern
Trap
A common belief: modern browsers always pick TLS 1.3, so leaving SSL 3.0, TLS 1.0 and export ciphers enabled only helps old clients and cannot hurt new ones.
| the belief | what actually happened |
|---|---|
| new clients pick the best version | an attacker can make the best version fail, or edit the menu, so the old one is chosen |
| weak suites are never used | FREAK and Logjam forced exactly those suites on modern clients |
| only old clients are at risk | POODLE reached modern browsers through their fallback retry |
A connection is only as strong as the weakest option both ends will accept, because the attacker gets to influence the choice. The fix has two halves: remove weak options from servers and clients, and authenticate the negotiation itself, so any tampering with the menu is detected. TLS 1.3 does both; the next lecture shows how its handshake signs the negotiation.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-pattern
RFC 8446 — The Transport Layer Security (TLS) Protocol Version 1.3 appendix D.4, downgrade protection
Comparison
Fill in the missing cells of the summary.
Comparison matrix
| version | root flaw | attack or event | fix |
|---|---|---|---|
| SSL 1.0 | no keyed integrity (CRC, not a MAC) | caught in review | never shipped |
| SSL 2.0 | 40-bit keys, unprotected menu | export brute force, cipher stripping | authenticate the handshake (SSL 3.0) |
| SSL 3.0 | padding outside the MAC | POODLE (2014) | prohibited, RFC 7568 |
| TLS 1.0 | predictable chained IV | BEAST (2011) | random IV per record (TLS 1.1) |
| TLS 1.2 | still accepts export options | FREAK, Logjam (2015) | delete weak options (TLS 1.3) |
Notice that no row says the cipher was broken by mathematics alone. Every failure is a design or configuration choice around the cryptography.
Security I, Lecture 3: TLS and the Web PKI slide s-history
Matching
Each historical attack exploited one design flaw.
Match the pairs
Why: POODLE used SSL 3.0's unchecked padding, BEAST used TLS 1.0's chained IV, and FREAK and Logjam forced export-size RSA and Diffie-Hellman that could be broken in hours. Two are bad modes of use, two are leftover key sizes, and none is a break of the underlying cipher.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-tls12
Section
Refuse the old versions, then prove it
Worked example
The defensive half of the history is two lines of configuration and two commands to check them. Here is the shape for nginx, following Mozilla's intermediate profile.
# nginx: accept only the two versions still allowed
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
# check from a client: these must fail
# openssl s_client -tls1 -connect example.com:443
# openssl s_client -tls1_1 -connect example.com:443| line | what it does | which history it ends |
|---|---|---|
| ssl_protocols TLSv1.2 TLSv1.3 | refuses SSL 2.0, SSL 3.0, TLS 1.0 and 1.1 | stripping, POODLE fallback, BEAST |
| ssl_ciphers ECDHE ... GCM, CHACHA20 | only forward-secret key exchange and AEAD ciphers | export RSA and DH (FREAK, Logjam), RC4, CBC padding |
| ssl_prefer_server_ciphers off | lets the client pick among strong suites | nothing weak is left to pick |
| the two openssl commands | try to connect with TLS 1.0 and 1.1 | proves the refusal from outside |
Figure (svg): Probe results for chase.com: TLS 1.0 and 1.1 get alert 70 protocol_version; TLS 1.2 negotiates ECDHE-RSA-AES256-GCM-SHA384; TLS 1.3 negotiates TLS_AES_256_GCM_SHA384
Read a real server's answer
Why: Probing chase.com in October 2026: openssl s_client -tls1 and -tls1_1 were refused with TLS alert 70, protocol_version, while -tls1_2 negotiated ECDHE-RSA-AES256-GCM-SHA384 and -tls1_3 negotiated TLS_AES_256_GCM_SHA384.
Verify: from the outside
Why: A correctly hardened server shows exactly that pattern: the old versions fail with protocol_version, and both allowed versions negotiate an ECDHE key exchange with an AEAD cipher. If -tls1 succeeds, the configuration did not take effect.
Mozilla — Server Side TLS recommended configurations intermediate configuration
RFC 8996 — Deprecating TLS 1.0 and TLS 1.1 (March 2021) section 1, why TLS 1.0 and 1.1 are deprecated
Error analysis
A teammate added this to a server, so that no customer is ever turned away. Open each note.
Annotate
Every item on this list once had a name and a press release. Configuration is where most of the history is either repeated or avoided.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-pattern
Real world
You can repeat the chase.com probe on any public HTTPS server, including one you run.
Discussion prompt
Which commands would you run, what output means the server is hardened, and which free tool gives a full report without a terminal?
Hint: One command per version.
Answer:
Run openssl s_client -tls1 -connect host:443 and the same with -tls1_1: a hardened server answers with an alert such as protocol_version. Then -tls1_2 and -tls1_3 should connect and print an ECDHE key exchange and a GCM or CHACHA20-POLY1305 cipher. Your own OpenSSL may refuse old versions before sending anything; that is your client's policy, not the server's answer.
Qualys SSL Labs' public server test grades versions, cipher suites and known weaknesses in one report. Only test servers you own or are allowed to test; these probes are ordinary handshakes, but scanning other people's systems at scale is not.
Security I, Lecture 3: TLS and the Web PKI slide s-hist-tls12
Check
Solve it on paper before you click.
Check your understanding
A design encrypts each message with a stream cipher and appends a CRC-32 of the plaintext, also encrypted. What is the most serious problem?
Answer: B
Why: This is SSL 1.0. Flipping ciphertext bits flips the same plaintext bits, and a CRC is linear and keyless, so the change to the checksum is predictable too. Detecting a person, not noise, needs a MAC under a secret key, or an AEAD mode.
Check
Solve it on paper before you click.
Check your understanding
Which event would TLS, working exactly as designed, fail to protect you against?
Answer: C
Why: Code running on your own machine sits at an endpoint, outside the threat model: it sees the page after TLS has decrypted it. The other three are network attackers, exactly the adversary TLS is built to defeat.
Connect it up
Put the whole lecture on one page.
Draw it
Draw the six-hop path from laptop to bank. Mark where each of the three stories happened (Firesheep, the Great Cannon, the fake hotspot) and label each with read, change or pretend. Next to it, draw the three guarantees and the tool for each. Then draw the version timeline and, for each retired version, write the one guarantee or rule it violated.
A good map makes every historical break land on one guarantee or one rule of the design recipe, and shows that authentication of the other end is the only guarantee the cryptography lecture did not already supply.
Exit ticket
One question to check the central idea of the history.
Predict first
Why did so many attacks succeed against connections between two modern, up-to-date endpoints?
Correct: Because both endpoints still accepted weak options, and the attacker could steer the negotiation towards them
Why: Downgrades work whenever strong endpoints keep speaking weak protocols and the negotiation is not authenticated. The cure is to delete the weak options and to authenticate everything both sides said during the handshake, which is what TLS 1.3 does.
Recap
The thread: the network belongs to someone else, so a secure channel must give confidentiality, integrity and authentication; the first two come from authenticated encryption, the third is the hard part; and every old version failed on a design choice around the cryptography, kept alive by compatibility.
| version | status in 2026 |
|---|---|
| SSL 2.0, SSL 3.0 | prohibited (RFC 6176, RFC 7568) |
| TLS 1.0, TLS 1.1 | deprecated (RFC 8996) |
| TLS 1.2 | allowed, with ECDHE and AEAD suites only |
| TLS 1.3 | current (RFC 8446); next lecture |
Next: TLS Lecture 2 builds the TLS 1.3 handshake message by message, with Diffie-Hellman on real numbers, and shows how it signs the negotiation so a downgrade is caught.
Security I, Lecture 3: TLS and the Web PKI slide s-ack — Lecture materials by Suman Jana (Columbia University), with slides originally from Vitaly Shmatikov; re-typeset and extended in the Security I course
RFC 8446 — The Transport Layer Security (TLS) Protocol Version 1.3 the TLS 1.3 standard
Want this taught 1-on-1? Alexander tutors Computer Security — $55/session, free consultation.