Deep-Learning-Based Cryptanalysis of Lightweight Block Ciphers Revisited
Abstract
:1. Introduction
1.1. Contribution
1.1.1. Designing Artificial Neural Networks Considering the Characteristics of Cryptographic Algorithms
1.1.2. Improving Performance for S-DES Cryptanalysis
1.1.3. The First Key Recovery (Random Bit Key) Based on Deep Learning for S-AES and S-SPECK
1.2. Organization
2. Preliminaries
2.1. Artificial Neural Network
2.1.1. Residual Connections in Neural Networks
2.1.2. Gated Linear Units
2.2. Artificial Neural Network-Based Cryptanalysis
2.3. Previous Work
2.4. Target Lightweight Cipher
- S-DES: It is a simplified version of the DES. It has an 8-bit block size and a 10-bit key size. S-DES consists of initial permutation (), Cipher function f (expansion, key addition, substitution, and permutation), and swap function. The encryption process can be demonstrated as . Before the 1-round, the plaintext that has been subjected to initial permutation is divided into and (these are plaintext). The round function () is performed twice and is calculated as: , . In key scheduling, two 8-bit subkeys are generated by permutation and shift operations on a 10-bit key. Therefore, it has a 10-bit master key and two 8-bit subkeys.
- S-AES: It consists of nibbles substitution (), shift rows (), mix columns (), and key addition (). The key expansion and encryption are based on an S-box () that depends on a finite field with 16 elements. It has a 16-bit key, operates on 16-bit plaintext, and has two rounds. The encryption consists of 8 functions () for two round, and is applied first.
- S-SPECK: S-SPECK used in our work does not mean a simplified structure (function) but an implementation with reduced key space and reduced rounds. It has 10 variants, but we consider only 32-bit plaintext here. It consists of a 128-bit key and 22 rounds in full version. However, we start cryptanalysis with one round and 1-bit key space, extending it as much as possible (if we succeed in analyzing the full round and full key, our target is not S-SPECK). S-SPECK has the same structure as SPECK. So the round function operates like this. First, the round function divides the input value into l and r, and rotation, addition, and xor are performed as follows: and
3. Deep-Learning-Based Key Recovery for Lightweight Block Ciphers
3.1. Data Generation
3.2. Neural Network Structure for Cryptanalysis
3.2.1. Structure of Neural Network for Cryptanalysis for S-DES
3.2.2. Structure of Neural Network for Cryptanalysis for S-AES
3.2.3. Structure of Neural Network for Cryptanalysis for S-SPECK
3.3. Training and Testing
3.3.1. Training
3.3.2. Testing
4. Evaluation
4.1. Experiment Environment
4.2. Experiments on S-DES
4.2.1. Training Result
- Epoch: As a result of 100 epochs in the network that both techniques are applied, the loss was sufficiently reduced (this means that the loss is no longer decreasing). The network that applies the skip connection requires 150 epochs. In the case of the previous work, 5000 epochs are performed. Since the GLU and residual connection technology are added to this work, stable and fast training is possible compared to the basic network.
- Loss: We used the MSE loss function. As a result of training a neural network to which a residual connection is applied, the training loss is 0.1656 and the validation loss achieves 0.1660. The results of training a neural network to both the residual connection and GLU are applied. The training loss achieves 0.1774 and the validation loss achieves 0.1767.
- Optimizer: We use the Adam optimizer. The optimizer is a function that finds the minimum value of the loss function (to minimize the loss). When the optimizer moves toward the minimum, its stride is called the learning rate. The learning rate of the optimizer is set as the learning rate exponential decay method. The range of the learning rate is from 0.001 to 0.1. Learning rate decay uses the large learning rate value at first, and then the value gradually decreases. This allows the neural network to achieve optimal training results faster.
4.2.2. Bit Accuracy Probability
4.2.3. Bit Accuracy Probability by Epoch
4.3. Experiments on S-AES
4.3.1. Training Result
- Parameters: Cryptanalysis for S-AES requires much larger parameters than S-DES. The number of parameters for S-AES with 12-bit key space is 5,326,944, and the number of parameters for S-AES with 12-bit key space is 11,636,832. When the key space is increased by one bit, the number of parameters increases significantly compared to S-DES.
- Loss: In S-AES, the MSE loss function is also used. As a result of training, a training loss of 0.1826 and a validation loss of 0.1923 were achieved.
- Optimizer: We use the Adam optimizer [21], and it is also set to the learning rate exponential decay method (the range of learning rate is 0.001 to 0.1).
- Epoch: The epoch was set to 150. There is no decrease in loss even after training more than 150 epochs.
4.3.2. Bit Accuracy Probability
4.4. Experiments on S-SPECK
4.4.1. Training Result
- Parameters: The number of parameters of our model is 3,333,894. When a network smaller than this was used, there were cases where the BAP was less than 0.5. Additionally, since the size of the data set is large, out-of-memory (OOM) occurs. Therefore, the size of the model cannot be increased any further.
- Loss: We use the MSE loss function. The loss decreases to 0.2499. This result shows that it is barely trained considering the initial loss of 0.2548.
- Optimizer: We use the Adam optimizer with a cyclic learning rate (the range of learning rate is 0.001 to 0.002).
- Epoch: We set the number of epochs to 20. In order to the limitations of the experiment environment, we cannot use larger neural networks. Therefore, the accuracy did not improve even after learning more than 20 epochs.
4.4.2. Bit Accuracy Probability
4.5. Comparison of Cryptanalysis for S-DES, S-AES, and S-SPECK
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Matsui, M. Linear cryptanalysis method for DES cipher. In Workshop on the Theory and Application of of Cryptographic Techniques; Springer: Berlin/Heidelberg, Germany, 1993; pp. 386–397. [Google Scholar]
- Biham, E.; Shamir, A. Differential cryptanalysis of DES-like cryptosystems. J. Cryptol. 1991, 4, 3–72. [Google Scholar] [CrossRef]
- Kelsey, J.; Schneier, B.; Wagner, D.; Hall, C. Side channel cryptanalysis of product ciphers. In Computer Security—ESORICS 98: 5th European Symposium on Research in Computer Security Louvain-la-Neuve, Belgium 16–18 September 1998 Proceedings 5; Springer: Berlin/Heidelberg, Germany, 1998; pp. 97–110. [Google Scholar]
- Gohr, A. Improving attacks on round-reduced speck32/64 using deep learning. In Annual International Cryptology Conference; Springer: Berlin/Heidelberg, Germany, 2019; pp. 150–179. [Google Scholar]
- Benamira, A.; Gerault, D.; Peyrin, T.; Tan, Q.Q. A deeper look at machine learning-based cryptanalysis. In Annual International Conference on the Theory and Applications of Cryptographic Techniques; Springer: Berlin/Heidelberg, Germany, 2021; pp. 805–835. [Google Scholar]
- So, J. Deep learning-based cryptanalysis of lightweight block ciphers. Secur. Commun. Netw. 2020, 2020, 3701067. [Google Scholar] [CrossRef]
- Shor, P.W. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM Rev. 1999, 41, 303–332. [Google Scholar] [CrossRef]
- Grover, L.K. A fast quantum mechanical algorithm for database search. In Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, Philadelphia, PA, USA, 22–24 May 1996; ACM: New York, NY, USA, 1996; pp. 212–219. [Google Scholar]
- Ooi, K.; Vito, B.C. Cryptanalysis of S-DES. Cryptology ePrint Archive. 2002. Available online: https://eprint.iacr.org/2002/045.pdf (accessed on 25 June 2023).
- Musa, M.A.; Schaefer, E.F.; Wedig, S. A simplified AES algorithm and its linear and differential cryptanalyses. Cryptologia 2003, 27, 148–177. [Google Scholar] [CrossRef]
- Beaulieu, R.; Shors, D.; Smith, J.; Treatman-Clark, S.; Weeks, B.; Wingers, L. The SIMON and SPECK lightweight block ciphers. In Proceedings of the 52nd Annual Design Automation Conference, San Francisco, CA, USA, 8–12 June 2015; ACM: New York, NY, USA, 2015; pp. 1–6. [Google Scholar]
- Standard, Data Encryption. Data Encryption Standard; Federal Information Processing Standards Publication: Gaithersburg, MD, USA, 1999; Volume 112. [Google Scholar]
- Daemen, J.; Rijmen, V. AES Proposal: Rijndael. 1999. Available online: https://csrc.nist.gov/csrc/media/projects/cryptographic-standards-and-guidelines/documents/aes-development/rijndael-ammended.pdf (accessed on 25 June 2023).
- Haykin, S. Neural Networks and Learning Machines, 3/E; Pearson Education: Delhi, India, 2009. [Google Scholar]
- Kukreja, H.; Bharath, N.; Siddesh, C.; Kuldeep, S. An introduction to artificial neural network. Int. J. Adv. Res. Innov. Ideas Educ. 2016, 1, 27–30. [Google Scholar]
- Farsal, W.; Anter, S.; Ramdani, M. Deep learning: An overview. In Proceedings of the 12th International Conference on Intelligent Systems: Theories and Applications, Rabat, Morocco, 9–10 May 2018; ACM: New York, NY, USA, 2018; pp. 1–6. [Google Scholar]
- Albawi, S.; Mohammed, T.A.; Al-Zawi, S. Understanding of a convolutional neural network. In Proceedings of the 2017 International Conference on Engineering and Technology (ICET), Antalya, Turkey, 21–23 August 2017; IEEE: Toulouse, France, 2017; pp. 1–6. [Google Scholar]
- Petneházi, G. Recurrent neural networks for time series forecasting. arXiv 2019, arXiv:1901.00069. [Google Scholar]
- Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative adversarial networks. Commun. ACM 2020, 63, 139–144. [Google Scholar] [CrossRef]
- Sutton, R.S.; Barto, A.G. Reinforcement Learning: An Introduction; MIT Press: Cambridge, MA, USA, 2018. [Google Scholar]
- Ruder, S. An overview of gradient descent optimization algorithms. arXiv 2016, arXiv:1609.04747. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; IEEE: Toulouse, France, 2016; pp. 770–778. [Google Scholar]
- Dauphin, Y.N.; Fan, A.; Auli, M.; Grangier, D. Language modeling with gated convolutional networks. In International Conference on Machine Learning; PMLR: Singapore, 2017; pp. 933–941. [Google Scholar]
- Blackledge, J.; Bezobrazov, S.; Tobin, P. Cryptography using artificial intelligence. In Proceedings of the 2015 International Joint Conference on Neural Networks (IJCNN), Killarney, Ireland, 12–17 July 2015; IEEE: Toulouse, France, 2015; pp. 1–6. [Google Scholar]
- Focardi, R.; Luccio, F.L. Neural Cryptanalysis of Classical Ciphers. ICTCS. 2018, pp. 104–115. Available online: https://ceur-ws.org/Vol-2243/paper10.pdf (accessed on 25 June 2023).
- Hou, Z.; Ren, J.; Chen, S. Improve Neural Distinguishers of SIMON and SPECK. Secur. Commun. Netw. 2021, 2021, 9288229. [Google Scholar] [CrossRef]
- Idris, M.F.; Teh, J.S.; Yan, J.L.S.; Yeoh, W.Z. A deep learning approach for active S-box prediction of lightweight generalized feistel block ciphers. IEEE Access 2021, 9, 104205–104216. [Google Scholar] [CrossRef]
- Kim, H.J.; Song, G.J.; Jang, K.B.; Seo, H.J. Cryptanalysis of Caesar using Quantum Support Vector Machine. In Proceedings of the 2021 IEEE International Conference on Consumer Electronics-Asia (ICCE-Asia), Seoul, Republic of Korea, 1–3 November 2020; IEEE: Toulouse, France, 2021; pp. 1–5. [Google Scholar]
- Kariya, A.; Behera, B.K. Investigation of Quantum Support Vector Machine for Classification in NISQ era. arXiv 2021, arXiv:2112.06912. [Google Scholar]
- Noble, W.S. What is a support vector machine? Nat. Biotechnol. 2006, 24, 1565–1567. [Google Scholar] [CrossRef] [PubMed]
- Toshihiko, O. Lightweight cryptography applicable to various IoT devices. NEC Tech. J. 2017, 12, 67–71. [Google Scholar]
- Shannon, C.E. Communication theory of secrecy systems. Bell Syst. Tech. J. 1949, 28, 656–715. [Google Scholar] [CrossRef]
Algorithm | Rounds | ||||
---|---|---|---|---|---|
S-DES | 55,000 | 30,000 | 15,000 | 8, 10 | 2 |
S-AES | 900,000 | 500,000 | 200,000 | 16, 16 | 2 |
S-SPECK | 10,000,000 | 2,000,000 | 100,000 | 32, 64 | 22 |
Method | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th | 10th | Parameters |
---|---|---|---|---|---|---|---|---|---|---|---|
[6] | 0.64 | 0.74 | 0.71 | 0.58 | 0.64 | 0.8 | 0.54 | 0.6 | 0.84 | 0.8 | 805,930 |
This work (Res) | 0.72 | 0.77 | 0.75 | 0.6 | 0.76 | 0.8 | 0.59 | 0.68 | 0.85 | 0.83 | 53,802 |
This work (Res+GLU) | 0.72 | 0.79 | 0.77 | 0.62 | 0.75 | 0.81 | 0.59 | 0.66 | 0.87 | 0.85 | 55,092 |
Epoch | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th | 10th |
---|---|---|---|---|---|---|---|---|---|---|
15 | S | S | S | S | V | S | S | V | ||
25 | S | S | V | S | S | V | ||||
35 | S | S | V | S | S | V | ||||
95 | S | S | V | S | S | V | ||||
100 | S | V | S | V | V |
Key | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th | 10th | 11st | 12nd | 13rd | 14th | 15th | 16th |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9-bit | - | - | - | - | - | - | - | 0.7 | 0.7 | 0.69 | 0.69 | 0.7 | 0.69 | 0.69 | 0.7 | 0.69 |
10-bit | - | - | - | - | - | - | 0.63 | 0.63 | 0.63 | 0.64 | 0.63 | 0.63 | 0.6 | 0.6 | 0.6 | 0.6 |
11-bit | - | - | - | - | - | 0.52 | 0.53 | 0.52 | 0.53 | 0.52 | 0.52 | 0.53 | 0.52 | 0.51 | 0.52 | 0.52 |
12-bit | - | - | - | - | 0.51 | 0.51 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 | 0.51 | 0.5 | 0.5 | 0.5 | 0.5 |
Key | 1st | 2nd | 3rd | 4th | 5th | 6th |
---|---|---|---|---|---|---|
4-bit | - | - | 0.54 | 0.53 | 0.53 | 0.53 |
5-bit | - | 0.52 | 0.51 | 0.51 | 0.52 | 0.52 |
6-bit | 0.51 | 0.51 | 0.51 | 0.51 | 0.50 | 0.51 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 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
Kim, H.; Lim, S.; Kang, Y.; Kim, W.; Kim, D.; Yoon, S.; Seo, H. Deep-Learning-Based Cryptanalysis of Lightweight Block Ciphers Revisited. Entropy 2023, 25, 986. https://doi.org/10.3390/e25070986
Kim H, Lim S, Kang Y, Kim W, Kim D, Yoon S, Seo H. Deep-Learning-Based Cryptanalysis of Lightweight Block Ciphers Revisited. Entropy. 2023; 25(7):986. https://doi.org/10.3390/e25070986
Chicago/Turabian StyleKim, Hyunji, Sejin Lim, Yeajun Kang, Wonwoong Kim, Dukyoung Kim, Seyoung Yoon, and Hwajeong Seo. 2023. "Deep-Learning-Based Cryptanalysis of Lightweight Block Ciphers Revisited" Entropy 25, no. 7: 986. https://doi.org/10.3390/e25070986