Experiments in Attacking FPGA-based Embedded Systems Using Differential Power Analysis
Experiments in Attacking FPGA-based Embedded Systems Using Differential Power Analysis
Abstract—In the decade since the concept was publicly intro- research into their susceptibility to power analysis attacks.
duced, power analysis attacks on cryptographic systems have be- Indeed, much previous effort has gone into applying DPA
come an increasingly studied topic in the computer security com- attacks on FPGA platforms [4], [5], [6], [7], and on developing
munity. Research into countermeasures for these cryptographic
systems has intensified as well. Experiments have been conducted corresponding anti-attack methods [8], [9], [10], [11], [12].
showing the potential effectiveness of power analysis attacks and Unfortunately, in all of the previous research on this topic,
preventative techniques on both software (e.g. smartcard, DSP) the experimental results and analysis were based on either
and hardware (e.g. ASIC, FPGA) processing elements. One key simulated power consumption models or synthetic hand-made
observation that motivates our work is that the majority of FPGA boards. As a result, little is known as to the practical
the research into power analysis on FPGA-based cryptographic
systems has been a) theoretical in nature, b) evaluated through impact that DPA attacks can have on commercial FPGA
simulation, or c) experimented using custom hardware that does boards. In our opinion this may lead to a disconnect between
not closely mirror real-world systems. In this paper, we look the theory and practice of protecting FPGA-based embedded
to bridge this gap between theory and practice by detailing systems.
our experience in performing a Differential Power Analysis In this paper, we describe an automated data acquisition
(DPA) attack on a commercial FPGA development board. We
present an automated data acquisition and analysis design for an and analysis system for applying a DPA attack on an FPGA
FPGA-based implementation of the Data Encryption Standard executing a cryptographic algorithm. Using this system, we
(DES), and discuss some of the challenges and obstacles that mounted an attack on a Xilinx Virtex-II Pro FPGA running
we encountered when performing the DPA attack on our chosen a Data Encryption Standard (DES) core. Our choice of both
commercial platform. FPGA board and cryptographic algorithm are driven by their
respective popularity; the Virtex-II Pro was the first Xilinx
I. I NTRODUCTION
FPGA that was capable of running hardware/software designs
Power analysis attacks are regarded as a very powerful in an integrated reconfigurable fabric, and can commonly be
approach to cracking cryptographic systems [1]. This class of found in both academic and industrial environments. DES was
attacks make use of the power consumption information from the first standardized cryptographic implementation broken
processing elements built using CMOS circuits. Introduced by the power analysis community, and as such remains a
first by Kocher et al. [2] in 1998, there are two main flavors popular target, even after the introduction of newer, more
of power analysis attack: the Simple Power Analysis (SPA) robust private-key algorithms.
attack and the Differential Power Analysis (DPA) attack. In the Our goal in running these experiments is to provide an in-
SPA attack, by tracing the whole system power consumption depth case study to the security community describing the
information, the adversary can deduce the types of instructions challenges inherent in performing real-world DPA attacks on
running in the processing element, which in a cryptographic FPGA-based systems. One surprising result of our work is
system will often be directly influenced by the choice of that the practical impact of DPA (and other power analysis)
secret key. By comparison, the DPA attack combines this attacks on commercial FPGA boards is severely limited by
power analysis with statistical and error correction techniques, several factors not considered in previous research, and as
leading to a more powerful approach. As will be described in such we strongly suggest that many of the current efforts
Section III, due to the statistical nature of the DPA attack, an into DPA countermeasures may be misguided. At the very
attacker using DPA is not required to know any details of the least our work implies that given the physical access required
internal algorithmic implementation. by the DPA methodology, an attacker’s time would be better
Reconfigurable computing systems, such as those based spent performing other non-invasive techniques. We hope to
on Field Programmable Gate Array (FPGA) technology, are stir debate in the security community on the actual reach and
a very promising platform for designing high-performance importance of DPA attacks on real-world hardware systems.
cryptographic systems, due to their high throughput rates The remainder of this paper is organized as follows. In the
and inherent design flexibility [3]. The growing popularity of following section, we review current efforts in performing and
FPGAs as a cryptographic processing element has necessitated preventing power analysis attacks on FPGA-based embedded
8
&W'>ŽŐŝĐ
yŝůŝŶdžŵďĞĚĚĞĚ W>
ĞǀĞůŽƉŵĞŶƚ<ŝƚ;<Ϳ WŽǁĞƌWϰϬϱ
sŝƌƚĞdžͲ//WƌŽ&W'
Dd>/ŶƐƚƌƵŵĞŶƚ
ŽŶƚƌŽůdŽŽůďŽdž ƉƌŽďĞϭ ƉƌŽďĞϮ
,ŽƐƚtŽƌŬƐƚĂƚŝŽŶ s/^/ŶƚĞƌĨĂĐĞ
KƐĐŝůůŽƐĐŽƉĞ
9
ƵƐDĂƐƚĞƌ WWϰϬϱ ^ŽƌĞ
sƐƐ ƵƐ^ůĂǀĞ KD W> W>
KDh^ W>h^
Leakage current
н
W>ͲKW
ZD/ͬ&
W>
ƌŝĚŐĞ
KD
ͺ ZD KW
10
The clock frequency of the Xilinx board is set at 100 MHz.
The time to run one DES round is 10 nanoseconds. The
sampling rate of the oscilloscope is 2.5G/s. Consequently there
are 25 samples we can get from the oscilloscope for each
round. Even though we only use such a small part of the
sampled power trace data, it is on the order of megabytes of
data for each sampling operation. Transferring MBs of data
through the USB port can take several seconds. To make the
attack less time-consuming, the PPC sends m plaintext values
to the DES module running in the FPGA logic. For example,
if the plaintext value sent by the MATLAB interface is p,
the plaintext values used by DES module in one iteration is
p, p+1, p+2, p+3 for m equal to 2. That is, the MATLAB
instrument control toolbox can obtain 16*4 rounds of power
trace data each iteration. For the large number of plaintext
values required by differential power analysis, this can save
quite a bit of attack time. After collecting all of the power trace Fig. 6. Power traces for four DES iterations in one trigger pulse period
data needed, they are saved by the MATLAB interface as a
single large matrix variable. Each row in this matrix contains
the plaintext and its corresponding power trace data. There are figures for all 64 possible inputs, but still, no right key was
in total N rows and M +1 columns of power trace data. found in any one of them.
For each S-box, there are 64 possible input values. For each After thoroughly checking our code, the focus of our
input value, we divide the power traces data into two groups concern switched to the board-level circuitry. Eventually, we
according to the computed value of the first output bit. If the discovered that one main reason our DPA attack failed was
output bit value is 0, the corresponding power data is put in because there are a group of decoupling capacitors around
group A; otherwise, it is put in group B. Then we calculate the the input of the FPGA internal power supply. Decoupling
average difference value between the two the groups. In theory, capacitors can effectively prevent the internal power supply
as described in Section III, the average power difference graph from bouncing, which turns out to effectively mask the needed
with a spike corresponds to the correct subkey. However, in power leakage information. As a result, the likelihood of
reality the average power difference cannot be absolutely zero successfully mounting DPA attacks on this specific FPGA
because N is not infinite. In practice a larger value of N will board are largely reduced with the capacitors in place. It is
give less error and noise in the output. In our experimental a general rule that the decoupling capacitors are essential in
setup, N is equal to ten thousand and M is equal to 25 for maintaining a stable-working high-performance FPGA circuit
each DES round. Figure 7 shows an average power difference with signal and power integrity. In this way, the decoupling
for the first round of an S-box. capacitor itself can be a very good preventative method against
From this graph, we can see that the average power differ- a DPA attacker who does not want to physically break the
ence is very small and up to the micro-voltage scale. Thus, board.
it is extremely difficult to find a spike in such a graph in Another factor that may affect the final result is the noise
reality. To avoid this problem, we adapted the original method introduced by the functionalities, other than the DES core,
to use the average value of the average difference instead to which are also running on the FPGA. Due to the time
find the spike. The average value of the average difference is complexity of collecting and post-processing the power data,
calculated and recorded with respect to the related plaintext. Xilinx EDK was used to automate these steps. However, the
We call such an average value as the score of the input value. EDK tool itself generates a large number of interface VHDL
We select the input value with the maximum score value as codes which are eventually configured into the FPGA board.
the guessed part of the subkey. That is, the part of the subkey Due to the fact that all of the programs are sharing the same
as the input of an S-box is computed as: internal logic power supply, these logic modules may also
affect the power leakage traces. As a result, these two inherent
M
1 j obstacles prevented us from obtaining satisfactory results.
max (|P̄A − P̄Bj |) (5)
k=1,2,...,64 M
j=1 VI. C ONCLUSION
We have presented a platform to automatically perform
V. R ESULT A NALYSIS DPA on a real-world FPGA board. This platform gives us
Figure 8 shows the score for the 64 input values. From this a systematic view on how to successfully perform the DPA
figure, one can recognize the maximum score. Unfortunately, attack in a practical sense. The efficiency of analysis is critical
however, the extracted key is not correct. In order to enlarge to DPA if the attacker wants to break the FPGA cryptographic
the chance of finding out the right data, we observe the spike system. This requirement comes from two scenarios. Firstly,
11
Voltage x 10
-6
Voltage -6
x 10
7 14
6
12
5
10
8
3
6
2
1 4
0
0 5 10 15 20 25 2
Sample 0 10 20 30 40 50 60 70 6-bit input
point value
Fig. 7. Average power difference for the first round of an S-box Fig. 8. Score for 64 input values of an S-box in DES
most modern cryptographic algorithms are based on the fact [4] Larry T. McDaniel III, “An investigation of differential power analysis
attacks on FPGA-based encryption systems,” Master’s thesis, Virginia
that they can be broken in theory, but not in practice. For Polytechnic Institute and State University, 2003.
example, it will take billions of years to break a 256-bit [5] S. B. Ors, E. Oswald, and B. Preneel, “Power-analysis attacks on an
AES system in a brute-force search. Secondly, the key of FPGA – first experimental results,” in Proceedings of the International
Workshop on Cryptographic Hardware and Embedded Systems (CHES),
cryptosystem like AES or DES is usually changed after a Sep. 2007, pp. 35–50.
variable period of time. The new key is newly negotiated by [6] F.-X. Standaert, S. B. Ors, J.-J. Quisquater, and B. Preneel, “Power anal-
the peers in a security protocol like IPSec. From this point ysis attacks against FPGA implementations of the DES,” in Proceedings
of the International Conference on Field-Programmable Logic and its
of view, DPA must be able to destroy the cryptosystem in a Applications (FPL), Aug. 2004, pp. 84–94.
limited time range. [7] C. Clavier, J.-S. Coron, and N. Dabbous, “Differential power analysis
Most previous work focuses on using a custom FPGA in the presence of hardware countermeasures,” in Proceedings of the
International Workshop on Cryptographic Hardware and Embedded
board as the target of DPA attack. While it is a great jump Systems (CHES), 2000, pp. 252–263.
from theory to practice, commercial secure embedded systems [8] J.-S. Coron, “Resistance against differential power analysis for elliptic
should be the target for all researchers in this area. As the curve cryptosystems,” in Proceedings of the International Workshop on
Cryptographic Hardware and Embedded Systems (CHES), 1999, pp.
analysis demonstrated above, the experimental result shows 292–302.
that the DPA attacks are not as powerful as expected when [9] M.-L. Akkar and C. Giraud, “An implementation of DES and AES se-
facing the commercial FPGA platform due to the decoupling cure against some attacks,” in Proceedings of the International Workshop
on Cryptographic Hardware and Embedded Systems (CHES), 2001, pp.
capacitors. The FPGA board must be physically broken before 309–318.
successfully applying DPA, making it no longer a passive [10] K. Tiri, M. Akmal, and I. Verbauwhede, “A dynamic and differential
attack. The decoupling capacitor is a natural countermeasure. CMOS logic with signal independent power consumption to withstand
differential power analysis on smart cards,” in Proceedings of the
The last obstacle limiting DPA attacks in from practice is European Solid-State Circuits Conference (ESSCIRC), Sep. 2002, pp.
that there is more than one electrical device on an FPGA board. 403–406.
In our example, the on-chip PPC processor also participated [11] K. Tiri and I. Verbauwhede, “Place and route for secure standard cell
design,” in Proceedings of the Smart Card Research and Advanced
in the power consumption. Other on-board components may Application IFIP Conference (CARDIS), 2004, p. 143.
overwhelm the power consumed by the reconfigurable logic. [12] ——, “A digital design flow for secure integrated circuits,” IEEE
It is also likely that there would be more than one module Transactions on Computer-Aided Design of Integrated Circuits and
Systems, vol. 25, no. 7, pp. 1197–1208, Jul. 2006.
concurrently running on the FPGA. All of this leads to a DPA [13] S. B. Ors, F. Gurkaynak, E. Oswald, and B. Preneel1, “Power-analysis
attack being difficult and expensive to perform on this kind of attack on an ASIC AES implementation,” in Proceedings of the Inter-
system. How to solve these challenges in a demonstrable way national Conference on Information Technology (ITCC), 2004.
[14] National Institute of Standards and Technology, “FIPS PUB 46-3, Data
is still a topic which deserves further research. Encryption Standard (DES),” available at http://www.nist.gov, Oct. 1999.
[15] A. Schuster and E. Oswald, “Differential power analysis of an AES
R EFERENCES implementation,” Institute for Applied Information Processing and Com-
munications, Graz University of Technology, Tech. Rep. IAIK-TR
[1] H. Bar-El, “Introduction to side channel attacks,” available at 2004/06/25, Jun. 2004.
http://www.discretix.com, 2007. [16] M. Joye1, P. Paillier, and B. Schoenmakers, “On second-order differ-
[2] P. Kocher, J. Jaffe, and B. Jun, “Differential power analysis,” in ential power analysis,” in Proceedings of the International Workshop
Proceedings of Advances in Cryptology (Crypto), Aug. 1999, pp. 388– on Cryptographic Hardware and Embedded Systems (CHES), 2005, pp.
397. 293–308.
[3] J. Zambreno, D. Nguyen, and A. Choudhary, “Exploring area/delay [17] The MathWorks, “Instrument control toolbox 2.4.2,” available at
tradeoffs in an AES FPGA implementation,” Proceedings of the Inter- http://www.mathworks.com, 2007.
national Conference on Field-Programmable Logic and its Applications [18] Xilinx, “Virtex-II Pro family complete data sheet,” available at
(FPL), pp. 575–585, Aug. 2004. http://www.xilinx.com, 2007.
12