Side-channel attack explained

In computer security, a side-channel attack is any attack based on extra information that can be gathered because of the fundamental way a computer protocol or algorithm is implemented, rather than flaws in the design of the protocol or algorithm itself (e.g. flaws found in a cryptanalysis of a cryptographic algorithm) or minor, but potentially devastating, mistakes or oversights in the implementation. (Cryptanalysis also includes searching for side-channel attacks.) Timing information, power consumption, electromagnetic leaks, and sound are examples of extra information which could be exploited to facilitate side-channel attacks.

Some side-channel attacks require technical knowledge of the internal operation of the system, although others such as differential power analysis are effective as black-box attacks. The rise of Web 2.0 applications and software-as-a-service has also significantly raised the possibility of side-channel attacks on the web, even when transmissions between a web browser and server are encrypted (e.g. through HTTPS or WiFi encryption), according to researchers from Microsoft Research and Indiana University.[1]

Attempts to break a cryptosystem by deceiving or coercing people with legitimate access are not typically considered side-channel attacks: see social engineering and rubber-hose cryptanalysis. General classes of side-channel attack include:

In all cases, the underlying principle is that physical effects caused by the operation of a cryptosystem (on the side) can provide useful extra information about secrets in the system, for example, the cryptographic key, partial state information, full or partial plaintexts and so forth. The term cryptophthora (secret degradation) is sometimes used to express the degradation of secret key material resulting from side-channel leakage.

Examples

A works by monitoring security critical operations such as AES T-table entry[2] or modular exponentiation or multiplication or memory accesses. The attacker then is able to recover the secret key depending on the accesses made (or not made) by the victim, deducing the encryption key. Also, unlike some of the other side-channel attacks, this method does not create a fault in the ongoing cryptographic operation and is invisible to the victim.

In 2017, two CPU vulnerabilities (dubbed Meltdown and Spectre) were discovered, which can use a cache-based side channel to allow an attacker to leak memory contents of other processes and the operating system itself.

A timing attack watches data movement into and out of the CPU or memory on the hardware running the cryptosystem or algorithm. Simply by observing variations in how long it takes to perform cryptographic operations, it might be possible to determine the entire secret key. Such attacks involve statistical analysis of timing measurements and have been demonstrated across networks.[3]

A power-analysis attack can provide even more detailed information by observing the power consumption of a hardware device such as CPU or cryptographic circuit. These attacks are roughly categorized into simple power analysis (SPA) and differential power analysis (DPA). One example is Collide+Power, which affects nearly all CPUs.[4] [5] Other examples use machine learning approaches.[6]

Fluctuations in current also generate radio waves, enabling attacks that analyze measurements of electromagnetic (EM) emanations. These attacks typically involve similar statistical techniques as power-analysis attacks.

A deep-learning-based side-channel attack,[7] [8] [9] using the power and EM information across multiple devices has been demonstrated with the potential to break the secret key of a different but identical device in as low as a single trace.

Historical analogues to modern side-channel attacks are known. A recently declassified NSA document reveals that as far back as 1943, an engineer with Bell telephone observed decipherable spikes on an oscilloscope associated with the decrypted output of a certain encrypting teletype.[10] According to former MI5 officer Peter Wright, the British Security Service analyzed emissions from French cipher equipment in the 1960s.[11] In the 1980s, Soviet eavesdroppers were suspected of having planted bugs inside IBM Selectric typewriters to monitor the electrical noise generated as the type ball rotated and pitched to strike the paper; the characteristics of those signals could determine which key was pressed.[12]

Power consumption of devices causes heating, which is offset by cooling effects. Temperature changes create thermally induced mechanical stress. This stress can create low level acoustic emissions from operating CPUs (about 10 kHz in some cases). Recent research by Shamir et al. has suggested that information about the operation of cryptosystems and algorithms can be obtained in this way as well. This is an acoustic cryptanalysis attack.

If the surface of the CPU chip, or in some cases the CPU package, can be observed, infrared images can also provide information about the code being executed on the CPU, known as a thermal-imaging attack.

An optical side-channel attack examples include gleaning information from the hard disk activity indicator to reading a small number of photons emitted by transistors as they change state.

Allocation-based side channels also exist and refer to the information that leaks from the allocation (as opposed to the use) of a resource such as network bandwidth to clients that are concurrently requesting the contended resource.

Countermeasures

Because side-channel attacks rely on the relationship between information emitted (leaked) through a side channel and the secret data, countermeasures fall into two main categories: (1) eliminate or reduce the release of such information and (2) eliminate the relationship between the leaked information and the secret data, that is, make the leaked information unrelated, or rather uncorrelated, to the secret data, typically through some form of randomization of the ciphertext that transforms the data in a way that can be undone after the cryptographic operation (e.g., decryption) is completed.

Under the first category, displays with special shielding to lessen electromagnetic emissions, reducing susceptibility to TEMPEST attacks, are now commercially available. Power line conditioning and filtering can help deter power-monitoring attacks, although such measures must be used cautiously, since even very small correlations can remain and compromise security. Physical enclosures can reduce the risk of surreptitious installation of microphones (to counter acoustic attacks) and other micro-monitoring devices (against CPU power-draw or thermal-imaging attacks).

Another countermeasure (still in the first category) is to jam the emitted channel with noise. For instance, a random delay can be added to deter timing attacks, although adversaries can compensate for these delays by averaging multiple measurements (or, more generally, using more measurements in the analysis). When the amount of noise in the side channel increases, the adversary needs to collect more measurements.

Another countermeasure under the first category is to use security analysis software to identify certain classes of side-channel attacks that can be found during the design stages of the underlying hardware itself. Timing attacks and cache attacks are both identifiable through certain commercially available security analysis software platforms, which allow for testing to identify the attack vulnerability itself, as well as the effectiveness of the architectural change to circumvent the vulnerability. The most comprehensive method to employ this countermeasure is to create a Secure Development Lifecycle for hardware, which includes utilizing all available security analysis platforms at their respective stages of the hardware development lifecycle.[13]

In the case of timing attacks against targets whose computation times are quantized into discrete clock cycle counts, an effective countermeasure against is to design the software to be isochronous, that is to run in an exactly constant amount of time, independently of secret values. This makes timing attacks impossible.[14] Such countermeasures can be difficult to implement in practice, since even individual instructions can have variable timing on some CPUs.

One partial countermeasure against simple power attacks, but not differential power-analysis attacks, is to design the software so that it is "PC-secure" in the "program counter security model". In a PC-secure program, the execution path does not depend on secret values. In other words, all conditional branches depend only on public information. (This is a more restrictive condition than isochronous code, but a less restrictive condition than branch-free code.) Even though multiply operations draw more power than NOP on practically all CPUs, using a constant execution path prevents such operation-dependent power differences (differences in power from choosing one branch over another) from leaking any secret information. On architectures where the instruction execution time is not data-dependent, a PC-secure program is also immune to timing attacks.[15] [16]

Another way in which code can be non-isochronous is that modern CPUs have a memory cache: accessing infrequently used information incurs a large timing penalty, revealing some information about the frequency of use of memory blocks. Cryptographic code designed to resist cache attacks attempts to use memory in only a predictable fashion (like accessing only the input, outputs and program data, and doing so according to a fixed pattern). For example, data-dependent table lookups must be avoided because the cache could reveal which part of the lookup table was accessed.

Other partial countermeasures attempt to reduce the amount of information leaked from data-dependent power differences. Some operations use power that is correlated to the number of 1 bits in a secret value. Using a constant-weight code (such as using Fredkin gates or dual-rail encoding) can reduce the leakage of information about the Hamming weight of the secret value, although exploitable correlations are likely to remain unless the balancing is perfect. This "balanced design" can be approximated in software by manipulating both the data and its complement together.[14]

Several "secure CPUs" have been built as asynchronous CPUs; they have no global timing reference. While these CPUs were intended to make timing and power attacks more difficult,[14] subsequent research found that timing variations in asynchronous circuits are harder to remove.[17]

A typical example of the second category (decorrelation) is a technique known as blinding. In the case of RSA decryption with secret exponent

d

and corresponding encryption exponent

e

and modulus

m

, the technique applies as follows (for simplicity, the modular reduction by m is omitted in the formulas): before decrypting, that is, before computing the result of

yd

for a given ciphertext

y

, the system picks a random number

r

and encrypts it with public exponent

e

to obtain

re

. Then, the decryption is done on

yre

to obtain

{(yre)}d=ydre=ydr

. Since the decrypting system chose

r

, it can compute its inverse modulo

m

to cancel out the factor

r

in the result and obtain

yd

, the actual result of the decryption. For attacks that require collecting side-channel information from operations with data controlled by the attacker, blinding is an effective countermeasure, since the actual operation is executed on a randomized version of the data, over which the attacker has no control or even knowledge.

A more general countermeasure (in that it is effective against all side-channel attacks) is the masking countermeasure. The principle of masking is to avoid manipulating any sensitive value

y

directly, but rather manipulate a sharing of it: a set of variables (called "shares")

y1,...,yd

such that

y=y1...yd

(where

is the XOR operation). An attacker must recover all the values of the shares to get any meaningful information.[18]

Recently, white-box modeling was utilized to develop a low-overhead generic circuit-level countermeasure [19] against both EM as well as power side-channel attacks. To minimize the effects of the higher-level metal layers in an IC acting as more efficient antennas,[20] the idea is to embed the crypto core with a signature suppression circuit,[21] [22] routed locally within the lower-level metal layers, leading towards both power and EM side-channel attack immunity.

See also

Further reading

Books

Articles

External links

Notes and References

  1. Side-Channel Leaks in Web Applications: a Reality Today, a Challenge Tomorrow. Microsoft Research. IEEE Symposium on Security & Privacy 2010. May 2010. Shuo Chen. Rui Wang. XiaoFeng Wang. Kehuan Zhang. amp. 2011-12-16. 2016-06-17. https://web.archive.org/web/20160617004603/http://research.microsoft.com/pubs/119060/WebAppSideChannel-final.pdf. live.
  2. Book: Highly Efficient Algorithms for AES Key Retrieval in Cache Access Attacks . 2016 . Ashokkumar C. . 2016 IEEE European Symposium on Security and Privacy (EuroS&P) . 261–275 . Ravi Prakash Giri . Bernard Menezes. 10.1109/EuroSP.2016.29 . 978-1-5090-1751-5 . 11251391 .
  3. Web site: Remote timing attacks are practical. David Brumley. Dan Boneh. 2003. 2010-11-05. 2011-07-28. https://web.archive.org/web/20110728122336/http://crypto.stanford.edu/~dabo/papers/ssl-timing.pdf. live.
  4. Web site: Kovacs . Eduard . 2023-08-01 . Nearly All Modern CPUs Leak Data to New Collide+Power Side-Channel Attack . 2023-08-02 . SecurityWeek . en-US . 2024-07-11 . https://web.archive.org/web/20240711072553/https://www.securityweek.com/nearly-all-modern-cpus-leak-data-to-new-collidepower-side-channel-attack/ . live .
  5. Web site: Claburn . Thomas . Another CPU data-leak flaw found. Luckily, it's impractical . 2023-08-02 . www.theregister.com . en.
  6. Lerman . Liran . Bontempi . Gianluca . Markowitch . Olivier . Power analysis attack: an approach based on machine learning . International Journal of Applied Cryptography . 1 January 2014 . 3 . 2 . 97–115 . 10.1504/IJACT.2014.062722 . 1753-0563 . 25 September 2020 . 25 January 2021 . https://web.archive.org/web/20210125184717/https://www.inderscienceonline.com/doi/abs/10.1504/IJACT.2014.062722 . live .
  7. Timon . Benjamin . 2019-02-28 . Non-Profiled Deep Learning-based Side-Channel attacks with Sensitivity Analysis . IACR Transactions on Cryptographic Hardware and Embedded Systems . 2569-2925 . 107–131 . 10.13154/tches.v2019.i2.107-131 . 4052139 . 2021-11-19 . 2021-11-12 . https://web.archive.org/web/20211112113503/https://tches.iacr.org/index.php/TCHES/article/view/7387 . live .
  8. https://ieeexplore.ieee.org/document/8806883 "X-DeepSCA: Cross-Device Deep Learning Side Channel Attack"
  9. https://ieeexplore.ieee.org/abstract/document/8777157 "Practical Approaches Toward Deep-Learning-Based Cross-Device Power Side-Channel Attack"
  10. Declassified NSA document reveals the secret history of TEMPEST. Wired. Wired.com. April 29, 2008. May 2, 2008. May 1, 2008. https://web.archive.org/web/20080501092403/http://blog.wired.com/27bstroke6/2008/04/nsa-releases-se.html. live.
  11. Web site: An Introduction to TEMPEST | SANS Institute. 2015-10-06. 2017-09-05. https://web.archive.org/web/20170905172700/https://www.sans.org/reading-room/whitepapers/privacy/introduction-tempest-981. live.
  12. The Art of High-Tech Snooping. https://web.archive.org/web/20110604062749/http://www.time.com/time/magazine/article/0,9171,964052-2,00.html. June 4, 2011. Time. Church . George. April 20, 1987. January 21, 2010.
  13. Web site: Identifying Isolation Issues in Modern Microprocessor Architectures. Tortuga Logic. 2018. 2018-02-23. 2018-02-24. https://web.archive.org/web/20180224113055/http://www.tortugalogic.com/isolation/.
  14. http://www.era.lib.ed.ac.uk/bitstream/1842/860/1/Spadavecchia_thesis.pdf "A Network-based Asynchronous Architecture for Cryptographic Devices"
  15. https://www.cs.berkeley.edu/~daw/papers/pcmodel-long.pdf "The Program Counter Security Model: Automatic Detection and Removal of Control-Flow Side Channel Attacks"
  16. Web site: "The Program Counter Security Model: Automatic Detection and Removal of Control-Flow Side Channel Attacks" USENIX Work-in-Progress presentation of paper . 2014-10-04 . 2017-08-14 . https://web.archive.org/web/20170814055923/https://www.usenix.org/legacy/events/sec05/wips/molnar.pdf . live .
  17. Book: Jeong. C.. Nowick. S. M.. 2007 Asia and South Pacific Design Automation Conference . Optimization of Robust Asynchronous Circuits by Local Input Completeness Relaxation . January 2007. https://ieeexplore.ieee.org/document/4196101/;jsessionid=dvEHDfrAohpjVZcxALGqKOFtVVYE7st919bZU5l_tSBwb8sdBn1t!696014846. 622–627. 10.1109/ASPDAC.2007.358055. 978-1-4244-0629-6. 14219703.
  18. https://www.iacr.org/archive/eurocrypt2013/78810139/78810139.pdf "Masking against Side-Channel Attacks: A Formal Security Proof"
  19. https://ieeexplore.ieee.org/document/9062997 "EM and Power SCA-Resilient AES-256 in 65nm CMOS Through >350× Current-Domain Signature Attenuation"
  20. https://ieeexplore.ieee.org/document/8740839 "STELLAR: A Generic EM Side-Channel Attack Protection through Ground-Up Root-cause Analysis"
  21. https://ieeexplore.ieee.org/document/8351968 "ASNI: Attenuated Signature Noise Injection for Low-Overhead Power Side-Channel Attack Immunity"
  22. https://ieeexplore.ieee.org/document/7951799 "High efficiency power side-channel attack immunity using noise injection in attenuated signature domain"