Communications in Cryptology IACR CiC

Efficiently Detecting Masking Flaws in Software Implementations

Authors

Nima Mahdion, Elisabeth Oswald
Nima Mahdion
University of Klagenfurt, Klagenfurt, Austria
Elisabeth Oswald ORCID
University of Klagenfurt, Klagenfurt, Austria
University of Birmingham, Birmingham, United Kingdom
m dot e dot oswald at bham dot ac dot uk

Abstract

Software implementations of cryptographic algorithms often use masking schemes as a countermeasure against side channel attacks. A number of recent results show clearly the challenge of implementing masking schemes in such a way, that (unforeseen) micro-architectural effects do not cause masking flaws that undermine the intended security goal of an implementation. So far, utilising a higher-order version of the non-specific (fixed-vs-random) input test of the Test Vector Leakage Assessment (TVLA) framework has been the best option to identify such flaws. The drawbacks of this method are both its significant computation cost, as well as its inability to pinpoint which interaction of masking shares leads to the flaw. In this paper we propose a novel version, the fixed-vs-random shares test, to tackle both drawbacks. We explain our method and show its application to three case studies, where each time it outperforms its conventional TVLA counterpart. The drawback of our method is that it requires control over the shares, which, we argue, is practically feasible in the context of in-house evaluation and testing for software implementations.

References

[ARMb]
ARM. Thumb-16-bit instruction set quick reference card. https://developer.arm.com/documentation/qrc0006/e.
[BCO04]
Eric Brier, Christophe Clavier, and Francis Olivier. Correlation Power Analysis with a Leakage Model. In Marc Joye and Jean-Jacques Quisquater, editors, Cryptographic Hardware and Embedded Systems - CHES 2004: 6th International Workshop Cambridge, MA, USA, August 11-13, 2004. Proceedings, volume 3156 of Lecture Notes in Computer Science, pages 16–29. 2004. Springer. DOI: 10.1007/978-3-540-28632-5_2
[BGG+14]
Josep Balasch, Benedikt Gierlichs, Vincent Grosso, Oscar Reparaz, and François-Xavier Standaert. On the Cost of Lazy Engineering for Masked Software Implementations. In Marc Joye and Amir Moradi, editors, Smart Card Research and Advanced Applications - 13th International Conference, CARDIS 2014, Paris, France, November 5-7, 2014. Revised Selected Papers, volume 8968 of Lecture Notes in Computer Science, pages 64–81. 2014. Springer. DOI: 10.1007/978-3-319-16763-3_5
[BSS19]
Olivier Bronchain, Tobias Schneider, and François-Xavier Standaert. Multi-Tuple Leakage Detection and the Dependent Signal Issue. IACR TCHES, 2019(2):318–345, 2019. DOI: 10.13154/tches.v2019.i2.318-345
[CGLS21]
Gaëtan Cassiers, Benjamin Grégoire, Itamar Levi, and François-Xavier Standaert. Hardware Private Circuits: From Trivial Composition to Full Verification. IEEE Trans. Computers, 70(10):1677–1690, 2021. DOI: 10.1109/TC.2020.3022979
[{Com}17]
Common Criteria. The Common Criteria for Information Technology Security Evaluation. https://www.commoncriteriaportal.org/cc/. 2017.
[CRR02]
Suresh Chari, Josyula R. Rao, and Pankaj Rohatgi. Template Attacks. In Burton S. Kaliski Jr., Çetin Kaya Koç, and Christof Paar, editors, Cryptographic Hardware and Embedded Systems - CHES 2002, 4th International Workshop, Redwood Shores, CA, USA, August 13-15, 2002, Revised Papers, volume 2523 of Lecture Notes in Computer Science, pages 13–28. 2002. Springer. DOI: 10.1007/3-540-36400-5_3
[DCE16]
A. Adam Ding, Cong Chen, and Thomas Eisenbarth. Simpler, Faster, and More Robust T-Test Based Leakage Detection. In François-Xavier Standaert and Elisabeth Oswald, editors, Constructive Side-Channel Analysis and Secure Design - 7th International Workshop, COSADE 2016, Graz, Austria, April 14-15, 2016, Revised Selected Papers, volume 9689 of Lecture Notes in Computer Science, pages 163–183. 2016. Springer. DOI: 10.1007/978-3-319-43283-0_10
[DS16a]
François Durvaux and François-Xavier Standaert. From Improved Leakage Detection to the Detection of Points of Interests in Leakage Traces. In Marc Fischlin and Jean-Sébastien Coron, editors, Advances in Cryptology - EUROCRYPT 2016 - 35th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Vienna, Austria, May 8-12, 2016, Proceedings, Part I, volume 9665 of Lecture Notes in Computer Science, pages 240–262. 2016. Springer. DOI: 10.1007/978-3-662-49890-3_10
[DS16b]
François Durvaux and François-Xavier Standaert. From Improved Leakage Detection to the Detection of Points of Interests in Leakage Traces. In Marc Fischlin and Jean-Sébastien Coron, editors, EUROCRYPT 2016, Part I, volume 9665 of LNCS, pages 240–262. May 2016. DOI: 10.1007/978-3-662-49890-3_10
[DZD+17]
A. Adam Ding, Liwei Zhang, François Durvaux, François-Xavier Standaert, and Yunsi Fei. Towards Sound and Optimal Leakage Detection Procedure. In Thomas Eisenbarth and Yannick Teglia, editors, Smart Card Research and Advanced Applications - 16th International Conference, CARDIS 2017, Lugano, Switzerland, November 13-15, 2017, Revised Selected Papers, volume 10728 of Lecture Notes in Computer Science, pages 105–122. 2017. Springer. DOI: 10.1007/978-3-319-75208-2_7
[FGM+23]
Jakob Feldtkeller, Tim Güneysu, Thorben Moos, Jan Richter-Brockmann, Sayandeep Saha, Pascal Sasdrich, and François-Xavier Standaert. Combined Private Circuits - Combined Security Refurbished. In Weizhi Meng, Christian Damsgaard Jensen, Cas Cremers, and Engin Kirda, editors, ACM CCS 2023, pages 990–1004. November 2023. ACM Press. DOI: 10.1145/3576915.3623129
[FIP19]
Security Requirements for Cryptographic Modules (FIPS PUB 140-3). https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.140-3.pdf. 2019.
[GGJR+11]
Benjamin Jun Gilbert Goodwill, Josh Jaffe, Pankaj Rohatgi, and others. A testing methodology for side-channel resistance validation. In NIST non-invasive attack testing workshop, volume 7, pages 115–136. 2011.
[GMK16]
Hannes Groß, Stefan Mangard, and Thomas Korak. Domain-Oriented Masking: Compact Masked Hardware Implementations with Arbitrary Protection Order. In Begül Bilgin, Svetla Nikova, and Vincent Rijmen, editors, Proceedings of the ACM Workshop on Theory of Implementation Security, TIS@CCS 2016 Vienna, Austria, October, 2016, pages 3. 2016. ACM. DOI: 10.1145/2996366.2996426
[GMK17]
Hannes Groß, Stefan Mangard, and Thomas Korak. An Efficient Side-Channel Protected AES Implementation with Arbitrary Protection Order. In Helena Handschuh, editor, CT-RSA 2017, volume 10159 of LNCS, pages 95–112. February 2017. DOI: 10.1007/978-3-319-52153-4_6
[GOP22]
Si Gao, Elisabeth Oswald, and Dan Page. Towards Micro-architectural Leakage Simulators: Reverse Engineering Micro-architectural Leakage Features Is Practical. In Orr Dunkelman and Stefan Dziembowski, editors, Advances in Cryptology - EUROCRYPT 2022 - 41st Annual International Conference on the Theory and Applications of Cryptographic Techniques, Trondheim, Norway, May 30 - June 3, 2022, Proceedings, Part III, volume 13277 of Lecture Notes in Computer Science, pages 284–311. 2022. Springer. DOI: 10.1007/978-3-031-07082-2_11
[GR17]
Dahmun Goudarzi and Matthieu Rivain. How Fast Can Higher-Order Masking Be in Software?. In Jean-Sébastien Coron and Jesper Buus Nielsen, editors, EUROCRYPT 2017, Part I, volume 10210 of LNCS, pages 567–597. 2017. DOI: 10.1007/978-3-319-56620-7_20
[ISW03]
Yuval Ishai, Amit Sahai, and David Wagner. Private Circuits: Securing Hardware against Probing Attacks. In Dan Boneh, editor, CRYPTO 2003, volume 2729 of LNCS, pages 463–481. August 2003. DOI: 10.1007/978-3-540-45146-4_27
[JS11]
Show-Li Jan and Gwowen Shieh. Optimal sample sizes for Welch’s test under various allocation and cost considerations. Behavior research methods, 43:1014–1022, 2011. DOI: 10.3758/s13428-011-0095-7
[KM22]
David Knichel and Amir Moradi. Low-Latency Hardware Private Circuits. In Heng Yin, Angelos Stavrou, Cas Cremers, and Elaine Shi, editors, ACM CCS 2022, pages 1799–1812. November 2022. ACM Press. DOI: 10.1145/3548606.3559362
[Koc96]
Paul C. Kocher. Timing Attacks on Implementations of Diffie-Hellman, RSA, DSS, and Other Systems. In Neal Koblitz, editor, Advances in Cryptology - CRYPTO '96, 16th Annual International Cryptology Conference, Santa Barbara, California, USA, August 18-22, 1996, Proceedings, volume 1109 of Lecture Notes in Computer Science, pages 104–113. 1996. Springer. DOI: 10.1007/3-540-68697-5_9
[MOBW13]
Luke Mather, Elisabeth Oswald, Joe Bandenburg, and Marcin Wójcik. Does My Device Leak Information? An a priori Statistical Power Analysis of Leakage Detection Tests. In Kazue Sako and Palash Sarkar, editors, ASIACRYPT 2013, Part I, volume 8269 of LNCS, pages 486–505. December 2013. DOI: 10.1007/978-3-642-42033-7_25
[MPW22]
Ben Marshall, Dan Page, and James Webb. MIRACLE: MIcRo-ArChitectural Leakage Evaluation A study of micro-architectural power leakage across many devices. IACR TCHES, 2022(1):175–220, 2022. DOI: 10.46586/tches.v2022.i1.175-220
[MRSS18]
Amir Moradi, Bastian Richter, Tobias Schneider, and François-Xavier Standaert. Leakage Detection with the $\chi^2$-Test. IACR TCHES, 2018(1):209–237, 2018. DOI: 10.13154/tches.v2018.i1.209-237
[MWM21]
Thorben Moos, Felix Wegener, and Amir Moradi. DL-LA: Deep Learning Leakage Assessment. IACR TCHES, 2021(3):552–598, 2021. DOI: 10.46586/tches.v2021.i3.552-598
[NIS01]
Advanced Encryption Standard (AES). Federal Information Processing Standards Publication 197, http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf. 2001.
[NRR06]
Svetla Nikova, Christian Rechberger, and Vincent Rijmen. Threshold Implementations Against Side-Channel Attacks and Glitches. In Peng Ning, Sihan Qing, and Ninghui Li, editors, ICICS 06, volume 4307 of LNCS, pages 529–545. December 2006. DOI: 10.1007/11935308_38
[Pag]
Dan Page. SCALE: Side-Channel Attack Lab. Exercises. https://github.com/danpage/scale.
[PRB09]
Emmanuel Prouff, Matthieu Rivain, and Régis Bevan. Statistical Analysis of Second Order Differential Power Analysis. IEEE Trans. Computers, 58(6):799–811, 2009. DOI: 10.1109/TC.2009.15
[RBN+15]
Oscar Reparaz, Begül Bilgin, Svetla Nikova, Benedikt Gierlichs, and Ingrid Verbauwhede. Consolidating Masking Schemes. In Rosario Gennaro and Matthew J. B. Robshaw, editors, CRYPTO 2015, Part I, volume 9215 of LNCS, pages 764–783. August 2015. DOI: 10.1007/978-3-662-47989-6_37
[Rep16]
Oscar Reparaz. Detecting Flawed Masking Schemes with Leakage Detection Tests. In Thomas Peyrin, editor, FSE 2016, volume 9783 of LNCS, pages 204–222. March 2016. Springer, Heidelberg. DOI: 10.1007/978-3-662-52993-5_11
[RP10]
Matthieu Rivain and Emmanuel Prouff. Provably Secure Higher-Order Masking of AES. In Stefan Mangard and François-Xavier Standaert, editors, CHES 2010, volume 6225 of LNCS, pages 413–427. August 2010. DOI: 10.1007/978-3-642-15031-9_28
[SM15]
Tobias Schneider and Amir Moradi. Leakage Assessment Methodology - A Clear Roadmap for Side-Channel Evaluations. In Tim Güneysu and Helena Handschuh, editors, Cryptographic Hardware and Embedded Systems - CHES 2015 - 17th International Workshop, Saint-Malo, France, September 13-16, 2015, Proceedings, volume 9293 of Lecture Notes in Computer Science, pages 495–513. 2015. Springer. DOI: 10.1007/978-3-662-48324-4_25
[Sta18]
François-Xavier Standaert. How (Not) to Use Welch's T-Test in Side-Channel Security Evaluations. In Begül Bilgin and Jean-Bernard Fischer, editors, Smart Card Research and Advanced Applications, 17th International Conference, CARDIS 2018, Montpellier, France, November 12-14, 2018, Revised Selected Papers, volume 11389 of Lecture Notes in Computer Science, pages 65–79. 2018. Springer. DOI: 10.1007/978-3-030-15462-2_5
[Stu08]
Student. The probable error of a mean. Biometrika, 1908. DOI: 10.2307/2331554
[Wel47]
B. L. Welch. The generalization of `Student's’ problem when several different population variances are involved. Biometrika, 34(1-2):28-35, January 1947. DOI: 10.1093/biomet/34.1-2.28
[WTW+22]
Yaru Wang, Ming Tang, Pengbo Wang, Botao Liu, and Rui Tian. The Levene test based-leakage assessment. Integr., 87:182–193, 2022. DOI: 10.1016/J.VLSI.2022.06.013
[YJ21]
Wei Yang and Anni Jia. Side-Channel Leakage Detection with One-Way Analysis of Variance. Secur. Commun. Networks, 2021:6614702:1–6614702:13, 2021. DOI: 10.1155/2021/6614702
[ZQO19]
Xinping Zhou, Kexin Qiao, and Changhai Ou. Leakage Detection with Kolmogorov-Smirnov Test. Cryptology ePrint Archive, Report 2019/1478. 2019.

PDFPDF Open access

History
Submitted: 2024-07-08
Accepted: 2024-09-02
Published: 2024-10-07
How to cite

Nima Mahdion and Elisabeth Oswald, Efficiently Detecting Masking Flaws in Software Implementations. IACR Communications in Cryptology, vol. 1, no. 3, Oct 07, 2024, doi: 10.62056/ab89ksdja.

License

Copyright is held by the author(s)

This work is licensed under a Creative Commons Attribution (CC BY) license.