◇ 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 Computation is physical"]
  N2["3.2 Timing and power"]
  N3["3.3 Physical randomness"]
  N4["Synthesis"]
  N0 --> N1 --> N2 --> N3 --> N4
  N4 --> EX["Worked example"]
  EX --> Q["Exercise EX007"]

Logical drawing

flowchart LR
  N0["Learning outcomes"]
  N1["3.1 Computation is physical"]
  N2["3.2 Timing and power"]
  N3["3.3 Physical randomness"]
  N4["Synthesis"]
  N0 --> N1 --> N2 --> N3 --> N4 --> Q["EX007"]
[Learning outcomes]
    |
    v
[3.1 Computation is physical]
    |
    v
[3.2 Timing and power]
    |
    v
[3.3 Physical randomness]
    |
    v
[Synthesis]
    |
    v
[Worked example] --> [Exercise EX007]

Learning outcomes

You will (1) relate physical signals to information leakage; (2) explain side channels such as timing and power; (3) connect physical randomness to key generation.

3.1 Computation is physical

Every computation draws current, takes time and emits heat and electromagnetic radiation. Aiyana's physics course connects this to security: a meter that processes a secret key may leak information through how long an operation takes or how much power it draws. These leaks are called side channels. They matter because Ridgeway's meters sit in basements and street pits where an attacker could attach probes. A mathematically strong algorithm can be broken in practice if its implementation leaks key bits through physics, which is why standards bodies and vendors test implementations, not just designs.

3.2 Timing and power

A timing side channel appears when execution time depends on secret data, for example a comparison that stops at the first wrong byte. Measuring many attempts can reveal how many leading bytes were correct. Power analysis records the current drawn during cryptographic operations; differences between processing a 0 bit and a 1 bit can, with statistics, reveal keys. Defences include constant-time code, masking and hardware designed to resist analysis. Aiyana learns that Python's hmac.compare_digest exists precisely so that comparing authentication tags takes the same time regardless of where they differ.

3.3 Physical randomness

Keys must be unpredictable, and unpredictability ultimately comes from physical noise such as thermal fluctuations or oscillator jitter. Hardware entropy sources feed deterministic random bit generators, specified in NIST SP 800-90A, which stretch a small, well-measured seed into many unpredictable bits. A meter that boots with the same state every time, without good entropy, may produce the same keys as thousands of other meters. Aiyana notes that operating systems expose vetted generators, and Python's secrets module uses them, so engineers should never invent their own random number routines for keys.

Worked example

Aiyana lists three physical leaks for a street-pit meter (timing, power, electromagnetic emission) and maps each to a defence: constant-time comparison, masked hardware and shielding, plus vetted entropy for key generation.

Synthetic case. The meter deployment is invented; SP 800-90A is the real NIST recommendation.

Errors and limits

Side-channel resistance cannot be confirmed by reading code alone; it needs measurement on the real device. Physical entropy can fail silently, so generators must be health-tested.

Exercises

Synthesis

Cryptography runs on physical devices; timing, power and entropy determine whether a sound algorithm stays secure in a basement meter.

Continue studying — chapter 03 of 50

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