Profiling Attack against RSA Key Generation Based on a Euclidean Algorithm
Abstract
:1. Introduction
2. RSA Key Generation
- Generate two random primes p and q;
- Verify that e is coprime with and ;
- Compute the modulus ;
- Compute ;
- Compute the private key .
2.1. The Binary Extended Euclidean Algorithm
Algorithm 1 Binary Extended Euclidean Algorithm. |
Inputs:e and ; where e is odd Outputs: GCD (e, ) and
|
2.2. Countermeasures against SCA on BEEA
- Select r at random such that 0 < r < p;
- Compute ;
- Compute ;
- Compute .
3. Profiling Attacks
- First, the attacker collects several power consumption traces from a device running a BEEA and calculates an intermediate value for each of them;
- Then, the intermediate value corresponding to the power consumption is used as a label, and the profile is constructed through a training process by the MLP model.
- The attacker calculates the matching probability between the power consumption measured from the attack device and the profile constructed in Step 1;
- The value with the highest probability is adopted as the correct intermediate value; then, the secret value is recovered.
Single Trace Profiling Attacks
4. Profiling Attack on the Euclidean Algorithm
- The hardware device(s) employed for the PA have a source of leakage;
- The target RSA key generation uses a classical Euclidean algorithm to compute d and/or ;
- The BEEA implementation uses the masking method defined in Equation (6);
- An adversary can acquire sufficient power (or electromagnetic) signals from the target device (preferred) or similar signals running the BEEA or a similar function;
- An adversary can acquire the power (or electromagnetic) signals of the whole target RSA key generation phase.
4.1. Attack Points on Private Key Generation
4.2. Attack Points on the Coprimality Tests
4.3. Profiles and Guesses Verification
5. Experimental Results
5.1. Experiment Environment
5.2. Attack Model
5.3. Experiment Results
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Liskov, M. Fermat’s Little Theorem. In Encyclopedia of Cryptography and Security; van Tilborg, H.C.A., Ed.; Springer: Boston, MA, USA, 2005. [Google Scholar]
- Kaliski, B.S. The Montgomery inverse and its applications. IEEE Trans. Comput. 1995, 44, 1064–1065. [Google Scholar] [CrossRef]
- Dussé, S.R.; Kaliski, B.S., Jr. A cryptographic library for the Motorola DSP56000. In Advances in Cryptology—EUROCRYPT 90; Springer: Berlin/Heidelberg, Germany, 1990; pp. 230–244. [Google Scholar]
- Arazi, O.; Qi, H. On calculating multiplicative inverses modulo 2m. IEEE Trans. Comput. 2008, 57, 1435–1438. [Google Scholar] [CrossRef]
- Koç, C.K. A New Algorithm for Inversion mod pk. IACR Cryptol. ePrint Arch. 2017, 2017, 411. [Google Scholar]
- De la Fé, S.; Ramis, C. A Secure algorithm for inversion modulo 2k. Cryptography 2018, 2, 23. [Google Scholar] [CrossRef] [Green Version]
- Stein, J. Computational problems associated with Racah algebra. J. Comput. Phys. 1967, 1, 397–405. [Google Scholar] [CrossRef]
- Knuth, D.E. The Art of Computer Programming. In Seminumerical Algorithms; Addison-Wesley Longman Publishing Co.: Boston, MA, USA, 1997. [Google Scholar]
- Acıiçmez, O.; Gueron, S.; Seifert, J.-P. New branch prediction vulnerabilities in OpenSSL and necessary software countermeasures. Cryptogr. Coding 2007, 4887, 185–203. [Google Scholar]
- Menezes, A.J.; van Oorschot, P.; Vanstone, S. Handbook of Applied Cryptography; CRC Press: New York, NY, USA, 1997. [Google Scholar]
- Cabrera Aldaya, A.; Cabrera Sarmiento, A.J.; Sánchez-Solano, S. SPA vulnerabilities of the binary extended Euclidean algorithm. J. Cryptogr. Eng. 2016, 7, 273–285. [Google Scholar] [CrossRef]
- Aravamuthan, S.; Thumparthy, V.R. A parallelization of ECDSA resistant to simple power analysis attacks. In Proceedings of the 2nd International Conference on Communication Systems Software and Middleware, Bangalore, India, 7–12 January 2007; pp. 1–7. [Google Scholar]
- Cabrera Aldaya, A.; Cuiman Márquez, R.; Cabrera Sarmiento, A.J.; Sánchez-Solano, S. Side-channel analysis of the modular inversion step in the RSA key generation algorithm. Int. J. Circuit Theory Appl. 2017, 45, 199–213. [Google Scholar] [CrossRef] [Green Version]
- Chartier, M. Method to Protect a Binary GCD Computation against SPA. Attacks. Patent WO/2013/092265, 27 June 2013. [Google Scholar]
- De Mulder, E.; Hutter, M.; Marson, M.E.; Pearson, P. Using Bleichenbacher’s solution to the hidden number problem to attack nonce leaks in 384-bit ECDSA: Extended version. J. Cryptogr. Eng. 2014, 4, 33–45. [Google Scholar] [CrossRef]
- Rivest, R.L.; Shamir, A.; Adleman, L.M. A method for obtaining digital signatures and public-key cryptosystems. Commun. ACM 1978, 21, 120–126. [Google Scholar] [CrossRef]
- Hardy, G.H.; Wright, E.M.; Wiles, A.J. An Introduction to the Theory of Numbers, 6th ed.; Oxford University Press: Oxford, UK, 2008; pp. 3–4. [Google Scholar]
- Deschamps, J.-P.; Sutter, G. Hardware implementation of finite-field division. Acta Appl. Math. 2006, 93, 119–147. [Google Scholar] [CrossRef]
- Bigou, K.; Tisserand, A. Improving modular inversion in RNS using the plus-minus method. In Cryptographic Hardware and Embedded Systems—CHES 2013, LNCS 8086; Springer: Berlin/Heidelberg, Germany, 2013; pp. 233–249. [Google Scholar]
- Galindo, D.; Großschädl, J.; Liu, Z.; Vadnala, P.K.; Vivek, S. Implementation of a leakage-resilient ElGamal key encapsulation mechanism. J. Cryptogr. Eng. 2016, 6, 229–238. [Google Scholar] [CrossRef] [Green Version]
- ARM Limited. Mbed TLS: Open Source Embbeded TLS Library. Available online: https://tls.mbed.org/ (accessed on 30 June 2021).
- Chari, S.; Rao, J.; Rohatgi, P. Template Attacks. In Cryptographic Hardware and Embedded Systems—CHES 2002, LNCS 2523; Springer: Berlin/Heidelberg, Germany, 2002; pp. 51–62. [Google Scholar]
- Yang, S.; Zhou, Y.; Liu, J.; Chen, D. Back propagation neural network based leakage characterization for practical security analysis of cryptographic implementations. Proc. Int. Conf. Inf. Secur. Cryptol. (ICISC) 2011, 7259, 169–185. [Google Scholar]
- Martinasek, Z.; Zeman, V. Innovative method of the power analysis. Radioengineering 2013, 22, 586–594. [Google Scholar]
- Martinasek, Z.; Malina, L.; Trasy, K. Profiling Power Analysis Attack Based on Multi-layer Perceptron Network. In Computational Problems in Science and Engineering: Lecture Notes in Electrical Engineering; Springer: Berlin/Heidelberg, Germany, 2008; p. 343. [Google Scholar]
- Martinasek, Z.; Dzurenda, P.; Malina, L. Profiling power analysis attack based on MLP, DPA contest V4.2. In Proceedings of the 39th International Conference on Telecommunications and Signal Processing, Vienna, Austria, 27–29 June 2016; pp. 223–226. [Google Scholar]
- Benadjila, R.; Prouff, E.; Strullu, R.; Cagli, E.; Dumas, C. Deep learning for side-channel analysis and introduction to ASCAD database. J. Cryptogr. Eng. 2020, 10, 163–188. [Google Scholar] [CrossRef]
- Wagner, M.; Heyse, S. Single-Trace Template Attack on the DES Round Keys of a Recent Smart Card. Available online: https://eprint.iacr.org/2017/057.pdf (accessed on 7 November 2021).
- Järvinen, K.; Balasch, J. Single-trace side-channel attacks on scalar multiplications with precomputations. CARDIS 2016, 10146, 137–155. [Google Scholar]
- Choudary, O.; Kuhn, M.G. Efficient Template Attacks. CARDIS 2013 2013, 8419, 253–270. [Google Scholar]
- Bishop, C.M. Pattern Recognition and Machine Learning; Springer: New York, NY, USA, 2006. [Google Scholar]
Operation 1 | Operation 2 | |
1st iteration | ||
2nd iteration | ||
Result 1 | Result 2 | |
1st iteration | ||
2nd iteration |
Operation 1 | Operation 2 | |
3rd iteration | or | |
4th iteration | or | |
Result 1 | Result 2 | |
3rd iteration | or | |
4th iteration | or | |
Optimization Option | Description of Optimization Level |
---|---|
-O0 | None |
-O1 | Optimization of speed (Low) |
-O2 | Optimization of speed (Medium) |
-O3 | Optimization of speed (High) |
-Os | Optimization of size |
Optimization Option | Description of Optimization Level |
---|---|
Input Layer | |
Hidden Layer | Dense(200) with activation function ELU |
BatchNormalization | |
Dropout(0.3) | |
Dense(200) with activation function ELU | |
BatchNormalization | |
Dropout(0.3) | |
Output Layer | 256 |
Optimizer | NAdam(lr = 0.002, beta1 = 0.9, beta2 = 0.999, decay = 0.004) |
Loss Function | categorical cross entropy |
Epoch | 500 |
Batch Size | 32 |
-O0 | -O1 | -O2 | -O3 | -Os | |
---|---|---|---|---|---|
Case 1 | 100.00% | 100.00% | 98.90% | 99.20% | 99.30% |
Case 2 | 100.00% | 100.00% | 98.90% | 99.20% | 99.30% |
Case 3 | 100.00% | 100.00% | 98.80% | 99.30% | 99.20% |
Case 4 | 100.00% | 100.00% | 99.20% | 99.50% | 98.90% |
Case 5 | 100.00% | 100.00% | 99.30% | 99.40% | 99.70% |
Case 6 | 100.00% | 100.00% | 98.10% | 99.10% | 99.40% |
Case 7 | 100.00% | 100.00% | 98.80% | 99.40% | 99.40% |
Case 8 | 100.00% | 100.00% | 98.70% | 99.00% | 96.70% |
Case 9 | 100.00% | 99.80% | 98.70% | 88.00% | 99.40% |
Case 10 | 100.00% | 99.98% | 98.82% | 97.46% | 99.03% |
Average | 100.00% | 100.00% | 98.90% | 99.20% | 99.30% |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
de la Fe, S.; Park, H.-B.; Sim, B.-Y.; Han, D.-G.; Ferrer, C. Profiling Attack against RSA Key Generation Based on a Euclidean Algorithm. Information 2021, 12, 462. https://doi.org/10.3390/info12110462
de la Fe S, Park H-B, Sim B-Y, Han D-G, Ferrer C. Profiling Attack against RSA Key Generation Based on a Euclidean Algorithm. Information. 2021; 12(11):462. https://doi.org/10.3390/info12110462
Chicago/Turabian Stylede la Fe, Sadiel, Han-Byeol Park, Bo-Yeon Sim, Dong-Guk Han, and Carles Ferrer. 2021. "Profiling Attack against RSA Key Generation Based on a Euclidean Algorithm" Information 12, no. 11: 462. https://doi.org/10.3390/info12110462
APA Stylede la Fe, S., Park, H. -B., Sim, B. -Y., Han, D. -G., & Ferrer, C. (2021). Profiling Attack against RSA Key Generation Based on a Euclidean Algorithm. Information, 12(11), 462. https://doi.org/10.3390/info12110462