Using GAN-Based Encryption To Secure Digital Images With Reconstruction Through Customized Super Resolution Network
Using GAN-Based Encryption To Secure Digital Images With Reconstruction Through Customized Super Resolution Network
This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/TCE.2023.3285626
Abstract—Unlike traditional encryption methods, Generative to security, fast transmission over a wide range of domains and
Adversarial Network (GAN)-based methods possess a high level low storage requirements are required. Particularly, a challenge
of security for digital images. Many existing simple encryption problem is encountered: how to save memory and computation
methods may be less secure than expected and have high storage
costs. This paper proposes a GAN-based encryption method to for limited memory consumer electronic devices [4]. Com-
secure digital images, solving these problems. First, a random pression is essential to achieve efficient image storage and
sequence generator using a GAN with cross-coupled logistics transmission. Therefore, researchers studied a method com-
and a Henon map is generated to encrypt an image. Next, the bining encryption simultaneously with compression, called the
encrypted image is downsampled into one-fourth of the original encryption-then-compression scheme. Fig. 1 shows the frame-
size and sent to the receiver. Finally, image reconstruction uses
a Customized Super Resolution Network (CSRNet) rather than work of the encryption-then-compression process. Recently,
decompressing the image at the receiver side. Our extensive
experimental results demonstrate that the proposed method
achieves NPCR, UACI, entropy, PSNR and SSIM up to 0.99604,
0.33460, 7.9993, 37.0462 dB and 0.94561, respectively. Further,
our encryption method achieves up to 75% faster than the recent
methods when evaluated on two standard datasets. Therefore, the
proposed GAN-Based solution can possess a high level of security
and save sufficient storage space for any practical application.
Index Terms—Consumer electronics, Generative adversarial
networks, Images, encryption, down sampling, Security, Attacks.
I. I NTRODUCTION
Fig. 1: An Encryption Then Compression Security Model
B ENEFITING from the advancement of information tech-
nologies and cyber-physical systems communications,
multimedia, especially images, have become more frequent. many researchers have adopted chaotic-based encryption [1],
At present, various multimedia information, consisting of [5]–[9] and deep learning-based encryption [10]–[12] methods
digital images, audio and videos, appears and has been eas- that possess a high level of security for digital images [10].
ily exchanged via consumer electronics (CE) devices [1]. For example, Singh et al. suggested a secure encryption-then-
However, the secure transmission of these data has attracted compression scheme [1]. First, a new 3D chaotic map is
increasing attention in areas such as online diagnosis and introduced for encrypting the color images. The size of the
education, research and development, and remote sensing data encrypted image is reduced by downsampling. After this, a
transmission [2]. Further, data privacy issues have a growing decryption process is performed on a compressed image. Last,
impact on many electronic industries [1]. It has brought great a lossy compression method based on a customized residual
convenience to consumer’s work and life. Therefore, how to dense spatial network is used for plain image reconstruction.
convey useful media information safely via these devices over Experimental results indicate the scheme is secure against
the network have become a hot topic and a major task for most cryptographic attacks. However, its performance against
information security. Encryption is an effective technique for noise attacks needs to be investigated. Zhang and Gong
this objective. It secures digital images by transforming them proposed an encryption scheme to secure color images [5].
into cipher images using a public or private key [3]. In addition First, a pseudo-random sequence generator is designed based
on the Hassell model and the LZW-1 map. Second, the pixels
Monu Singh and Amit Kumar Singh (Corresponding Author) are with of a plain image are scrambled using a three-dimensional (3D)
the Department of Computer Science and Engineering, National Institute
of Technology Patna, Bihar, India. (e-mail: monus.phd20.cs@nitp.ac.in; and zigzag transformation. Last, the diffusion process uses the
amit.singh@nitp.ac.in) generated key on different view planes of the scrambled image.
Naman Baranwal and Kedar Nath Singh are with the Department of This work has good security features with low encryption
Computer Science and Engineering, Noida Institute of Engineering and
Technology, Greater Noida, India. (e-mail: namanbaranwal2002@gmail.com; costs. However, its performance needs to be examined further
and knsinghait@gmail.com) for other cryptographic attacks. In [6], authors have suggested
Authorized licensed use limited to: Motilal Nehru National Institute of Technology. Downloaded on September 09,2023 at 06:31:13 UTC from IEEE Xplore. Restrictions apply.
© 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information.
This article has been accepted for publication in IEEE Transactions on Consumer Electronics. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/TCE.2023.3285626
a cryptosystem based on a 3D variable structure chaotic networks are used to rebuild the cipher-compressed image. The
system. Adjacent pixels of the original image are confused results show that compression is effective, but further security
by the suggested permutation method based on Rubik’s Cube. analyses must be performed.
Iterative diffusion is applied to confused images. Two rounds Inspired by the idea of chaotic and deep learning-based en-
of confusion and diffusion process are performed on an image cryption, this paper proposes a GAN-based encryption method
to raise security. Experimental results reveal that the suggested to secure digital images. First, we present a pseudo-random
scheme is fast. However, its security needs to be explored number generator strategy using a GAN, coupled logistics
further. Qiang et al.’s [7] strategy suggested a new chaotic and a Henon map to generate a secure key for the encryption
map called the two-dimensional Salomon Map. Based on the procedure. It was established that multiple chaos-based image
chaotic sequences, pixels with low and high bits are exchanged encryption schemes provide greater security [13]. Then, the
selectively and then dispersed into random positions. Three encrypted image is downsampled into one-fourth of the origi-
rounds of confusion and diffusion result in an encrypted image nal size and sent to the receiver. Finally, a customized super-
that no longer contains any usable information. Compared to resolution network (CSRNet) was designed to reconstruct the
other schemes, it performs well in terms of security, but its original image from the downsampled image. Experimental
time complexity can be improved. In [8], authors developed a results prove that the proposed method outperforms some new
secure encryption scheme for digital images. A spatiotemporal encryption methods.
chaotic system was designed with nonlinear perturbations to The rest of this paper is structured as follows. Section II
enhance the security of the encryption scheme. In this work, details the proposed approach, Section III summarizes the
diffusion is applied before confusion procedure. Following one experimental outcomes, and Section IV concludes.
round of diffusion, the image is confused by splitting the bit
plane, and it is then again encrypted via mutual diffusion of
high and low bit planes. The simulation results demonstrate II. M ETHODOLOGY
that the scheme has good security features, but its performance
The complete proposed methodology is shown in Fig. 2.
can be further optimized in complexity. Another chaos-based
We present a GAN-based pseudo random number generator
cryptosystem for color images was developed by Xiuhui et al.
strategy using chaotic maps at first, and then confusion and
[9]. The sequences are generated based on plain images and
diffusion strategy using the generated secure key. In addition,
the Lorenz-Haken laser chaotic system, and the plain image is
we introduce the downsample strategy, and the reconstruction
pre-processed using a lifting scheme. Confusion and diffusion
network of the image.
operations are then performed on the pre-processed image to
produce the cipher image. This scheme can resist brute force,
cropping, and noise attacks but takes longer than the other
A. Key generation
existing schemes.
Deep learning models can learn (like human beings) and The creation of random keys is crucial in cryptosystems.
mimic the given data distribution. Therefore, they are ex- Because of the high randomness, sensitivity to the initial
tensively used in super-resolution, deblurring, denoising, and condition, and non-linearity behaviour of chaotic systems,
private key generation-related tasks. For instance, Chai et al. the chaotic random number generator has been frequently
[10] suggested an image encryption scheme based on com- employed in cryptosystems [6]. However, chaotic systems, par-
pression sensing, GAN, and a chaotic system. Compression is ticularly those in high dimensions, are complex, less efficient,
performed using a compress sensing-based image restoration and have a lengthy iteration period. This result contradicts
model, and a convolutional neural network-based denoising the good pseudo-random generator properties [14]. Another
network reduces noise. The suggested work demonstrates sat- drawback of chaotic systems is that we can produce the
isfactory security performance and good reconstruction ability. same sequence if we know the initial parameters. Therefore,
However, the reconstructed images’ peak signal-to-noise ratio to address these issues, a learning pseudo-random number
(PSNR) can be improved. Yi Liu et al. [11] have proposed a generator is designed based on the GAN model, Henon map,
color image encryption scheme using a deep learning model. and coupled logistic map, enhancing security in this method. It
A bidirectional long short-term memory network was trained improves the practicality of the proposed method in numerous
on Chen’s chaotic sequences to predict random sequences. applications. Initially, two different chaotic sequences gener-
Then these sequences are embedded in the plain image after ated using the Henon map (H) and coupled logistic map (CL)
dividing it into red, green, and blue (RGB) channels using a are considered training sets. These sets train the GAN model
block embedding method. After applying the confusion and to generate random sequences. The process of key generation
diffusion process to the embedded image, the resultant image is shown in algorithm 1.
is a cipher image. This scheme can resist statistical and brute- The National Institute of Standards and Technology (NIST)
force attacks but cannot endure differential attacks. Another test suite [15] measures the randomness of a generated se-
disadvantage is that it works only with images of equal height quence. The randomness results are reported in TABLE I,
and width. In [12], authors created a color image encryption- where the sequences are highly random which is desirable.
then-compression technique. The color images are encrypted Compared to other methods [16]–[18] in TABLE II, this
using modulo addition 256 and then compressed using the method performs better in terms of spectral entropy and
downsampling method. Decryption and residual dense spatial approximation entropy [19].
Authorized licensed use limited to: Motilal Nehru National Institute of Technology. Downloaded on September 09,2023 at 06:31:13 UTC from IEEE Xplore. Restrictions apply.
© 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information.
This article has been accepted for publication in IEEE Transactions on Consumer Electronics. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/TCE.2023.3285626
Authorized licensed use limited to: Motilal Nehru National Institute of Technology. Downloaded on September 09,2023 at 06:31:13 UTC from IEEE Xplore. Restrictions apply.
© 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information.
This article has been accepted for publication in IEEE Transactions on Consumer Electronics. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/TCE.2023.3285626
Authorized licensed use limited to: Motilal Nehru National Institute of Technology. Downloaded on September 09,2023 at 06:31:13 UTC from IEEE Xplore. Restrictions apply.
© 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information.
This article has been accepted for publication in IEEE Transactions on Consumer Electronics. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/TCE.2023.3285626
With GAN, this task is more straightforward than with the TABLE III: Architectural comparison of super resolution
algorithmic approach. This method uses CSRNet to reconstruct networks
the original image from a downsampled image. The CSRNet Features SRResNet [20] EDSR [21] MDSR [21] CSRNet
Parameters 2.04M 43M 8.02M 2.7M
comprises three parallel series of six residual blocks chained Batch Normalization Yes No No No
together, reconstructing the image’s features. An upscaling Residual Blocks 16 32 80 36
Loss MSE/VGG22/VGG54 MSE MSE ResNet152
layer is added to the network, which upscales the image to Filters 64 256 64 64
twice its size. This upscale layer is then passed through three
parallel chains of six residual blocks connected by a single
A. Experimental setup
convolution layer with three filters and a sigmoid activation
layer. The proposed framework of CSRNet is given in Fig. 4. Experiments are conducted on the Kodak 24 [22] and T91
Content loss and adversarial loss are used for training the datasets [22]. The CSRNet trained on a Tesla P100 graphics
model. Accordingly, the content loss is formulated as: processing unit with 1000 epochs, where a random sample
of 1000 images is considered from the COCO2017 dataset
SR 1 [23]. Low-resolution images are obtained by downsampling
lcontent = (ω(I HR ) − ω(G(I LR ))2 (6)
W ×H the images with a factor of 2. For optimisation, we use the
Adam optimiser with β1 = 0.9, β2 = 0.999, and ϵ=1e-8 with
where ω is feature maps obtained by last convolutional layer
a learning rate of 0.5e-4. The generator and discriminator net-
of ResNet152V2 network [20], G is generator output for I LR ,
work contains 2,701,763 and 5,779,585 trainable parameters,
W and H are width and height of the feature map and lastly
respectively.
I LR and I HR are low-resolution and high-resolution of images
from dataset respectively. Adversarial loss is formulated as
B. Results
N
SR
X Five different analyses are used to measure the perfor-
ladv = −log10 D(G(I LR )) (7) mance of our encryption method: key analysis, statistical
n=1
and differential attack analysis, key space, correlation, and
Where D and G are discriminator and generator for the entropy analysis. Three metrics are leveraged to measure the
proposed CSRNet model. The combination of these two losses performance of the reconstruction network: PSNR, structural
is called Perceptual Loss which is given as – similarity index (SSIM), and compression ratio (CR). The
time cost for the encryption and decryption process is also
lSR = lcontent
SR
+ 10−3 ladv
SR
(8) evaluated.
1) Key Analysis : The key space should not be less than
The proposed CSRNet architecture has been compared to 2100 to resist brute force attack [24]. Our method uses a 256-
other super-resolution networks [20] and [21]. The proposed bit random external key that comprises 2256 permutations. A
network has fewer parameters but still provides good visual key sensitivity test is also performed to check the sensitivity
quality and perception results in less time. TABLE III provides of the encryption key. Two keys are considered with a slightly
the architectural comparison with other networks. changed bit, and then the image is encrypted. The second
key cannot decrypt the image encrypted by the first key. We
noticed that the difference between these two encrypted images
III. E XPERIMENTS
is 99.71%. Therefore, the proposed scheme can efficiently
This part will analyze our method’s performance in security, withstand brute force attacks and is highly sensitive to en-
visual quality, compression ratio, and time complexity. cryption keys.
Authorized licensed use limited to: Motilal Nehru National Institute of Technology. Downloaded on September 09,2023 at 06:31:13 UTC from IEEE Xplore. Restrictions apply.
© 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information.
This article has been accepted for publication in IEEE Transactions on Consumer Electronics. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/TCE.2023.3285626
2) Statistical analysis : The statistical analysis is given in correlations are concentrated on the diagonal axis, which
terms of the histogram and chi-square test. The histogram means high correlations between adjacent pixels, whereas the
displays the pixel distribution of an image [25]. An encrypted encrypted correlation spread on the whole span means low
image histogram should be flat so that an attacker cannot guess correlations. This analysis indicates that the proposed scheme
any information. To measure the performance of the proposed is secure against statistical attacks.
method against statistical attacks, a histogram of the plain
image and encrypted image was plotted for each RGB channel,
as illustrated in Fig. 5. It is noteworthy that the histograms
differ from each other. Also, the encrypted image’s histogram
is uniform. The chi-square test (χ2 ) [26] was also performed
to check the uniformity of the encrypted image histogram. It
is calculated as:
255
X (Of − Ef )2
χ2 = (9)
i=0
Ef
Where Of = Observed frequency of grey levels, Ef = Expected
frequency of each grey level. The ideal test result for a signif-
icant level of 0.05 should be less than 293.2478. TABLE IV Fig. 6: (a), (b), (c), (d): Original image, correlation of
indicates the average chi-square test scores of cipher images. channels in horizontal, vertical and diagonal (e), (f), (g), (h):
All the values are lesser than the optimal score, proving that Encrypted image, correlation of channels in horizontal,
the cipher image histogram is uniform. vertical and diagonal.
Authorized licensed use limited to: Motilal Nehru National Institute of Technology. Downloaded on September 09,2023 at 06:31:13 UTC from IEEE Xplore. Restrictions apply.
© 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information.
This article has been accepted for publication in IEEE Transactions on Consumer Electronics. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/TCE.2023.3285626
TABLE V: Security and time cost comparison of our method and five existing methods
Scheme Size NPCR UACI Correlation Entropy Enc/Dec
(H/V/D) (sec)
[1] 256×256×3 99.60948 33.45977 -0.00106/0.008263/0.00548 7.99935 0.134442/0.134442
[6] 512×512×3 99.6099 33.5061 0.0003/0.0008/0.0007 7.9973 0.922003/0.841457
[7] 512×512×3 99.6093 33.4798 0.0021 /0.0012/0.0017 7.9975 0.2399/-
[8] 512×512×3 99.6082 33.444 0.013/0.0141/-0.0258 7.9975 1.384/1.628
[9] 256×256×3 99.63333 33.47333 0.0005/0.001667/-0.0033 7.9971 1.7715/1.5159
Proposed 512×512×3 99.602 33.462 -0.0018/-0.0018/0.0048 7.999307 0.4326/0.4326
Authorized licensed use limited to: Motilal Nehru National Institute of Technology. Downloaded on September 09,2023 at 06:31:13 UTC from IEEE Xplore. Restrictions apply.
© 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information.
This article has been accepted for publication in IEEE Transactions on Consumer Electronics. This is the author's version which has not been fully edited and
content may change prior to final publication. Citation information: DOI 10.1109/TCE.2023.3285626
[4] S. Rani, D. Gupta, S. Garg, M. J. Piran, and M. S. Hossain, “Con- [27] M. Singh and A. K. Singh, “A comprehensive survey on encryption
sumer electronic devices: evolution and edge security solutions,” IEEE techniques for digital images,” Multimedia Tools and Applications, pp.
Consumer Electronics Magazine, vol. 11, no. 2, pp. 15–20, 2021. 1–33, 2022.
[5] X. Zhang and Z. Gong, “Color image encryption algorithm based [28] K. N. Singh and A. K. Singh, “Towards integrating image encryption
on 3d zigzag transformation and view planes,” Multimedia Tools and with compression: a survey,” ACM Transactions on Multimedia Com-
Applications, vol. 81, no. 22, pp. 31 753–31 785, 2022. puting, Communications, and Applications (TOMM), vol. 18, no. 3, pp.
[6] J. Xin, H. Hu, and J. Zheng, “3d variable-structure chaotic system and 1–21, 2022.
its application in color image encryption with new rubik’s cube-like
permutation,” Nonlinear Dynamics, pp. 1–24, 2023.
[7] Q. Lai, G. Hu, U. Erkan, and A. Toktas, “A novel pixel-split image
encryption scheme based on 2d salomon map,” Expert Systems with
Applications, vol. 213, p. 118845, 2023.
[8] X. Wang, M. Zhao, S. Feng, and X. Chen, “An image encryption scheme
using bit-plane cross-diffusion and spatiotemporal chaos system with
nonlinear perturbation,” Soft Computing, pp. 1–18, 2023.
[9] X. Chen, M. Gong, Z. Gan, Y. Lu, X. Chai, and X. He, “Cie-lscp:
color image encryption scheme based on the lifting scheme and cross-
component permutation,” Complex & Intelligent Systems, pp. 1–24,
2022.
[10] X. Chai, Y. Tian, Z. Gan, Y. Lu, X.-J. Wu, and G. Long, “A robust
compressed sensing image encryption algorithm based on gan and cnn,”
Journal of Modern Optics, vol. 69, no. 2, pp. 103–120, 2022.
[11] Y. Liu, G. Cen, B. Xu, X. Wang et al., “Color image encryption based
on deep learning and block embedding,” Security and Communication
Networks, vol. 2022, 2022.
[12] C. Wang, T. Zhang, H. Chen, Q. Huang, J. Ni, and X. Zhang, “A
novel encryption-then-lossy-compression scheme of color images using
customized residual dense spatial network,” IEEE Transactions on
Multimedia, 2022.
[13] M. T. Elkandoz and W. Alexan, “Image encryption based on a combi-
nation of multiple chaotic maps,” Multimedia Tools and Applications,
vol. 81, no. 18, pp. 25 497–25 518, 2022.
[14] Z. Man, J. Li, X. Di, X. Liu, J. Zhou, J. Wang, and X. Zhang, “A novel
image encryption algorithm based on least squares generative adversarial
network random number generator,” Multimedia Tools and Applications,
vol. 80, pp. 27 445–27 469, 2021.
[15] K. N. Singh, O. P. Singh, A. K. Singh, and A. K. Agrawal, “Eimol:
A secure medical image encryption algorithm based on optimization
and the lorenz system,” ACM Transactions on Multimidia Computing
Communications and Applications, 2022.
[16] Q. Lu, C. Zhu, and G. Wang, “A novel s-box design algorithm based
on a new compound chaotic system,” Entropy, vol. 21, no. 10, p. 1004,
2019.
[17] B. Yosefnezhad Irani, P. Ayubi, F. Amani Jabalkandi, M. Yousefi Valan-
dar, and M. Jafari Barani, “Digital image scrambling based on a new
one-dimensional coupled sine map,” Nonlinear Dynamics, vol. 97, no. 4,
pp. 2693–2721, 2019.
[18] P. Fang, H. Liu, C. Wu, and M. Liu, “A secure chaotic block image
encryption algorithm using generative adversarial networks and dna
sequence coding,” Mathematical Problems in Engineering, vol. 2021,
pp. 1–26, 2021.
[19] L. Gong, R. Wu, and N. Zhou, “A new 4d chaotic system with coexisting
hidden chaotic attractors,” International Journal of Bifurcation and
Chaos, vol. 30, no. 10, p. 2050142, 2020.
[20] C. Ledig, L. Theis, F. Huszár, J. Caballero, A. Cunningham, A. Acosta,
A. Aitken, A. Tejani, J. Totz, Z. Wang et al., “Photo-realistic single
image super-resolution using a generative adversarial network,” in
Proceedings of the IEEE conference on computer vision and pattern
recognition, 2017, pp. 4681–4690.
[21] B. Lim, S. Son, H. Kim, S. Nah, and K. Mu Lee, “Enhanced deep
residual networks for single image super-resolution,” in Proceedings
of the IEEE conference on computer vision and pattern recognition
workshops, 2017, pp. 136–144.
[22] “[Online],” Available: https://www.kaggle.com/datasets/jesucristo/
super-resolution-benchmarks.
[23] “[Online],” Available: https://www.kaggle.com/datasets/awsaf49/
coco-2017-dataset.
[24] G. Alvarez and S. Li, “Some basic cryptographic requirements for chaos-
based cryptosystems,” International journal of bifurcation and chaos,
vol. 16, no. 08, pp. 2129–2151, 2006.
[25] S. T. Kamal, K. M. Hosny, T. M. Elgindy, M. M. Darwish, and M. M.
Fouda, “A new image encryption algorithm for grey and color medical
images,” IEEE Access, vol. 9, pp. 37 855–37 865, 2021.
[26] A. Banu S and R. Amirtharajan, “A robust medical image encryption in
dual domain: chaos-dna-iwt combined approach,” Medical & biological
engineering & computing, vol. 58, pp. 1445–1458, 2020.
Authorized licensed use limited to: Motilal Nehru National Institute of Technology. Downloaded on September 09,2023 at 06:31:13 UTC from IEEE Xplore. Restrictions apply.
© 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information.