Timing attack

A side-channel attack that infers secret data, such as key bits or a password, from how long a cryptographic or security operation takes, sometimes measured across a network.

A timing attack is a form of side-channel attack that reads secrets from how long an operation takes. If an implementation’s running time depends on secret values, for example because a comparison stops at the first wrong byte of a password, or because modular exponentiation does extra work for each 1 bit of a private key, then careful measurement of many operations can reveal those values. Paul Kocher described timing attacks on RSA, Diffie-Hellman and DSS implementations in 1996, and later research measured such differences across a network against a server, so physical access is not always needed.

The attack leaves the mathematics intact, and a longer key does not help, because the attacker is reading the implementation rather than searching the key space. The main countermeasure is constant-time code, whose running time and execution path do not depend on secret data; blinding the inputs to RSA operations is another. Constant-time code addresses timing leakage but does not by itself address leakage through power consumption, which is the territory of power analysis attacks and needs different countermeasures.

Exam relevance: a scenario in which an attacker measures response times to recover a key or password is likely to be describing a timing attack, and the expected fix tends to target the leak, such as constant-time comparison, not the key length.