Jayasinghe 2014
Jayasinghe 2014
Darshana Jayasinghe∗ , Roshan Ragel† , Jude Angelo Ambrose∗ , Aleksandar Ignjatovic∗ and Sri Parameswaran∗
∗ Schoolof Computer Science and Engineering
University of New South Wales, Australia
Email: {darshanaj, ajangelo, ignjat, sridevan}@cse.unsw.edu.au
† Department of Computer Engineering
University of Peradeniya, Sri Lanka Email: [email protected]
Abstract—Advanced Encryption Standard (AES) is arguably Power analysis based side channel attacks (referred to as
the most popular symmetric block cipher algorithm. The com- power analysis from this point onwards) are shown to be
monly used mode of operation in AES is the Electronic Codebook effective against symmetric block cipher based cryptographic
(ECB) mode. In the past, side channel attacks (including power algorithms by Kocher [26] in 1999. Power analysis attacks
analysis based attacks) have been shown to be effective in breaking exploit the power dissipation measurements of the device to
the secret keys used with AES, while AES is operating in the
ECB mode. AES defines a number of advanced modes (namely
deduce the secret key. Many variants of power analysis attacks
Cipher Block Chaining - CBC, Cipher Feedback - CFB, Output can be found in the literature, such as: Simple Power Analysis
Feedback - OFB, and Counter - CTR) of operations that are built (SPA) [26], Differential Power Analysis (DPA) [26], Correla-
on top of the EBC mode to enhance security via disassociating tion Power Analysis (CPA) [12], Mutual Information Analysis
the encryption function from the plaintext or the secret key used. (MIA) [18] and Leakage Power Analysis (LPA) [6]. Power
In this paper, we investigate the vulnerabilities against power traces of a single cryptographic execution are analyzed in SPA.
analysis based side channel attacks of all such modes of operations, DPA uses means of averages to match the power consumption
implemented on hardware circuits for low power and high speed of the device with the hypothetical power model. Shannon
embedded systems. Through such an investigation, we show that entropy is used in MIA to exploit the data dependent operations
AES is vulnerable in all modes of operations against Correlation in cryptographic algorithms [18]. In LPA, the leakage power
Power Analysis (CPA) attack, one of the strongest power analysis
based side channel attacks. We also quantify the level of difficulty
of the device is exploited to deduce the secret key. CPA is
in breaking AES in different modes by calculating the number widely accepted as one of the most powerful amongst the above
of power traces needed to arrive at the complete secret key. We attacks [12].
conclude that the Counter mode of operation provides a balance CPA exploits the property of differing power dissipation
in between area and power while maintaining adequate resistance for different state transitions in CMOS in order to attack
for power analysis attacks than when used with other modes of the secret keys in AES [28]. In CPA, the power dissipation
operations. We show that the previous recommendations for the during the execution of a cryptographic program is correlated
rate of change in the keys and vectors is grossly inadequate, and against a mathematical power model, which is formulated by
suggest that it must be changed at least every 210 encryptions in the adversary. Such a formulation either starts with the plaintext
CBC mode and 212 encryptions in CFB, OFB and CTR modes in
order to resist power analysis attacks.
and goes through the first round of AES counting the bit flips
or starts with the ciphertext and goes through the last round.
In the first and the last rounds, it is possible to perform such
I. I NTRODUCTION a formulation by guessing one byte (8-bits and therefore 256
Cryptography is the art of transforming confidential infor- possibilities) of the secret key at a time and therefore making
mation into information which is incoherent to a third party. a power analysis attack feasible. AES, when operating in ECB
The confidential information is encrypted before transmis- mode (from this point onwards referred to as AES-ECB), has
sion and decrypted upon receipt using secret keys. Advanced been extensively investigated against CPA [39], [40]. However,
Encryption Standard (AES) [3] is one of the most popular such investigation is rarely performed for advanced modes of
symmetric encryption algorithms, standardized under FIPS192. AES.
AES is utilized for secure transactions in many embedded Advanced Modes of AES:
systems such as smart cards in transport [41], credit cards [7], Advanced modes of AES, such as CBC, CFB, OFB and
TV cards [13], [43] and USB mass storage controllers [5] CTR [15], are proposed to decorrelate the relationship of either
to secure the data in flash memory. Intel Core i3, i5 and i7 the plaintext or the secret key to the actual computation. Such
processors contain a separate instruction set to perform AES modes typically use an AES hardware circuitry, which is then
encryptions [4]. Such a significant increase in the usage of designed and configured based on the mode of operation.
secure applications with AES has attracted various successful Related Work:
attacks in recent years. Obtaining the secret key will allow an Power analysis attacks have been researched extensively in
adversary to impersonate the original owner of the device or the past both in microprocessor based software implementations
even clone a new device. Side channel attacks (power [26], and in custom logic (or circuit) based hardware implementa-
timing [34], electromagnetic emissions [37]), code injection tions of AES-ECB. Power analysis attacks are demonstrated
attacks [17] and physical attacks [10] have been successfully for the initial round or for the final round of AES-ECB,
used in extracting the secret keys of embedded systems. where the hypothetical power dissipation formulation can skip
Power Analysis based Side Channel Attacks on AES: MixColumn operation and make use of either the plaintext or
174
Din Kin
128 CPA Ciphertext
Plaintext
Krg
Pearson Hypothetical
2:1 Correlation Power
32
Coefficient Consumption
Power Measurements (Hamming
Drg Weight)
SubByte
+ Correlation
Rot Coefficients
SubByte
Inv Roundkey
ShiftRows Final Generation
Secret Key
RCon Roundkey
175
using the power consumption model given by Equation 3. The IV. P OWER A NALYSIS ON A DVANCED AES M ODES
correlation coefficients for each guessed key byte is plotted In this section, we investigate power analysis on the ad-
against the number of plaintexts used to calculate the correla- vanced AES modes: CBC, CFB, OFB and CTR. In ECB mode,
tion coefficients. the one we investigated in the previous section, each block
As shown in Figure 4, AES-ECB is vulnerable against the of data (128 bits chunk) is encrypted independently, which
last round attack. As depicted, all the key bytes are visible even results in identical ciphertexts for identical plaintexts. No error
with around 2000 plaintexts. The x-axis of Figure 4 indicates propagation happens in the system since each plaintext is en-
the number of plaintexts (in 500 units), where the y-axis denotes crypted independently. Therefore, ECB is considered insecure
the correlation coefficient. We guess one key byte at a time for encrypting long messages. In the advanced modes, such
(K0, K1, ..., K15), resulting in 16 independent correlation correlations are disassociated using a number of means which
coefficient graphs from correlation power analysis. Each line we discuss here. Figure 5 shows how an image (Figure 5(a))
in a correlation coefficient graph is a key guess and the black that is encrypted in ECB mode can still leak information
bold line is the correct key guess. As could be seen from the (Figure 5(b)), while the advanced modes do not reveal such
figure, most of the key bytes are visible very early except for information directly (see Figure 5(c)).
key byte K8, which starts to appear only around the 2000th
sample.
K0 K1 K2 K3
176
1 2 n-1 n In Cipher Feedback (CFB) mode, successive outputs will be
used as the inputs for the encryption algorithm (see Figure 8).
IV The input vector (IV) is encrypted first. Once the output is
generated, a bitwise XOR operation is performed on the input
K 1 K 2 K n-1 K n plaintext and the output from the previous encryption. This
output will be used as the input to the next iteration. Encryption
Fig. 6. CBC Mode of Operation
in CFB mode is formulated in Equation 7.
I1 = IV
Ij = Cj−1 f or j ≥ 2
that the attacker has to calculate in the hypothetical power (7)
Oj = CIPHj (Ij , K)
consumption. Therefore, to perform CPA attacks on CBC mode
of operation, Equation 3 can be used to model the hypothetical Cj = Oj ⊕ P j
power consumption. An attacker can perform a last round attack In CFB mode, the attacker needs to know both the plaintext
with a known ciphertext on any block to break the secret key. and the ciphertext to perform the CPA attack on the last round
However, to break the IV, the plaintext of the first block need of any block. Therefore, a ciphertext only attack cannot be
to be known, requiring a chosen plaintext attack to break both performed on the CFB mode and the need for a chosen plaintext
the secret key and the IV. attack arises. In the CFB mode, an XOR operation is performed
on the output of the encryption with the input plaintext after
K0 K1 K2 K3
99.99% confidence).
0.1 0.1 0.1 0.1
TABLE II. N UMBER OF T RACES N EEDED TO B REAK AES-CBC 0 0 0 0
20 40 20 40 20 40 20 40
Key Byte K0 K1 K2 K3 K4 K5 K6 K7 No. of Plaintexts / 500 No. of Plaintexts / 500 No. of Plaintexts / 500 No. of Plaintexts / 500
n
763 658 719 673 1142 761 956 559
Fig. 9. CPA on AES-CFB Mode
Key Byte K8 K9
K10 K11 K12 K13 K14 K15
n Figure 9 shows the correlation coefficients obtained for CFB
1234 828 872 645 468 679 795 1795
mode. The number of traces needed to break each byte of AES-
CFB is calculated (using Equation 4) and presented in Table III.
B. Cipher Feedback (CFB) The maximum number of traces needed is for key byte K14
and in experiments, AES-CFB can be broken with 24365 traces
1 2 n-1 n
(with 99.99% confidence)
C. Output Feedback (OFB)
IV
OFB mode of operation can be considered as a form of
K 1 K 2 K n-1 K ONE-TIME-PAD encryption [11]. As shown in Figure 10, the
n
initialization vector (IV) is encrypted with the secret key to
Fig. 8. CFB Mode of Operation produce the output. The output is directly passed as the input
for the next block. The ciphertext for each block is generated by
177
TABLE III. N UMBER OF T RACES N EEDED TO B REAK AES-CFB
Figure 11 shows the correlation coefficients obtained for
Key Byte K0 K1 K2 K3 K4 K5 K6 K7 OFB encryptions from the correlation power analysis. The
n
958 1231 13705 734 2554 2289 1783 4978
number of traces needed to break each byte in AES-OFB mode
K8 K9
is calculated and presented in Table IV (using Equation 4). The
Key Byte
K10 K11 K12 K13 K14 K15 maximum number of traces needed is for key byte K14 and
n
18315 2143 1758 1961 3007 2185 24365 7804 that is 5812 traces. Therefore AES-OFB can be broken with
5812 traces.
IV TABLE IV. N UMBER OF T RACES N EEDED TO B REAK AES-OFB
Key Byte K0 K1 K2 K3 K4 K5 K6 K7
O1
K K K K n
1239 1572 5472 810 1270 1203 1378 5204
Key Byte K8 K9
2 n-1 n K10 K11 K12 K13 K14 K15
n
1813 1738 2250 1730 2955 1775 5812 2246
1 2 n-1 n
178
K0 K1 K2 K3 power traces and can be attacked with known ciphertext. The
numbers we see for the CBC mode is not very much different
0.1 0.1 0.1 0.1 from the ECB mode. This can be attributed to the fact that
0 0 0 0 the circuit in both the ECB and the CBC modes for the last
10 20 30 10 20 30 10 20 30 10 20 30
K4 K5 K6 K7 round (the round targeted in our attack) are identical (the XOR
Correlation Coefficient
179
for power analysis attacks than the other modes of operations. [22] B. Jungk, M. Stottinger, J. Gampe, S. Reith, and S. Huss. Side-
We propose that a secret key must be changed at least for channel resistant aes architecture utilizing randomized composite field
every 210 encryptions in CBC mode and 212 encryptions in representations. In ICFPT 2012, pages 125–128, 2012.
CFB, OFB and CTR modes in order to resist power analysis [23] T. Katashita, A. Satoh, K. Kikuchi, H. Nakagawa, and M. Aoyagi.
Evaluation of dpa characteristics of sasebo for board level simulations.
attacks. In COSADE 2010, pages 36–39, 2010.
[24] Y. Kim, T. Sugawara, and N. Homma. Biasing power traces to improve
R EFERENCES correlation in power analysis attacks. COSADE, 2010.
[1] Block cipher mode of operation. http://en.wikipedia.org/wiki/Block [25] P. Kocher, J. Jaffe, B. Jun, and P. Rohatgi. Introduction to differential
cipher mode of operation. power analysis. In Journal of Cryptographic Engineering, volume 1,
[2] Crypto dual + fips 140-2 - premium aes 256 bit security: Specification. pages 5–27. Springer-Verlag, 2011.
http://www.integralmemory.com/sites/default/files/products/specifcations [26] P. C. Kocher, J. Jaffe, and B. Jun. Differential power analysis. In
/Integral Encrypted USB Spec Sheet Crypto Dual%2B 140-2.pdf. Proceedings of the 19th Annual International Cryptology Conference on
[3] Federal Information Processing Standards Publication 197 announcing Advances in Cryptology, CRYPTO ’99, pages 388–397, London, UK,
the advanced encryption standard (aes). UK, 1999. Springer-Verlag.
[27] S. Mangard. A simple power-analysis (spa) attack on implementations
[4] Intel data protection technology with aes-ni and secure key.
of the aes key expansion. In ICISC 2002, LNCS 2587, pages 343–358.
[5] USB flash drive - wikipedia, the free encyclopedia. Springer-Verlag, 2002.
[6] M. Alioto, L. Giancane, G. Scotti, and A. Trifiletti. Leakage power [28] S. Mangard, E. Oswald, and T. Popp. Power Analysis Attacks: Revealing
analysis attacks: A novel class of attacks to nanometer cryptographic the Secrets of Smart Cards (Advances in Information Security). Springer-
circuits. Circuits and Systems I: Regular Papers, IEEE Transactions on, Verlag New York, Inc., Secaucus, NJ, USA, 2007.
57(2):355–367, Feb 2010. [29] S. Mangard, E. Oswald, and T. Popp. Power Analysis Attacks: Revealing
[7] S. C. Alliance. Smart card alliance financial resources, August the Secrets of Smart Cards (Advances in Information Security). Springer-
2013. http://www.smartcardalliance.org/pages/smart-cards-applications- Verlag New York, Inc., Secaucus, NJ, USA, 2007.
financial#smart-card-alliance-financial-resources. [30] S. Mangard, N. Pramstaller, and E. Oswald. Successfully attacking
[8] A. Ambrose, R. Ragel, S. Parameswaran, and A. Ignjatovic. Multipro- masked aes hardware implementations. In CHES 2005, volume 3659,
cessor information concealment architecture to prevent power analysis- pages 157–171, 2005.
based side channel attacks. Computers Digital Techniques, IET, 5(1):1 [31] B. Mazumdar, D. Mukhopadhyay, and I. Sengupta. Design and imple-
–15, january 2011. mentation of rotation symmetric s-boxes with high nonlinearity and high
[9] A. Biryukov. The design of a stream cipher lex. In Selected Areas dpa resilience. In HOST 2013, pages 87–92, 2013.
in Cryptography, volume 4356 of Lecture Notes in Computer Science, [32] H. Mestiri, N. Benhadjyoussef, M. Machhout, and R. Tourki. A compar-
pages 67–75. Springer Berlin Heidelberg, 2007. ative study of power consumption models for cpa attack. International
[10] J. Blmer and J.-P. Seifert. Fault based cryptanalysis of the advanced Journal of Computer Network & Information Security, 5(3), 2013.
encryption standard (aes). In R. Wright, editor, Financial Cryptography, [33] A. Moradi. Side-channel leakage through static power - should we care
volume 2742 of Lecture Notes in Computer Science, pages 162–181. about in practice? IACR Cryptology ePrint Archive, 2014:25, 2014.
Springer Berlin Heidelberg, 2003.
[34] A. Moradi, O. Mischke, and C. Paar. One attack to rule them all:
[11] M. Borowski and M. Lesniewicz. Modern usage of ”old” one-time pad. Collision timing attack versus 42 aes asic cores. Computers, IEEE
In MCC 2012, Military, pages 1–5, 2012. Transactions on, 62(9):1786–1798, 2013.
[12] E. Brier, C. Clavier, and F. Olivier. Correlation power analysis with a [35] S. Morioka and A. Satoh. An optimized s-box circuit architecture for
leakage model. In Cryptographic Hardware and Embedded Systems - low power aes design. In B. Kaliski, e. Ko, and C. Paar, editors,
CHES 2004, volume 3156 of Lecture Notes in Computer Science, pages Cryptographic Hardware and Embedded Systems - CHES 2002, volume
16–29. Springer Berlin Heidelberg, 2004. 2523 of Lecture Notes in Computer Science, pages 172–186. Springer
[13] M. Carr. Smart card technology with case studies. In Security Tech- Berlin Heidelberg, 2003.
nology, 2002. Proceedings. 36th Annual 2002 International Carnahan [36] S. Ors, F. Gurkaynak, E. Oswald, and B. Preneel. Power-analysis attack
Conference on, pages 158–159, 2002. on an asic aes implementation. In ITCC 2004, pages 546–552 Vol.2,
[14] F. cois Xavier Standaert, S. B. Örs, and B. Preneel. Power analysis of an 2004.
fpga: Implementation of rijndael: Is pipelining a dpa countermeasure? [37] Z. Peng, D. Gaoming, Z. Qiang, and C. Kaiyan. Em frequency domain
In CHES 2004, volume 3156, pages 30–44, 2004. correlation analysis on cipher chips. In ICISE 09, pages 1729–1732,
[15] C. S. Division. Recommendation for block cipher modes of operation. 2009.
http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf. [38] M. Petrvalsky, M. Drutarovsky, and M. Varchola. Differential power
[16] O. Dunkelman and N. Keller. The effects of the omission of last round’s analysis of advanced encryption standard on accelerated 8051 processor.
mixcolumns on aes. Inf. Process. Lett., 110:304–308, 2010. In Radioelektronika (RADIOELEKTRONIKA), 2013 23rd International
Conference, pages 334–339, April 2013.
[17] A. Francillon and C. Castelluccia. Code injection attacks on harvard-
architecture devices. CCS ’08, pages 15–26. ACM, 2008. [39] K. Tiri, D. Hwang, A. Hodjat, B. Lai, S. Yang, P. Schaumont, and
I. Verbauwhede. A side-channel leakage free coprocessor ic in 0.18um
[18] B. Gierlichs, L. Batina, P. Tuyls, and B. Preneel. Mutual information cmos for embedded aes-based cryptographic and biometric processing.
analysis. In E. Oswald and P. Rohatgi, editors, Cryptographic Hardware In In DAC’05, pages 222–227. ACM Press, 2005.
and Embedded Systems CHES 2008, volume 5154 of Lecture Notes in
Computer Science, pages 426–442. Springer Berlin Heidelberg, 2008. [40] K. Tiri, D. Hwang, A. Hodjat, B.-C. Lai, S. Yang, P. Schaumont, and
I. Verbauwhede. Prototype ic with wddl and differential routing –
[19] Y. HAN, X. cheng ZOU, Z. lin LIU, and Y. cheng CHEN. The research dpa resistance assessment. In Proceedings of the 7th International Con-
of dpa attacks against aes implementations. The Journal of China ference on Cryptographic Hardware and Embedded Systems, CHES’05,
Universities of Posts and Telecommunications, pages 101 – 106, 2008. pages 354–365, Berlin, Heidelberg, 2005. Springer-Verlag.
[20] A. Hodjat, D. D. Hwang, B. Lai, K. Tiri, and I. Verbauwhede. A [41] A. Transport services, New South Wales. The opal card:
3.84 gbits/s aes crypto coprocessor with modes of operation in a 0.18- Transforming the way we move around, August 2013.
um cmos technology. In Proceedings of the 15th ACM Great Lakes http://www.transport.nsw.gov.au/opal.
Symposium on VLSI, GLSVLSI ’05, pages 60–63, New York, NY, USA,
2005. ACM. [42] J. Wu, Y. Shi, and M. Choi. Measurement and evaluation of power anal-
ysis attacks on asynchronous s-box. Instrumentation and Measurement,
[21] J. Jaffe. A first-order dpa attack against aes in counter mode with IEEE Transactions on, 61(10):2765–2775, 2012.
unknown initial counter. In P. Paillier and I. Verbauwhede, editors,
Cryptographic Hardware and Embedded Systems - CHES 2007, volume [43] Q. Xie, S. Zeng, and X. Yu. A smart-card-based conditional access
4727 of Lecture Notes in Computer Science, pages 1–13. Springer Berlin subsystem separation scheme for digital tv broadcasting. Consumer
Heidelberg, 2007. Electronics, IEEE Transactions on, 51(3):925–932, 2005.
180