What is side-channel attack?
Answer
A side-channel attack exploits information leaked by the physical implementation of a cryptographic system — rather than weaknesses in the algorithm itself. The algorithm may be mathematically sound, but its implementation leaks information through measurable physical phenomena. Types: Timing attacks: measure time taken to execute cryptographic operations — variations reveal information about the secret key (non-constant-time comparisons). Power analysis: measure power consumption of hardware during crypto operations (Simple Power Analysis, Differential Power Analysis). Electromagnetic (EM) attacks: measure electromagnetic emissions. Cache attacks: Spectre and Meltdown exploited CPU cache behavior to read arbitrary memory across process boundaries (2018 — affected virtually all modern CPUs). Acoustic attacks: extract RSA keys from laptop fan noise during decryption. Countermeasures: constant-time implementations (no secret-dependent branches/memory access), blinding (randomize intermediate values), hardware shielding, and noise injection. Always use vetted cryptographic libraries rather than implementing crypto yourself.