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
- EX007 — Side channel defined. What is a side channel? Rubric: 3 = information leaked through physical effects like time or power rather than the algorithm's outputs;; 2 = "physical attack";; 1 = network attack;; 0 = none.
- EX008 — Early-exit comparison. Why does a byte-by-byte comparison that stops early leak secrets? Rubric: 3 = time reveals how many leading bytes matched;; 2 = slower;; 1 = no leak;; 0 = none.
- EX009 — Role of SP 800-90A. What does SP 800-90A specify and why does it matter to meters? Rubric: 3 = deterministic random bit generators seeded by entropy so meters do not produce identical keys;; 2 = randomness;; 1 = encryption;; 0 = none.
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) →