◇ OpenCyber Academy
Engineering · Chapter 3 · English

Chapter 3 — Physics for computing

Open, free learning for anyone who wants to protect people and technology. No account is required to read this text or its worked answers.

Chapter 3 — Physics for computing

Lesson map

Lesson 03 published. Map, example, EX007.

flowchart TD
  N0["Learning outcomes"]
  N1["3.1 Bits as physics"]
  N2["3.2 Storage reliability"]
  N3["3.3 Integrity checks"]
  N4["3.4 Heat and performance"]
  N5["3.5 The mirror mismatch"]
  N6["Redundancy"]
  N7["Checksums in practice"]
  N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> N6 --> N7
  N7 --> EX["Worked example"]
  EX --> Q["Exercise EX007"]

Logical drawing

flowchart LR
  N0["Learning outcomes"]
  N1["3.1 Bits as physics"]
  N2["3.2 Storage reliability"]
  N3["3.3 Integrity checks"]
  N4["3.4 Heat and performance"]
  N5["3.5 The mirror mismatch"]
  N6["Redundancy"]
  N7["Checksums in practice"]
  N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> N6 --> N7 --> Q["EX007"]
[Learning outcomes]
    |
    v
[3.1 Bits as physics]
    |
    v
[3.2 Storage reliability]
    |
    v
[3.3 Integrity checks]
    |
    v
[3.4 Heat and performance]
    |
    v
[3.5 The mirror mismatch]
    |
    v
[Redundancy]
    |
    v
[Checksums in practice]
    |
    v
[Worked example] --> [Exercise EX007]

Learning outcomes

You will (1) explain the physical basis of computation and storage; (2) relate energy and heat to reliability; (3) explain how physical faults can corrupt data; (4) justify integrity checks on stored artifacts.

3.1 Bits as physics

Bits are stored as charge, magnetism or light. Physical effects such as radiation, heat and wear can flip bits. Memory with error-correcting codes detects and fixes single-bit errors.

Error-correcting memory corrects single flips and detects double ones, but it does not cover every path a file takes. Data moving over networks, written to disks or held in ordinary memory on cheaper machines can still change. Engineers therefore check data at the points where it matters, such as before an artifact is deployed, rather than assuming the hardware kept it intact.

3.2 Storage reliability

Disks and flash wear out; silent corruption is rare but real at scale. Coastline's artifact mirror stores thousands of build files for years.

Over years, even small corruption rates add up across thousands of files. A file corrupted silently may not be read for months, and by then the backup may hold the same damaged copy. Regular verification finds problems while a good copy still exists. Kwame's estimate for Coastline's mirror shows that weekly checks of every file are affordable, since reading the whole store takes under an hour on the existing hardware.

3.3 Integrity checks

A cryptographic digest such as SHA-256 changes completely if any bit changes. Checking digests detects corruption and tampering alike; chapter 19 returns to this in the lab.

A digest cannot say which of the two happened, only that the bytes changed. Telling corruption from tampering needs other evidence, such as storage error logs or access records, which is why digests and logs are kept together. A digest is only as trustworthy as the place its expected value is kept: if an attacker can change both the file and the recorded digest, the check passes. Coastline stores expected digests in the build record, separate from the mirror.

3.4 Heat and performance

Hot servers slow down; build machines under heavy load can time out, producing incomplete artifacts. Monitoring temperature and build duration helps catch this.

An incomplete artifact is dangerous because it may still look plausible: a truncated archive can open and simply lack its last files. Build systems should fail loudly when a step times out rather than publishing whatever was produced. Recording each build's duration makes outliers visible; a build that suddenly takes twice as long deserves a look before its output is trusted.

3.5 The mirror mismatch

Investigation showed the mismatched mirror copy was truncated during a storage failure, not tampered with. But the team could not tell which until they compared logs.

Logs showed a disk error at the time the file was written and no unusual access, which pointed to corruption. Without those logs, the team would have had to treat the event as possible tampering and rebuild everything from source. Kwame's lesson is that detection is only half the job: the evidence to explain a mismatch must be collected before the mismatch happens.

Redundancy

Engineers protect against physical faults with redundancy: two copies on different disks, regular checks, and the ability to rebuild from source. Coastline keeps artifacts in two storage systems and can rebuild any release from its tagged source, provided the build tools and dependencies are still available. Kwame notes that rebuilding only helps if the build is reproducible, an idea from Lamb and Zacchiroli (2022) that the course returns to later.

Checksums in practice

Kwame tests the weekly check by changing one byte in a test copy; the alert fires within minutes.

Worked example

Kwame recommends the mirror verify the digest of every file on write and weekly thereafter, and that deployment refuse any artifact whose digest does not match the build record. Ingrid adopts both.

Synthetic case. The mirror incident is synthetic.

Errors and limits

Digests detect change but not whether the original build was trustworthy.

Exercises

Synthesis

Physics makes corruption possible; digests make it detectable.

Continue studying — chapter 03 of 50

← Chapter 02 (draft) · Course chapter index · Chapter 04 (draft) →