The present invention relates to security of integrated circuits, and particularly to methods and apparatuses for the detection of power supply side-channel attacks.
Side-channel attacks, including power-supply attacks, are used to extract secrets from integrated circuits (ICs). As a protective means, ICs sometime include means to monitor the power supply input.
In “Power supply glitch attacks: Design and evaluation of detection circuits”, K. Gomina et. al., 2014 IEEE International Symposium on Hardware-Oriented Security and Trust (DOI: 10.1109/HST.2014.6855584), the authors analyze mechanisms involved during such attacks and show that timing properties of logic gates are very sensitive to power glitches and can be used to inject faults. A new approach to validate power glitch detection circuits is presented, allowing the evaluation of the circuits using a standard digital design flow.
In “Detecting Power Attacks on Reconfigurable Hardware”, Le Masle & Luk (22nd International Conference on Field Programmable Logic and Applications (FPL)”), 29-31 Aug. 2012 (DOI: 10.1109/FPL.2012.6339235), the authors present a framework to detect power attacks on crypto-systems implemented on reconfigurable hardware. The authors describe the monitoring of the device supply voltage with a ring oscillator-based on-chip power monitor. In order to detect the insertion of power measurement circuits onto a device's power rail, a power attack detection strategy taking into account abnormal supply voltages and power rail resistance values is developed. This strategy is integrated into an on-chip attack detector. The results on an AES and RSA crypto-system show that the attack detection framework can reach false-positive and false-negative rates as low as 0% over all selected test cases if proper operating margins are set.
Lastly, “How a voltage glitch attack could cripple your SoC or MCU”, an INVIA Application Note (rev 1.0, Jun. 30, 2020), shows that voltage glitching is a simple, cheap way for hackers and criminals to perform fault injection exploits on any accessible device and asserts that protection against this attack technique requires layered security, including fast, reliable detection of transient voltage events on the target device's power supply and attacked-resilient hardware and software. The application-note then describes a voltage glitch detection circuit.
An embodiment that is described herein provides an attack-detection (A-DET) circuit in an integrated circuit. The A-DET includes a main detector and a spike detection circuit. The main detector is configured to, while activated, detect an abnormal level of a power supply input of the integrated circuit. The spike detection circuit is configured to detect a transition on the power supply input and to send an activation indication to the main detector responsively the detected transition.
In some embodiment, the main detector is configured to alternate, responsively to the activation indication, between a low-power mode of operation to detect relatively slow power level drops, and, for fast glitch detection, a high-speed mode of operation, having a faster level-detection speed but higher power consumption. In an embodiment, the main detector is configured to alternate, responsively to the activation indication, between an inactive mode of operation, and an active mode of operation. In a disclosed embodiment, the main detector is configured to alternate, responsively to the activation indication, between a limited-functionality mode of operation (in which relatively slow power level drops are detected), and a full-functionality mode of operation.
In some embodiments, the activation indication includes a boost supply current. In an example embodiment, the A-DET power supply comprises a regulated power source. In another embodiment, the A-DET further includes a Low Drop-Out (LDO) regulated power source that is configured to supply a stable voltage to the main detector according to a reference voltage input. The A-DET may further include a band-gap reference (BG-REF) that is configured to produce the reference voltage. In an embodiment, the spike detection circuit is configured to detect transitions in the power supply input that are greater than a preset threshold.
There is additionally provided, in accordance with an embodiment described herein, an attack-detection method in an integrated circuit. Using a main detector, while activated, an abnormal level of a power supply input of the integrated circuit is detected. Using a spike detection circuit, a transition is detected on the power supply input, and an activation indication is sent to the main detector responsively the detected transition.
The present invention will be more fully understood from the following detailed description of the embodiments thereof, taken together with the drawings in which:
Side-channel attacks are used to extract secrets from integrated circuits (ICs), such as encryption or authentication keys, typically through the supply input (referred to herein as Vcc). A common side-channel attack technique involves the application of supply voltages that exceed the operating requirements of the IC, which result in incorrect operations and may allow the extraction of stored secrets. As a protective means, ICs sometimes include means to monitor the power supply input and detect irregularities; however, as the attack may include application of very short pulses on the supply input, the detection circuit must be fast and hence may consume a substantial amount of power. The detection circuit should also be accurate, so that normal Vcc fluctuations will not be interpreted as security attacks.
Embodiments of the present invention that are disclosed herein provide for attack detection circuits and methods that feature both good accuracy and low average power consumption.
In an embodiment, the IC comprises an Attack Detection circuit (A-DET) that includes a fast spike detection circuit that detects and signals transitions on the Vcc power supply, and a main detector that accurately compares the Vcc level to a preset limit, indicating if the limit is exceeded. In some embodiments the main detector is inactive until the spike detection circuit signals a Vcc transition (“spike”). In other embodiments, the main detector is at a low power consumption “standby” mode in which the power consumption is low, and the comparison is slow; responsively to a spike detection indication, the main detector enters a fast mode of operation for a short period.
In an embodiment, the spike detection circuit comprises a comparator with a capacitive feed-forward path, for fast spike response. In embodiments, the spike detection circuit comprises matched transistors, for better accuracy.
Lastly, in some embodiments, the A-DET comprises a Low-Dropout (LDO) Band-Gap-Reference (BGREF)-controlled Vldo power supply, which filters Vcc spikes and provides sensitive A-DET circuit with a stable operating power supply.
IC 100 comprises an attack-detection (A-DET) circuit 102, which is configured to detect abnormal voltage levels of the IC Vcc supply input (the term Vdd is often used in MOS-based ICs; however, for the description hereinbelow, we prefer the traditional term Vcc).
If such an abnormal level is detected, A-DET 102 is configured to send an Attack Detection indication, for example, to a Reset circuitry (not shown) in IC 100 or, in another example, to gates that disable all IC outputs. Thus, a power-supply attack on IC 100 may be detected and force IC 100 to reset, or, alternatively, to block all outputs, protecting any sensitive data that is stored in IC 100.
In embodiments, A-DET 102 is fast, and can detect short Vcc level drops. At the same time, since A-DET 102 is typically active whenever IC 100 is on (to provide continuous protection), A-DET power consumption is relatively low.
To achieve such contradictory requirements, A-DET 102 comprises a low-power Spike Detection circuit 104 that is configured to detect and signal transitions in the Vcc level, and a higher-power main detector 106 that accurately compares the Vcc level to a preset Vref level. Spike-Detection circuit 104 sends, responsively to a VCC transition, an activation indication to main detector 106. In an embodiment, the main detector is inactive by default, but turns active when the spike-detection circuit indicates a Vcc level transition (that is, sends an activation indication). In another embodiment, the main detector is in a default limited functionality low-power (but slow operation) mode, and switches to a full functionality high-speed (but higher power) mode responsively to the activation indication.
In practice, spike detection indications do not always indicate a Vcc attack; the main detector, which comprises an accurate voltage level comparison circuit, may ignore some or all spike detection indications. Such false detections will result in short periods of time in which the main detector consumes power, but, on average, the power consumption of A-DET 102 will be relatively low. It should be noted that false detections will be rare thanks to the structure of the spike detector, which screens out normal supply noise (the architecture of a spike detector according to embodiments will be described below, with reference to
In an embodiment, the activation indication that the spike-detection circuit sends is a boost current, which adds to a lower current that the main detector consumes in low-power-consumption mode. In embodiments, the power consumption of the spike detector is considerably lower (e.g., 2 μA vs. 72 μA).
The configuration of IC 100 and A-DET 102, illustrated in
The flowchart starts at a Spike-Detection operation 202, wherein the main detector is in a standby/slow detection mode and the Spike-Detection circuit is looking for a transition (also referred to as Spike) in the Vcc power supply input. The power consumption of the main detector is low or zero (in some embodiments, the power is higher than zero, to allow fast wakeup). The flowchart will remain in Spike Detection operation 202, looking for a transition, until a transition is found.
When the spike detection circuit detects a Vcc transition, the flowchart enters a VCC Attack Detection operation 204, wherein, (i) the spike detection circuit sends a boost current to the main detector, setting the main detector in the fast-detection mode (also referred to as active mode) (ii) the main detector compares Vcc to a Vref, and (iii) a timer checks that the time period in which the flowchart is in operation 204 does not exceed a preset limit. As long as the time limit is not exceeded, and as long as Vcc>=Vref, the flowchart will remain in VCC Attack Detection operation 204.
If the time limit is exceeded (an event referred to as Timeout), the flowchart will reenter Spike Detection operation 202, to reduce the power consumption and look for further Vcc transitions. If, while in operation 204, the main detector detects that Vcc<Vref, the main detector will send an Attack-Detected indication signal, which will activate protective measures (e.g., reset the device, or block all output pads), keeping the secret information safe.
The flowchart illustrated in
We will now proceed to describe the detailed design of a spike detection circuit and a main detection circuit, according to an embodiment.
According to the example embodiment illustrated in
A-DET 300 further comprises a Spike-Detection circuit 302 that is configured to detect transitions on the Vcc power supply and a Main Detector circuit 304, configured to accurately compare Vcc to a Vref.
For shorter notation, we will refer hereinbelow to N-channel Metal-Oxide-Silicon transistors as NMOS Transistors, or NMOS, and to P-channel Metal-Oxide-Silicon transistors as PMOS Transistors, or PMOS.
Main Detector 304 comprises a PMOS 306, a PMOS 308, an NMOS 310 and an NMOS 312. The pair comprising PMOS 306 and NMOS 310, and the matched pair comprising PMOS 308 and NMOS 312 are connected between Vldo and a node 314. When a current source sinks a constant current Isink from node 314, the four transistors compare the voltage at the gate of NMOS 310 to the voltage at the gate of NMOS 312. The comparison can be slow (e.g., 10 ns) or fast (e.g., 2 ns), according to Isink. The voltages at the gate of NMOS 310 and NMOS 312 are set by a resistor 316, a resistor 318, a resistor 320 and a resistor 322:
Vg310=Vcc*R318/(R318+R316)
Vg312=Vldo*R322/(R322+R320)
Thus, by selecting suitable resistor values, Vcc will be compared to a preset threshold, and the node marked “sense” will assume a low voltage whenever Vcc falls below the threshold. The low voltage is inverted by an inverter 324 to a high voltage that sets a latch 328, which outputs an Attach-Detected indication. A delay circuit 330 resets latch 328 after a preset delay (e.g., 50 ns), so that Attack Detected will be a pulse that is long enough for digital response to take place. Further attacks could be detected after the pulse has reset.
According to the example embodiment illustrated in
The gate of NMOS 336 is connected, like the gate of NMOS 332, to Nbias, but, in an embodiment, the width to length ratio of NMOS 336 is considerably larger (e.g., ×4) than that of NMOS 332, so that main detector 304 will now compare Vcc to Vref considerably faster.
As will be explained below, with reference to
The configuration of A-Detect circuit 300, illustrated in
A node 402 is set at a voltage V1 according to the fixed Vldo, the varying (and attack-prone) Vcc, and the ratio between a resistor 404 and a resistor 406. A first conduction path comprising a PMOS 410 and an NMOS 412, in series with an Enable NMOS 414 sets a voltage level on a node 415 (designated V2) according to V1, Nbias and the characteristics of transistors 410, 412 and 414.
A second conduction path comprises a PMOS 420, an NMOS 422 in series with an Enable NMOS 424, where the inputs of transistors 420, 422 are connected to the output V1 of the first conduction path. In an embodiment, PMOS 420 and PMOS 410 have identical layouts, and, consequently, closely-matched threshold voltages, to compensate for any process/temperature variation.
Resistors 404 and 406 are selected so that at DC conditions, V1 is higher than Vldo and, hence, V2 is close to Vldo level and far from the tripoint voltage; thus, the voltage at a node 426 will be low. For fast response to Vcc spikes, Spike-Detection circuit 400 further comprises a capacitor 416 which provides a capacitive coupling between Vcc and node V2. A negative transition on Vcc will set V2 low and, hence, node 426 high. A Latch 428 will then turn high, and a Boost-Enable signal will increase the bias current of main detector 204 (
In embodiments, V1 is tuned to be higher than Vldo, and V2 approximately equals V1−Vtp. V1 keeps V2 (≈V1-VTP) slightly below Vldo to keep node 426 low, and to still be able to “fall” below threshold during glitch; V2 is not well below Vldo, so as to avoid false alarms.
Note that V1 is related to the VCC nominal level; if an attacker sets Vcc=2.8 prior to applying a glitch (to lower the depth of the glitch, hoping to avoid detection), V1 steady state level is lower and hence V2 is lower, in match with the depth of the glitch; from 2.8v the attacker needs an approximately −400 mv glitch to reach 2.4v; as V2 is lower and closer to the threshold of PMOS 420, the −400 mv glitch is readily detected.
If the attacker used a high VCC attack, (e.g., 3.6v), V1 and V2 are higher (V2 may be slightly higher than Vldo and remote from PMOS 420 threshold; however, the required glitch to reach 2.4v is now −1.2V, which, again, can be readily detected.
The fact that V2 and the detection threshold (PMOS 420) levels, are both Vtp dependent, keeps the spike-detector aligned in all Process/Voltage/Temperature (PVT) variations.
A circuit according to the configuration illustrated in
A waveform 510 illustrates Isink—the current sink from node 314 (
A waveform 512 illustrates the attack-detect indication output of A-DET 300. As can be seen, the delay from a glitch on the Vcc to the attack detection indication is a mere 3.0 ns, although the main detector is, when there are no spikes, below 20 μA. For comparison, a graph 513 illustrates the attack detection response when the spike detector is not activated (e.g., in an embodiment comprising a main detector only)—note that the detection is much slower (approximately 11 nS) than in the case where the spike detector is activated.
As shown in a waveform 606, in response to the Vcc spikes, V2 node 415 (
The configurations of Attack-Detection (A-DET) 300, including glitch detection circuit 400, main detection circuit 304 BGREF-LDO regulator 301, and flowchart 200, as shown in
Although the embodiments described herein mainly address detection of supply-voltage side-channel attack, the methods and systems described herein can also be used in other applications, such as in supply noise monitoring for Design for testability (DFT) purposes, and in systems that monitor power supply behavior.
It will thus be appreciated that the embodiments described above are cited by way of example, and that the present invention is not limited to what has been particularly shown and described hereinabove. Rather, the scope of the present invention includes both combinations and sub-combinations of the various features described hereinabove, as well as variations and modifications thereof which would occur to persons skilled in the art upon reading the foregoing description and which are not disclosed in the prior art. Documents incorporated by reference in the present patent application are to be considered an integral part of the application except that to the extent any terms are defined in these incorporated documents in a manner that conflicts with the definitions made explicitly or implicitly in the present specification, only the definitions in the present specification should be considered.