Paper 3 defends billions of small connected devices with four pieces of machinery welded into one pipeline: an LSTM that treats attacks as forecasting errors, a salted hash that makes tampering visible, a Q-learning agent that decides how to fight back, and lattice-based encryption built to survive quantum computers. This module teaches each technology from scratch — the paper itself is Module 13's walkthrough.
The Internet of Things is billions of small networked devices — sensors, actuators, cameras, medical monitors, smart meters — most of them cheap, always on, and rarely updated. Every one of them is a door into a network, so connectivity growth is literally attack-surface growth. The classics set the tone: WannaCry (2017) — ransomware that swept hospitals and corporations worldwide; SolarWinds (2020) — a supply-chain breach that rode trusted software updates into government agencies; the Mirai botnet — hundreds of thousands of hacked IoT devices (cameras, routers) conscripted into a giant attack army.
Traditional defenses are rule-based and signature-based: they recognize attacks by matching them against a catalogue of known patterns. Three structural failures follow. They only catch known attacks; the catalogue needs constant manual updating; and they are far too slow for zero-day threats — attacks exploiting vulnerabilities no one has catalogued yet. In a dynamic IoT network, a defense that must be told what an attack looks like is always one attack behind.
Here is the elegant reuse: Paper 3's detector is the same machine you mastered in Module 5 — an LSTM doing next-step time-series forecasting. Network traffic (packet sizes, inter-arrival times, protocol and source/destination identifiers, normalized and one-hot encoded) becomes a time series X = {x1, …, xT}, and the LSTM is trained with an MSE loss on 30-second lookback windows to predict what normal traffic does next:
At run time, the trick is to measure surprise. Compare what actually arrived with what the model expected:
Small error: traffic is behaving as normal traffic behaves. Large error: something the model has never seen is happening — flag it. The paper trains and evaluates on a simulated IoT network of ~150,000 labeled events, 60% normal and 40% attacks (DoS floods, data injection, spoofing).
Everything above hinges on one number: τ. Paper 3 sets it at the 95th percentile of observed prediction errors (MSE values) — i.e. the top 5% most surprising moments get flagged. The choice is a trade-off dial, and you already have the vocabulary for it from Module 7: set τ low and you flag constantly — high recall (sensitivity), terrible precision, an operator drowning in false alarms; set τ high and alarms are trustworthy but real attacks slip underneath — high specificity, missed detections. A 95th-percentile cut is a reasonable default: it adapts to the error distribution of this network rather than a hard-coded magic number.
This course has now shown you three ways a machine can learn. Supervised: learn from labelled examples (Paper 1's forecasters). Self-supervised: generate your own labels from the data (Paper 2's robot). The third paradigm is reinforcement learning (RL): an agent acts in an environment, receives rewards for good outcomes, and learns a policy — a rule for choosing actions — by trial and error. Nobody shows it correct answers; it discovers them through consequences.
The formal frame is a Markov Decision Process (S, A, P, R, γ): a set of states S the environment can be in, actions A the agent can take, transition probabilities P for where each action leads, a reward function R scoring outcomes, and a discount factor γ between 0 and 1. Discounting is just impatience made precise: a reward n steps in the future is worth γn of the same reward now — the future counts, but a bit less, so the agent prefers sooner payoffs and its sums stay finite.
Q-learning is the workhorse algorithm: learn a table Q(s, a) = the expected long-term (discounted) reward of taking action a in state s. Every experience nudges the table:
Read it symbol by symbol: α is the learning rate (how big a nudge); R is the reward just received; s′ is the state you landed in; maxa′ Q(s′, a′) is the best you believe you can do from there; and the bracket is the surprise — the gap between what this action turned out to be worth (immediate reward plus discounted best future) and what the table currently claims. Positive surprise nudges Q(s, a) up; negative nudges it down. Along the way the agent must balance exploration vs exploitation: sometimes try actions that look worse, or you never discover they were better.
Paper 3 keeps the setup deliberately small. States = threat levels reported by the detector: no attack, mild attack, severe attack. Actions = block (passive defense: drop/quarantine the traffic) or counter-attack (active defense against the source). Rewards are calibrated to threat severity, so the agent's incentives mirror real damage. The learned Q-table (the paper's Table 3):
| State | Block | Counter-attack |
|---|---|---|
| No attack | 0.00 | 0.00 |
| Mild attack | 10.00 | 5.00 |
| Severe attack | 5.00 | 15.00 |
Read the policy off the table by taking the best action per row, and notice it is sensible: when nothing is happening, do nothing — defensive maneuvers cost resources and there is no threat to justify them. For a mild attack, blocking (10) beats counter-attacking (5): neutralize the low-level threat cheaply and avoid escalation or collateral damage. For a severe attack, counter-attacking (15) beats blocking (5): against a high-severity threat, passive defense is not enough — decisive active measures stop the damage before it lands.
Detection asks "is this traffic behaving normally?" Integrity asks a different question: "is this data the same data that was sent?" The tool is a cryptographic hash function: a one-way function mapping any input to a fixed-size fingerprint (SHA-256: 256 bits), designed so that any change to the input — a single flipped bit — produces a completely different hash. Recompute the hash on arrival; if it no longer matches, the data was tampered with in transit. The salt s is a secret extra input mixed in before hashing, so an attacker who intercepts data cannot precompute or forge matching hashes without knowing s:
The "homomorphic" property Paper 3 leans on: integrity can be verified on encrypted or distributed data without revealing its content — the check runs on fingerprints, never on the plaintext. That enables two things IoT badly needs. It is decentralized: any node can verify locally, with no round-trip to a central validation server that would be a bottleneck and a single point of failure. And it is lightweight: hashing is cheap enough for real-time, packet-level checks on constrained devices.
Today's public-key encryption (RSA, elliptic curves) rests on problems like factoring huge numbers — hard for ordinary computers, but Shor's algorithm running on a large quantum computer would solve them efficiently, breaking RSA and ECC outright. Post-quantum cryptography means schemes built on problems believed hard even for quantum computers. The leading family is lattice-based cryptography, grounded in the Learning With Errors (LWE) problem:
The intuition: given A and y with exact equations (e = 0), recovering the secret x is basic linear algebra — easy. But add a little random noise e to every equation and the system becomes computationally intractable to unscramble: you can no longer tell which tiny errors were added where, and every candidate x is thrown off by noise you cannot separate out. Noisy linear equations are hard to solve — for classical and, as far as anyone knows, quantum computers alike. As a bonus, LWE-based schemes support homomorphic operations — computing on data while it stays encrypted — which pairs naturally with 12.6's verify-without-revealing theme. For constrained IoT hardware, lightweight variants such as RLWE (ring-structured, smaller keys) and the Foxtail+ protocol trade parameters for memory and energy efficiency; Paper 3 additionally precomputes keys so encryption adds minimal latency between devices.