Chapter 14 of 22 Part III: Cybersecurity and Privacy

The Invisible Digital Enemy

Each project below is tailored to a specific algorithm and scientific question from Chapter 14, with concrete inputs, verifiable numerical outputs, boundary cases, and links to the related lab and pioneer.

Project 1 of 3 · v1-c14-p01 Intermediate · ~25 min

Network Contagion & Patch-Threshold Model

Lab activity: A. Stop the spread · Related code: block-01.js, block-04.js · Pioneer: View profile

Real-World Problem: System administrators must decide how quickly to patch or isolate computers when a wormable flaw is announced.
Scientific Question: What minimum patch fraction p forces effective spread R_eff = R0 · (1 − p) below 1?

Objective: Simulate a safe, fictional SIR-style network graph and find the critical patching threshold that halts spread.

Hypothesis to Test: For base spread R0 = 4, patching at least 75% of nodes pushes R_eff <= 1 and stops exponential growth.

Step-by-Step Implementation

  1. Initialize 100 fictional nodes (1 initially infected, p% patched/immune, remainder vulnerable).
  2. Step generation-by-generation as infected nodes contact random neighbors.
  3. Record peak infected count and total affected nodes across four patch rates.
  4. Add network segmentation (two isolated 50-node VLANs) and observe blast-radius reduction.
Concrete Input: 100-node fictional school lab graph, R0 = 4, test patch rates p = 0%, 50%, 75%, 85%.
Expected Output: p=0% -> rapid saturation; p=75% -> containment threshold; p=85% -> outbreak dies quickly.

Test Cases: p=100% -> 0 new infections; R0=0 -> 0 new infections; Segmented lab -> second VLAN untouched.

Boundary Condition: Small graphs show random variance; average across 10 seeded runs for smooth curves.

Common Mistake to Avoid: Assuming patching 50% of computers cuts outbreak size by only 50% (herd-immunity thresholds are nonlinear).

Interpreting Results: Mathematical epidemiology directly informs defensive network architecture and rapid patching.

Show Hint, Extension Challenge & Reflection

Hint: Review the worked example and equation in Chapter 14 before testing the boundary case: Small graphs show random variance; average across 10 seeded runs for smooth curves.

Extension Challenge: Compare random patching vs. patching the 10 highest-degree hub nodes first.

Reflection Question: How did John von Neumann's self-reproducing automata theory anticipate modern software dynamics?

Project 2 of 3 · v1-c14-p02 Foundational · ~25 min

Benign Marker Scanner & Evasion Limits

Lab activity: B. Detect a fictional marker · Related code: block-02.js, block-05.js · Pioneer: View profile

Real-World Problem: Traditional antivirus tools scan files for known byte patterns (signatures), similar to the harmless EICAR test string.
Scientific Question: Why can trivial changes defeat exact-signature scanning, requiring behavioral and least-privilege defenses?

Objective: Scan fictional text buffers for a benign marker string and test exact match vs. normalized heuristic matching.

Hypothesis to Test: Inserting whitespace or changing letter casing breaks naive substring matching unless input is normalized.

Step-by-Step Implementation

  1. Create a harmless array of fictional document strings (zero real malware).
  2. Run an exact signature check and record true positives and false negatives.
  3. Test a benign file containing a similar harmless word to observe false positives.
  4. Document why defense-in-depth combines updates, sandboxing, and behavioral alerts.
Concrete Input: 5 fictional log files containing benign marker "FICTIONAL_TEST_MARKER_V1" and a spaced variant.
Expected Output: Naive scan catches exact marker only; normalized scan catches spaced variant; novel unknown marker still missed.

Test Cases: Exact marker -> detected; Clean file -> 0 false positives; Unknown pattern -> missed.

Boundary Condition: Overly broad signatures trigger false positives on legitimate files.

Common Mistake to Avoid: Relying solely on signature lists while ignoring software updates and least privilege.

Interpreting Results: Signature detection is a fast first filter, never a complete security boundary.

Show Hint, Extension Challenge & Reflection

Hint: Review the worked example and equation in Chapter 14 before testing the boundary case: Overly broad signatures trigger false positives on legitimate files.

Extension Challenge: Compute precision and recall across 10 fictional test files with 2 false-positive traps.

Reflection Question: Why do security teams run suspicious files inside isolated sandboxes (like our Web Worker runner) instead of on main machines?

Project 3 of 3 · v1-c14-p03 Intermediate · ~25 min

Defensive Incident Triage Decision Simulator

Lab activity: C. Review a fictional incident · Related code: block-03.js, block-04.js, block-05.js, block-06.js · Pioneer: View profile

Real-World Problem: During a classroom or company security alert, panic actions (like wiping logs) can make recovery worse.
Scientific Question: What ordered steps contain a suspected incident while preserving forensic evidence?

Objective: Evaluate a fictional alert timeline, isolate the affected host, preserve logs, verify clean backups, and patch root cause.

Hypothesis to Test: Isolating network access before rebooting or wiping preserves volatile evidence while halting spread.

Step-by-Step Implementation

  1. Inspect the fictional incident timeline in Activity C.
  2. Separate normal classroom traffic from the anomalous event.
  3. Sequence containment, preservation, eradication, and recovery actions.
  4. Verify that least-privilege accounts prevented the fictional issue from touching admin backups.
Concrete Input: Fictional incident log showing unusual outbound port scans from Lab-PC-07 at 14:12.
Expected Output: Scored triage plan: 1) Disconnect Lab-PC-07 from LAN, 2) Snapshot logs, 3) Identify unpatched service, 4) Restore from verified backup.

Test Cases: Containment first -> spread=0; Deleting logs first -> root cause lost.

Boundary Condition: Restoring a backup without patching the entry flaw allows immediate re-infection.

Common Mistake to Avoid: Formatting the machine immediately before identifying how the flaw occurred.

Interpreting Results: Structured incident response turns crises into repeatable engineering checklists.

Show Hint, Extension Challenge & Reflection

Hint: Review the worked example and equation in Chapter 14 before testing the boundary case: Restoring a backup without patching the entry flaw allows immediate re-infection.

Extension Challenge: Write a 5-point post-incident prevention checklist tailored to a school computer lab.

Reflection Question: Why is an offline, tested backup the strongest insurance against ransomware?