Week 11 · Network securityCSCI 4431 / 6431 · Wed 4 Nov 2026

Alice, Bob, and Trudy in the middle

Alice Bob Trudy

A discussion on network security.

Figures adapted from Kurose & Ross, Computer Networking: A Top-Down Approach, 9th ed., Chapters 1 and 8 · © 1996–2025 J.F. Kurose and K.W. Ross, all rights reserved
Objectives

By the end of the discussion you can

  • 1Classify a security worry: which promise it breaks, and what a malicious entity may do.
  • 2Trace how keys, signatures and certificates stop an attacker, and explain what an encrypted connection still shows.
Where we are1 of 3

A packet's journey

application transport network link physical link physical network link physical network link physical application transport network link physical your laptop WiFi campus router ISP routers bank.example.com the packet GET /balance TCP :443 IP → bank Eth each layer adds its header, and does its job reads IP only,new link header same, at every hop GET /balanceunwrapped, bottom up
Where we are2 of 3

Ten weeks of “how”

applicationtransport networklink HTTP DNS SMTP SSH DHCP your Project 1 TCP UDP IP link state distance vector BGP Ethernet WiFi ARP How do two programs talk? How do bytes arrive in order, and fairly? How does a packet cross the planet? How does it cross one hop?
A different angle3 of 3

Today, one “what if?”

What if someone on the path is malicious?

you café WiFi campus ISP DNS resolver your bank the hotspot owner anyone at an ISP a fake DNS answer a fake bank site
Brainstorm60 s alone · 90 s with a neighbour · share

What does network security mean to you?

Chrome browsing Instagram social WhatsApp messaging Bank of America banking Venmo payments NordVPN VPN GW GWeb university IRS IRS online government
Your turnPick one you used today. What could someone on the path do to you?
What is network security?Kurose & Ross 8.1

What “secure” promises

Confidentiality

Only the intended receiver can understand it

Message integrity

Any change is noticed

Authentication

You know who is on the other end

Availability

It works when you need it

Game 11 of 2 · hands or Kahoot

Which promise does it break?

  • Confidentiality
  • Integrity
  • Authentication
  • Availability
  1. 1On the café WiFi, someone reads your Instagram messages as they go past.Confidentiality
  2. 2You type your GWeb password into a page that looks exactly like GWeb, but isn't.Authentication
  3. 3You send a friend $20 on Venmo. It arrives at the server as $200.Integrity
  4. 4The exam portal is flooded with junk requests the night before. Nobody can log in.Availability
Game 12 of 2

Which promise does it break?

  • Confidentiality
  • Integrity
  • Authentication
  • Availability
  1. 5Every page you visited today was HTTPS. Your ISP still has the list of sites.Confidentiality
  2. 6A DNS reply is rewritten on the way back: bank.com now points to the attacker's server.Integrity + Auth.
  3. 7A box on the path takes over your logged-in session and keeps sending as you.Authentication
  4. 8You switched to a VPN. Now the VPN company has the list of sites instead.Confidentiality
Alice, Bob, TrudyKurose & Ross 8.1

Friends and enemies

Alice data secure sender channel: data and control messages secure receiver data Bob Trudy intercepts, deletes, adds your browser a web server you, in the app your bank your laptop a DNS resolver a BGP router a BGP router
What Trudy can doKurose & Ross 8.1

Five moves

1 · eavesdrop confidentiality a copy 2 · insert integrity adds her own 3 · impersonate authentication from: Alice fakes the sender 4 · hijack authentication takes Alice's place 5 · deny service availability floods Bob
Game 2hands or Kahoot

Which move is Trudy making?

  • eavesdrop
  • insert
  • impersonate
  • hijack
  • deny service
  1. 1The owner of the free WiFi records every packet you send.eavesdrop
  2. 2Packets reach GWeb carrying your laptop's address. You never sent them.impersonate
  3. 3A server on the way adds a line to your email before it arrives.insert
  4. 4Halfway through your banking session, someone cuts you off and carries on as you.hijack
  5. 5Thousands of hacked cameras send requests to the course site at once.deny service
Chapter 8Kurose & Ross Chapter 8

Chapter 8's toolbox

Shared keyone secret, two people1
Public keya padlock for anyone1
Authenticationprove who you are2
Digests and signaturesfingerprint, then sign3
Certificateswho vouches for a key3
TLSall of it, inside HTTPS4
Secure emailPGPnot today
IPsec, VPNsnetwork layernot today
WiFi and 5Gwireless securitynot today
Firewallsallow or dropnot today
Intrusion detectionwatch for patternsnot today

1 Encryption → 2 Authentication → 3 Integrity → 4 TLS, the protocol behind every HTTPS page you opened today.

Shared key – symmetric encryption1 Encryption2 Authentication3 Integrity4 TLS

One key locks and unlocks

Alice plaintext encrypt ciphertext decrypt plaintext Bob Trudy bob. i love you. alice shared key the same key nkn. s gktc wky. mgsbc nkn. s gktc wky. mgsbc ?? bob. i love you. alice the key abcdefghijklmnopqrstuvwxyz mnbvcxzasdfghjklpoiuytrewq a letter-for-letter swap (Kurose's toy) today's real one: AES, a 128-bit secret
Shared key – symmetric encryption1 Encryption2 Authentication3 Integrity4 TLS

Three problems with one shared key

1 · getting it there Trudy copies it on the way 2 · a key for every pair 5 people: 10 keys 50 people: 1,225 keys. The web: impossible. 3 · one leak opens all stolen every message, past and future
Wanted: a way to send a secret to someone you've never met, over a wire Trudy is reading.
Public key – asymmetric encryption1 Encryption2 Authentication3 Integrity4 TLS

Public-key encryption: a padlock and a key

Alice Bob public key: a padlock anyone may have one private key never leaves Bob Trudy Bob's public key padlock: yes. key: no. m = KB−( KB+(m) )

Anyone can lock. Only Bob can unlock.

Public key – asymmetric encryption1 Encryption2 Authentication3 Integrity4 TLS

The same keys, backwards: only Bob can make it

Alice Bob private key: only Bob can seal public key: anyone can open the seal Trudy m, sealed with Bob's private key opens with Bob's public key: it's from Bob I can open it too. It's not secret. “from Bob”, sealed with Trudy's own key Bob's public key won't open it: not from Bob m = KB+( KB−(m) )

Anyone can open it. Only Bob can make it. That proves it came from Bob: a signature.

Public key – asymmetric encryption1 Encryption2 Authentication3 Integrity4 TLS

What public-key encryption can and can't do

Alice m encrypt Bob's public key KB+(m) KB+(shared key) decrypt Bob's private key m Bob Trudy her copy stays locked: ciphertext only shared key
Trudy has Bob's public key too. Can she read m?No. A padlock locks; it can't unlock.
Trudy locks her own message with Bob's padlock. Can Bob tell it isn't Alice's?No. Anyone can lock.
Public-key math is hundreds of times slower. What should Alice put in the box?A fresh shared key. Then switch to the fast kind.
Diffie–Hellman – key exchange1 Encryption2 Authentication3 Integrity4 TLS

Diffie–Hellman key exchange

Alice Bob p = 23, g = 5 public: everyone has yellow Trudy her secret a = 6 his secret b = 15 + A = 56 mod 23 = 8 + B = 515 mod 23 = 19 8 19 819 swapped in public + red 196 mod 23 = 2 + blue 815 mod 23 = 2 the same brown, never sent 8 × 19 mod 23 = 14 shared key the same key
Trudy has yellow, orange and green. Can she make the brown?No: orange + green is a different colour. Un-mixing is the hard part.

Each side turns the brown into the shared key from slide 14: made fresh for every HTTPS connection, never sent.

Diffie–Hellman – key exchange · optional1 Encryption2 Authentication3 Integrity4 TLS

The same colours, in numbers

PaintMathsToy numbers
yellow · publica prime p, a base gp = 23, g = 5
red, blue · secretsecret numbers a, ba = 6, b = 15
orange, green · sentA = ga mod p
B = gb mod p
56 mod 23 = 8
515 mod 23 = 19
brown · never sentBa mod p = Ab mod p
= gab mod p
196 mod 23 = 2
815 mod 23 = 2
Trudy's mixA · B mod p = ga+b mod p8 × 19 mod 23 = 14, not 2
un-mixingfrom ga mod p back to a:
the discrete logarithm
real p: 2048 bits
forward: a few thousand multiplications
backward: no known fast way
Authentication · ap1.01 Encryption2 Authentication3 Integrity4 TLS

How does Bob know it's Alice?

ap1.0Alice says “I am Alice” Alice Bob “I am Alice” Trudy “I am Alice” Hi, Alice! On a network, Bob can't see who is talking.
Authentication · ap2.01 Encryption2 Authentication3 Integrity4 TLS

Try two: check the IP address

ap2.0“I am Alice”, in a packet from Alice's IP address Alice Bob src: Alice's IP “I am Alice” Trudy src: Alice's IP “I am Alice” Hi, Alice!
ver · length4 · 60
TTL · protocol64 · TCP
checksum0x3c1a
source addresswhatever the sender writes
destination addressBob
data“I am Alice”

Routers read the destination. Nothing checks the source.

Authentication · ap3.01 Encryption2 Authentication3 Integrity4 TLS

Try three: send a password

ap3.0“I am Alice” + her secret password Alice Bob Alice's IP password “I am Alice” Alice's IP OK Trudy records it plays it back laterOK, Alice. encryptedap3.1
Still fooled. Trudy doesn't need to read the password to replay it. This is a playback attack.
Authentication · ap4.01 Encryption2 Authentication3 Integrity4 TLS

Try four: a number used once

Alice Bob “I am Alice” R a nonce: a fresh random number, used once R, locked with their shared key only Alice has the key, and R is new: it's her, now yesterday's answer, replayed
AskWhere did Alice and Bob get that shared key? (Slides 16–19.)
Authentication · ap5.01 Encryption2 Authentication3 Integrity4 TLS

Try five: answer with your private key

Alice Bob “I am Alice” R R, locked with Alice's private key “send me your public key” Alice's padlock (public key) her padlock opens it, and out comes R
Locking with your private key is signing, as on slide 17. Hold that thought for three slides.
Trudy in the middle1 Encryption2 Authentication3 Integrity4 TLS

Trudy swaps the keys

Alice Trudy Bob to Bob, Trudy plays Alice “I am Alice” “I am Alice” to Alice, Trudy plays Bob R R, locked with Alice's private key “send me your public key” Alice's real padlock (public key) Trudy keeps it R R, locked with Trudy's private key “send me your public key” Trudy's padlock, labelled “Alice” It opens. Hi, Alice! m, locked with “Alice's” padlock m, re-locked with Alice's real one Trudy reads m
Neither of them notices. What is missing?Someone Bob already trusts, to vouch: this padlock really is Alice's.
Certificate authority1 Encryption2 Authentication3 Integrity4 TLS

Someone both trust signs the key

Bob + proof of ID certificate authority CA's private key certificate “this padlock is Bob's”, signed check CA's public key, built into the browser Alice Bob's real padlock Trudy “Bob's padlock”, no CA signature rejected

Try it: click the padlock in your browser's address bar. That's a certificate, and the CA that signed it.

Digital signature1 Encryption2 Authentication3 Integrity4 TLS

Sign with the private key

Bob m “Dear Alice…” sign Bob's private key m + signature to Alice check Bob's public key Alice matches: Bob signed m Trudy m′, changed check doesn't match: rejected

Only Bob can make it. Anyone can check it.

Message digest1 Encryption2 Authentication3 Integrity4 TLS

Sign a fingerprint, not the whole file

Public-key signing is slow on a big message. So sign its fingerprint: a short, fixed-size digest.

any size H: hash function H(m) always the same size a fingerprint of m can't run it backwards, can't find a twin Pay Bob $20 MD5 370cbd4093e520e8a22058ef8506e414 Pay Bob $200 MD5 15ffbcb269768996a876fd6801ae6005 one character changed: a completely different fingerprint MD5 · 128 bitsfine for checking a file (Lab 3 Q3e) SHA-1 · 160 bitsbeing retired SHA-256 · 256 bitswhat TLS signs today
Signed digest1 Encryption2 Authentication3 Integrity4 TLS

Bob signs the digest; Alice compares

Bob H H(m) sign Bob's private key the signature: H(m), sealed m + signature → Trudy H H(m) =? open Bob's public key H(m) Alice m m′ H(m′)
No signature, just the digest. Trudy changes m and recomputes H. Does Alice notice?No. Anyone can compute H.Trudy can't make Bob's signature.
TLS1 Encryption2 Authentication3 Integrity4 TLS

TLS: today's tools, in one protocol

HTTP TLS TCP IP link HTTPS = HTTP over TLS, port 443 confidentialitya shared key, fast integrityHa keyed digest on every record authenticationcertificate + signature a fresh key, every timethe colours (Diffie–Hellman)
One HTTPS connection1 Encryption2 Authentication3 Integrity4 TLS

An HTTPS connection, start to finish

your browser bank.example.com from today SYN SYN-ACK ACK TCP ClientHello + my half of the colours colours TLS ServerHello + its half of the colours colours its certificate, signed by a CA its signature over the handshake Finished: a keyed digest of everything so far certificate signature keyed digest checks the certificate with the CA's public key, then the signature Finished: a keyed digest of everything so far keyed digest GET /balance your balance shared key HTTP TLS 1.3: one round trip after TCP's, and everything after ServerHello is encrypted
What it still shows1 Encryption2 Authentication3 Integrity4 TLS

What can the WiFi still see?

You log into your bank over HTTPS on GW WiFi. Name two things the network can still tell.
first IP you → DNS resolver UDP 53 bank.example.com ? then IP 10.1.4.27 → 93.184.216.34 TCP 51234 → 443 517 bytes encrypted and who, and where the site's name, before TLS starts(and again inside the ClientHello) which service, how bigwhen, and how much what: GET /balance, your password, the page
Project 2, open since last week: a two-hop relay, so that no single box knows both who you are and where you're going.
What we skipped

What we didn't cover, on purpose

Shared key · public keytoday
Authenticationtoday: ap1.0–ap5.0
Digests, signatures, certificatestoday
TLStoday
The arithmeticRSA, Diffie–Hellman, AES, how TLS makes its keys: Week 12, Tim
Firewalls, intrusion detectionvideo 8.9 · Lab 3 Q9b asks for an IDS rule
IPsec, VPNsvideo 8.7
Secure email (PGP)video 8.5 · Lab 3 shows why
WiFi and 5G securitynot covered

And GW has a whole course on network security.