A deep learning based known-plaintext attack method for chaotic cryptosystem
Abstract
In this paper, we propose a known-plaintext attack (KPA) method based on deep learning for traditional chaotic encryption scheme. We employ the convolutional neural network to learn the operation mechanism of chaotic cryptosystem, and accept the trained network as the final decryption system. To evaluate the attack performance of different networks against different chaotic cryptosystem, we adopt two neural networks to perform known-plaintext attacks on two distinct chaotic encryption schemes. The experimental results demonstrate the potential of deep learning-based method for known-plaintext attack against chaotic cryptosystem. Different from the previous known-plaintext attack methods, which were usually limited to specific chaotic cryptosystems, a neural network can be applied to the cryptanalysis of various chaotic cryptosystems with deep learning-based approach, while several different networks can be designed for the cryptanalysis of chaotic cryptosystems. This paper provides a new idea for the cryptanalysis of chaotic image encryption algorithm.
keywords:
Chaotic image encryption, Cryptanalysis, Known-plaintext attack, Deep learning, Convolution Neural Network1 Introduction
Many chaotic image encryption algorithms have been proposed during the past years, and their security requirements have achieved good improvement [1, 2, 3, 4, 5, 6]. While the chaotic cryptosystem is developing rapidly, its security has also attracted widespread attention. Many attack schemes against certain specific chaotic encryption algorithm have been proposed in succession, e.g., Dou et al. [7] proposed an effective attack scheme against the one-dimensional combined chaotic color image encryption algorithm [8] in the case of unknown parameters. Li et al. [9] proposed a chosen-plaintext attack strategy against one-dimensional bit-level chaotic color image encryption algorithm [10] and proved the effectiveness and feasibility of the method. However, the disadvantage of these methods is that they are limited to solving particular chaotic encryption schemes, and cannot attack other encryption algorithms.
In recent years, deep learning also has numerous applications in the domain of cryptography, especially in image encryption [11, 12]. Besides, Hai et al. [13] first put forward one method to apply deep learning to the cryptanalysis of optical encryption scheme. They designed a deep neural network namely DecNet to train iterative a large number of “plaintext-ciphertext” pairs generated by the classical double random phase encoding system even the more secure triple random phase encoding system, and then regarded the trained model as the “equivalent key” of the cryptographic system, which was used to crack the subsequent ciphertext.
Based on the shortcomings of traditional chaotic system cryptanalysis and the stimulation of [13] method, in this paper, we propose a known-plaintext attack method based on deep learning for chaotic cryptosystems. Two chaotic encryption schemes are adopted to encrypt images to generate sufficient “plaintext-ciphertext” pairs, and two convolution neural networks are utilized as the decryption model to train these data. Then ciphertext images are performed to verify and visualize the decryption effect on the trained model.
The main contributions of our work are outlined as follows:
-
1.
A known plaintext attack method based on deep learning for chaotic cryptosystems is proposed for the first time.
-
2.
By employing two different convolution neural networks to train the “plaintext-ciphertext” pairs, which are generated by two kinds of chaotic encryption schemes, excellent ciphertext reconstruction results can be obtained.
-
3.
We get the conclusion, different from the traditional known-plaintext attack methods for chaotic cryptosystems, one neural network can be employed to decrypt different chaotic cryptosystems, and one chaotic cryptosystem can take multiple neural networks as decrypters for comparing their ciphertext reconstruction effects.
2 CNN for known-plaintext attack on chaotic cryptosystems
The decryption work of ciphertext images is quite similar to some classic tasks in deep learning, such as image denoising [14], image defogging [15] and image super-resolution reconstruction [16], in which their purposes are always to recover some fuzzy or even invisible images to the same resolution as the original image as much as possible. Therefore, we adopt two encoder-decoder neural networks based on end-to-end structure as experimental models, including the medical segmentation network Unet [17] that is the earliest used for image denoising tasks, and the Multi-Stage Encoder-Decoder Network (MSEDNet) proposed by us. The specific introduction is as follows.
2.1 Unet
As a classic encoder-decoder network in the field of medical image processing, Unet [17] is usually conducted for image segmentation, image compression, image denoising, etc. It can also be used to decrypt encrypted information and restore images. A straightforward modification is made to Unet’ output channels since the datasets contain vast small-size images, and its network structure is shown in Fig. 1.

In addition to the last convolution layer with kernel size 1x1, each convolution consists of three consecutive operations: convolution (Conv) with 3x3 kernel size, batch normalization (BN), and rectified linear unit (ReLU). The down-sampling phase adopts the max-pooling of stride 2x2. The up-sampling layers are concatenated with the output of the corresponding down-sampling layer and deconvolved with a 2x2 filter.
2.2 MSEDNet
In this paper, we propose an encoder-decoder network for decryption, named Multi-Stage Encoder Decoder Network. The first five layers of the left column of the network are encoding layers, and each layer is composed of convolution (Conv) with filter size 3x3, batch normalization (BN), rectified linear unit (ReLU), and average pooling layer with stride 2x2. Through feature extraction, higher-precision pixel-by-pixel estimation can be achieved while maintaining the per-pixel position information on the feature map.
In the decoding stage, we integrate the feature map of multiple encoding stages to fully fuse the multi-scale context information and conduct pixel-by-pixel regression considering that simple interpolation operation cannot restore the information lost in the previous pooling layer, even if skip connections are employed. The network structure is presented in Fig. 2.

3 Chaotic encryption system
To better verify that the known-plaintext attack method based on deep learning can be applied to the cryptanalysis of different chaotic encryption systems, we introduce two chaotic encryption schemes as the targets to be attacked: (1) the classic one dimensional chaotic map (for grayscale images); (2) the proposed hybrid chaotic map, i.e., employ one dimensional Logistic, Sine, and Chebyshev maps to encrypt the R, G and B channels of the image separately (for color images).
3.1 One-dimensional chaotic maps
This part briefly introduces three types of classic one-dimensional chaotic maps: Logistic map, Sine map, and Chebyshev map [18]. In view of the space limitation and the similar nature of the experiment, we only employ Logistic map as the experimental scheme in one-dimensional chaotic map.
3.1.1 Logistic map
One-dimensional Logistic map has extremely complex dynamic behavior, and its mathematical expression formula is as follows:
(1) |
where is the nth chaotic iterative sequence with vector length n. The initialization parameters , , and when is especially closer to 4, the iteration sequence will be in a pseudo-random distribution state. In experiment, we set , .
3.1.2 Sine map
As one of classical one-dimensional chaotic maps, Sine map can generate chaotic sequences similar to Logical map. It can be defined by the following equation:
(2) |
where is the output chaotic iterative sequence, the initial parameter . We set , .
3.1.3 Chebyshev map
Chebyshev map, which is similar to sine map, displays some specific chaotic effects. This function is formulated as below:
(3) |
when the parameter , the output sequence has chaotic behavior. In our experiment, we set , .
3.2 Hybrid chaotic maps
This section will introduce the above-mentioned one-dimensional hybrid chaotic map. In [6], one novel image encryption scheme was proposed to combine two different chaotic maps and derive a new encryption formula, which was used to encrypt the image and reduce the correlation between the three channels of image R, G and B. Based on this idea, three different one-dimensional chaotic maps are adopted in this paper to perform chaotic processing on R, G and B channels of the color image. Compared with using only one-dimensional Logistic map to generate a sequence of length W x H x C (W, H, C denotes width, height, channels of the image), the hybrid chaotic map is more secure and can further reflect the ability of convolution neural network to learn the encryption mechanism of chaotic systems. In Section 5, we observe that the hybrid chaotic map is better than the one-dimensional Logistic map in terms of the chaotic effect through the evaluation metrics in Fig. 3 and Fig. 5. The mathematical formula is as follows:
(4) |
(5) |
(6) |
(7) |
where Eq.(4) indicates that the color image is divided into three single-channel images along channel; in Eq.(5), Eq.(6), Eq.(7), represents the chaotic processing of the R, G, and B channels of the color image with Logistic map, Sine map, and Chebyshev map respectively.
4 Implementation Details
In this section, we give the experimental details of known-plaintext attacks on different chaotic cryptosystems by various convolution neural networks. It is assumed that the attacker has obtained a large number of “plaintext-ciphertext” pairs without knowing the encryption algorithm since the neural network needs abundant data samples to learn the map relationship between the input end and the output end. So, through two encryption schemes, we produce firstly sufficient “plaintext-ciphertext” pairs on datasets, which is then transmitted to two neural networks as training sets. In the end, the ciphertext images of the testing set are input into the trained decryption model to verify the reconstruction effect.
4.1 Datasets
In this paper, we generate the “plaintext-ciphertext” pairs required for the experiment on MNIST [19] and CIFAR-10 [20]. Since MNIST are all single-channel images, we employ an one-dimensional Logistic map to encrypt the datasets, while utilize hybrid chaotic map to encrypt the three-channel images of cifar-10. These “plaintext-ciphertext” pairs are randomly divided, 90 of which are used as training sets of neural networks, while the rest are employed as testing sets to detect the decryption ability of model.
4.2 Loss Function
To minimize the information loss between the decrypted images and the plaintext images, the absolute value loss function (L1loss) is used to supervise the training of all the networks in this paper. The equation is defined as follows:
(8) |
where is the number of the training images batch, is the decrypted image output by the network with parameters , is the supervision label (plaintext) of the ciphertext .
4.3 Training details
All experiments are implemented in the environment of CPU-Python3.5-Pytorch1.0, employing Adam optimizer with L2 regularization weight decay rate of 1e-4. The initial learning rate is 1e-5 and it drops by 10% every 20 epochs when training with a batch size of 8. In addition, a dropout layer with ratio of 0.5 is added to the partial convolution layer to prevent the network from over-fitting.
5 Experiments
5.1 Evaluation metrics
In the experiment, Pearson correlation coefficient [21] was taken as the evaluation metrics for two aspects: (1) to estimate the correlation between plaintext images and ciphertext images in different chaotic encryption systems in Section3; (2) to evaluate the correlation between the output (decryption image) and the label (plaintext image) of the known-plaintext attack method based on deep learning. It can be defined by the following equation:
(9) |
(10) |
(11) |
where , represent the width and height of the images respectively, is the output of the network (decrypted image), is the label of the network (plaintext image). This Eq.(11) is applicable to two encryption schemes and is regarded as training/testing accuracy.
5.2 Experiment results of Logistic map on MNIST
Table. 1 shows the experimental results of two convolution neural networks to crack the Logistic map on the MNIST dataset, including training Loss, training average accuracy, testing average accuracy, epoch and the running time of each epoch.
Fig. 3 gives the visualization results of one-dimensional Logistic map on the MNIST dataset, where the first column shows the plaintext image; the second column displays the corresponding ciphertext image; the third-fourth columns list the decrypted images of MSEDNet, and Unet severally. At the same time, the correlation coefficients of the ciphertext image and the plaintext image, as well as the decrypted images and the plaintext image are given separately. From the results we can observe that the testing ciphertext images can be well reconstructed by the neural network, and the correlation with the plaintext gradually tends to 1. However, the reconstruction effect of diverse networks is different, among which the decryption effect is Unet ¿ MSEDNet.


(a)

(b)
The curve changes of training Loss and testing evaluation metrics of two networks on the MNIST dataset are plotted in Fig. 4 (a) and Fig. 4 (b). We reach the conclusion from the figure that the selections of neural network for the same encryption scheme greatly affect the training time and accuracy. The training efficiency and accuracy of Unet [17] are better than the MSEDNet.
5.3 Experiment results of Hybrid chaotic map on Cifar
Table. 2 presents the experimental results of different convolution neural networks cracking the hybrid chaotic map (Cifar-10), similar to Table. 1.

Ëncryption Scheme | Network | Training accuracy | Testing accuracy | Epoch | Time/Epoch |
---|---|---|---|---|---|
Logistic Map | MSEDNet | 98.32% | 97.80% | 200 | 80s |
Unet | 99.61% | 99.15% | 85s |
Ëncryption Scheme | Network | Training accuracy | Testing accuracy | Epoch | Time/Epoch |
---|---|---|---|---|---|
Hybrid Chaotic Map | MSEDNet | 95.86% | 93.62% | 800 | 82s |
Unet | 97.82% | 95.70% | 89s |
Fig. 5 shows the visualization results of the hybrid chaotic map on the Cifar-10 dataset, which is greatly similar to MNIST, i.e., after more epochs training, the ciphertext image in testing set can be reconstructed pretty well, but the two reconstruction effects have slight differences, among which the decryption effect is Unet ¿ MSEDNet. Fig. 6 displays the curve changes of training Loss and testing evaluation metrics of two networks on the Cifar-10 dataset. Similar to Fig. 4, it can be observed that the training efficiency and accuracy of Unet are significantly higher than MSEDNet.
5.4 Experimental analysis
This paper aims to investigate the cryptanalysis of performing known-plaintext attacks with multiple convolution neural networks against different chaotic encryption systems. The following conclusions can be drawn from the above experimental data in the figure and table: (1) For the same encryption scheme, different neural networks can be used as the decryption model. However, the reason for different ciphertext reconstruction effects may be related to the number of participants and learning ability of the neural network, which will be one of our next research works. (2) The same convolution neural network can be used to attack different encryption systems, but the ciphertext reconstruction effect is also diverse, which may be related to the complexity of the encryption mechanism. This will be our other future research works.

(a)

(b)
Compared with traditional known-plaintext attack methods specific to a certain chaotic cryptosystem, our scheme deep learning-based is more flexible and extensible. Moreover, this method can be transferred to other chaotic cryptosystems, even to the field of non-chaotic encryption.
6 Conclusion
In this paper, a known-plaintext attack scheme of chaotic system based on deep learning is proposed, which uses convolution neural networks to train a large number of “plaintext-ciphertext” pairs to learn the conversion process between plaintext and ciphertext. The trained model is regarded as the “decryption formula”. By training different encryption systems with various convolutional neural networks, we obtain excellent decryption results. Overall, the diversity of ciphertext reconstruction effects may be related to the complexity of the encryption system, the number of parameters and learning capabilities of the neural network, the training time. This will be worthy of our further study. In practice, the advantages of this method are as follows: (1) It can completely avoid the recording and transmission of complex ciphertexts; (2) The chaotic cryptanalysis method based on deep learning can be introduced to other chaotic cryptographic systems even to the field of non-chaotic cryptography; (3) In addition, it also proposes a new research direction in the field of multimedia security, i.e., how to prevent cryptography attack means based on deep learning.
7 References
References
- [1] K. Gupta, R. Gupta, R. Agrawal, S. Khan, An ethical approach of block based image encryption using chaotic map, International Journal of Security and Its Applications 9 (9) (2015) 105–122.
- [2] Y. H. Ail, Z. A. Alobaidy, Images encryption using chaos and random generation, Engineering and Technology Journal 34 (1 Part (B) Scientific) (2016) 172–179.
- [3] G. Alvarez, S. Li, Some basic cryptographic requirements for chaos-based cryptosystems, Int. J. Bifurcation Chaos 16 (08) (2006) 2129–2151.
- [4] H. N. Abdullah, H. A. Abdullah, Image encryption using hybrid chaotic map, in: ICCIT, 2017.
- [5] Y. Song, J. Song, J. Qu, A secure image encryption algorithm based on multiple one-dimensional chaotic systems, in: ICCC, 2016.
- [6] N. Elabady, H. Abdalkader, M. Moussa, S. F. Sabbeh, Image encryption based on new one-dimensional chaotic map, in: ICET, 2014.
- [7] Y. Dou, M. Li, Cryptanalysis of a new color image encryption using combination of the 1d chaotic map, Applied Sciences 10 (6) (2020) 2187.
- [8] C. Pak, L. Huang, A new color image encryption using combination of the 1d chaotic map, Signal Process 138 (2017) 129–137.
- [9] M. Li, P. Wang, Y. Liu, H. Fan, Cryptanalysis of a novel bit-level color image encryption using improved 1d chaotic map, IEEE Access 7 (2019) 145798–145806.
- [10] C. Pak, K. An, P. Jang, J. Kim, S. Kim, A novel bit-level color image encryption using improved 1d chaotic map, Multimed. Tools Appl 78 (9) (2019) 12027–12042.
- [11] X. Li, Y. Jiang, M. Chen, F. Li, Research on iris image encryption based on deep learning, EURASIP J. Image Video Process 2018 (1) (2018) 1–10.
- [12] Y. Qin, C. Zhang, R. Liang, M. Chen, Research on face image encryption based on deep learning, in: IOP Conference Series: Earth and Environmental Science, 2019.
- [13] H. Hai, S. Pan, M. Liao, D. Lu, W. He, X. Peng, Cryptanalysis of random-phase-encoding-based optical cryptosystem via deep learning, Opt. Express 27 (15) (2019) 21204–21213.
- [14] L. Gondara, Medical image denoising using convolutional denoising autoencoders, in: ICDMW, 2016.
- [15] C. Li, T. Fan, X. Ma, Z. Zhang, H. Wu, L. Chen, An improved image defogging method based on dark channel prior, in: ICIVC, 2017.
- [16] C. Dong, C. C. Loy, K. He, X. Tang, Image super-resolution using deep convolutional networks, IEEE Trans. Pattern Anal. Mach. Intell 38 (2) (2015) 295–307.
- [17] O. Ronneberger, P. Fischer, T. Brox, U-net: Convolutional networks for biomedical image segmentation, in: International Conference on Medical image computing and computer-assisted intervention, 2015.
- [18] Y. Yu, S. Gao, S. Cheng, Y. Wang, S. Song, F. Yuan, Cbso: a memetic brain storm optimization with chaotic local search, Memet. Comput 10 (4) (2018) 353–367.
- [19] L. Deng, The mnist database of handwritten digit images for machine learning research [best of the web], IEEE Signal Process. Mag 29 (6) (2012) 141–142.
- [20] A. Krizhevsky, G. Hinton, Learning multiple layers of features from tiny images, Handbook of Systemic Autoimmune Diseases 1 (4).
- [21] B. Mondal, T. Mandal, A nobel chaos based secure image encryption algorithm, International Journal of Applied Engineering Research 11 (5) (2016) 3120–3127.