Proceedings of the 43rd Chinese Control Conference
July 28-31, 2024, Kunming, China
Image Encryption Algorithm Based on 2D-Sine-Cosine Chaotic
Mapping and Compression Sensing
Junyi Shen1 , Qianyao Zhou1 , Qinghua Wang1 , Yangchen Gu2
1. Nanjing University of Science and Technology, Nanjing 210094, P. R. China
E-mail: 184430199@qq.com
2. Southeast University, Nanjing 211189, P. R. China
E-mail: 653142594@qq.com
Abstract: This paper introduces an image encryption algorithm based on 2D-Sine-Cosine chaotic mapping and compressed
sensing technology. This algorithm introduces a novel 2D-Sine-Cosine chaotic mapping function. By using nested sine and
cosine functions and selecting appropriate parameters, chaotic oscillators with strong randomness, wide traversal range, and
complex nonlinear behavior trajectories can be generated in phase space. Combined with compressive sensing theory, image
compression and encryption can be achieved. The experimental results show that the encryption algorithm proposed in this paper
has good performance.
Key Words: 2D-Sine-Cosine, Compressed Sensing, Chaotic Systems, Image Encryption
1
Introduction
With the rapid development of digital image processing
and communication technology, the problem of illegal acquisition of image data is becoming increasingly prominent. Traditional encryption algorithms face problems such
as large storage space and weak attack resistance, while image encryption technology based on compressive sensing
and chaotic systems provides a new approach to solve these
problems.
Compressed sensing is a method that utilizes the sparsity
of signals and compresses them with a small amount of non
approximation sampling, which can maintain high reconstruction quality during image restoration [1-3]. Meanwhile,
chaotic systems, as a dynamic system with unpredictability and sensitive dependence on initial conditions, have been
widely applied in the field of information security. The randomness and complexity of chaotic sequences make them
one of the effective encryption methods [4-6].
The image encryption technology based on compressed
sensing chaotic system combines the above two concepts,
uses chaotic mapping to generate encryption keys and compresses sensing encoding of the image. Compared with
traditional encryption algorithms, image encryption technology based on compressed sensing chaotic systems can
reduce storage space occupation and improve the antiinterference ability of images during transmission. Ref.[7]
proposed a novel double image encryption algorithm based
on Rossler hyperchaotic system and compressive sensing,
while Ref.[8] introduced a triple image encryption and hiding algorithm based on chaos, compressive sensing, and 3D
DCT. Sun,Y.,et al.[9] proposed a visual encryption method
for bicolor images based on digital chaos and compressed
sensing. Ref.[10] proposed a multi chaos based compressive
sensing encryption technique and [11-13] proposed the application of compressive sensing encryption under different
chaotic mappings.
This paper proposes a novel image encryption algorithm
that combines chaotic mapping of nested sine and cosine
functions with compressive sensing technology. It not only
effectively protects the security of image data, but also
improves transmission efficiency and reduces transmission
costs. Compared with existing methods, the main contributions of this paper are as follows:
(1) The proposed 2D-Sine-Cosine chaotic map introduces
multiple parameters to regulate system dynamics, making
the encryption system highly sensitive to small changes in
initial conditions and having a high Lyapunov exponent.
(2) Select DCWT for sparse transformation to obtain compressed images, and use CVX algorithm to reconstruct the
final decrypted image. After simulation experiments, it was
found that when the compression ratio is greater than 0.5, the
PSNR value and SSIM value of the reconstructed image of
the algorithm proposed in the article are at least 3% and 5%
higher than those of the algorithm proposed in the article,
indicating that the algorithm proposed in the article exhibits
better image reconstruction ability.
(3) The use of SHA-512 hash function to generate initial
conditions for 2D-Sine-Cosine chaotic maps significantly
improves the randomness and complexity of the initial conditions. After simulation experiments, it was found that
when the compression ratio is greater than 0.5, the difference between the UACI value of the reconstructed image
proposed in the article and the ideal value is only 0.15%, and
the difference between the NPCR value and the ideal value
is only one thousandth.
2
Hyperchaotic Mapping
2.1
Hyperchaotic System
Hyperchaotic mapping is a type of dynamic system with
higher dimensions and more complex structures. The core
of chaotic systems lies in nonlinear mapping, which is provided by sine and cosine functions. This paper takes the
output of the sine function as the input of the cosine function, and adopts a nested approach combined with specific
parameter selection, which can make the system present a
highly chaotic trajectory in phase space. Its definition is as
formula(1):
8020
xn+1 = sin (αyn ) + γ cos (βxn )
yn+1 = μ sin (βxn ) + cos (αyn )
(1)
Authorized licensed use limited to: National Institute of Technology - Jamshedpur. Downloaded on January 17,2025 at 06:48:16 UTC from IEEE Xplore. Restrictions apply.
The system parameters α, β, γ, μ are in the range of
(0, +∞). Different parameter values can lead to different
chaotic characteristics, and suitable parameter combinations
can be selected according to specific needs to obtain the
required encryption strength and randomness. The parameter settings in this article are as follows: (α, β, γ, μ) =
(3.5, 0.7, 0.5, 3.5)
2.2 Trajectory Analysis
The trajectory diagram shows the evolution path of the
chaotic system over time in phase space. By observing the
trajectory map, we can understand the evolution trajectory
and chaotic behavior of the system.
The 2D-Sine-Cosine chaotic map and two classical
chaos algorithms 2D-SLIM(a = 1, b = 2π)[14] and 2DLogistic[15] trajectories (ω = 1.19)are compared and analyzed in Figure 1, using Python. The initial point is
(0.1, 0.2). From the figure, it can be seen that the chaotic sub
trajectories under the 2D-Logistic algorithm are relatively
concentrated, and the range of chaotic sub trajectories under the 2D-Sine-Cosine and 2D-SLIM algorithms is wider.
This indicates that the proposed 2D-Sine-Cosine algorithm
has good randomness and traversal.
2.3 Lyapunov Exponent Analysis
Lyapunov exponent is a quantitative indicator used to describe the stability and sensitivity of chaotic systems. When
there is a positive value in the maximum Lyapunov exponent
of the system, it indicates that the system has a rapid trajectory divergence in phase space. A larger Lyapunov exponent
indicates that the system is more sensitive. The maximum
Lyapunov exponent of the 2D-Sine-Cosine chaotic map, as
well as the two classical chaos algorithms 2D-SLIM and 2DLogistic, is shown in Figure 2. It can be clearly seen from
the figure that the average logarithmic growth rate of the
distance between adjacent trajectories under the 2D-SineCosine chaotic map over time is higher than the other two
algorithms, indicating that the chaotic system under this algorithm has better unpredictability and is more suitable for
image encryption.
3
Compression Sensing
3.1 Compression Sensing Theory
It provides a method for recovering and reconstructing
sparse signals beyond the sampling theorem. The core idea
of compressive sensing is to use the sparsity or low dimensional structure of signals to obtain effective information
through a small amount of random measurements.
Assuming there is an N-dimensional sparse signal x =
RN ,and that is K-dimensional sparse (x has at most K nonzero elements), the compressed sensing model can be expressed as formula(2):
y = Φx = Φs
(2)
Where y is the observed value, Φ is the measurement matrix used to project the high-dimensional signal x onto a lowdimensional space, Ψ is the sparse basis matrix used to transform the original signal into a sparse representation space
and s is the sparsity coefficient. The goal of compressive
sensing is to recover the original signal x by observing the
value y, which can be achieved by solving the following optimization problems:
ŝ = arg min s1 subject to y = ΦΨs
s
(3)
The observed value y is an undersampled signal with a
high number of zero values, therefore the system of equations is an underdetermined system with countless solutions.
So here we choose a norm to determine the sparsest coefficient s.
3.2 Selection of Measurement Matrix
To ensure that the compressed sensing algorithm can accurately reconstruct sparse signals, the measurement matrix
Φ must satisfy the RIP principle (Restricted Isometry Property), that is, if there is a positive number δ (0 < δ < 1),
such that for a sparse signal x with k non-zero coefficients,
it must satisfy:
(1 − δ)x2 ≤ Φx2 ≤ (1 + δ)x2
(4)
The RIP principle is a strong constraint, and this paper
uses an independently identically distributed Gaussian random matrix as the measurement matrix.
3.3
The Selection of Sparse Basis Matrices
This paper uses the Dual Tree Complex Wavelet Transform as the sparse transformation matrix. Compared with
traditional DWT and DCT, DCWT has better capture ability for local wavelet vibrations of signals, especially in the
presence of strong phase features. This makes DCWT perform better in processing non-stationary signals with high
frequency or rapid changes.
3.4 Selection of Reconstruction Algorithms
CVX is a signal reconstruction algorithm based on complex wavelet transform and shrinkage threshold, mainly used
for compressed sensing reconstruction of non-stationary signals. It decomposes the signal into wavelet coefficients
of different scales through complex wavelet transform, applies threshold function to process the coefficients, and finally achieves signal reconstruction through inverse complex
wavelet transform. This shrinkage threshold based method
can suppress noise, compress signals, and retain important
signal features.
4
Encryption and Decryption of Images
4.1
Image Encryption
The process flowchart of image encryption in the text is
shown in Figure 3. The specific steps are as follows:
step1: Perform compression sensing process. The original image is first projected onto a low dimensional space using a random Gaussian matrix, and then subjected to DCWT
sparse transformation to obtain a compressed sensing image.
This process reduces the dimensionality of the original image data and extracts important features of the image.
Step 2: To prevent image data from being tampered with,
an identity verification process is introduced. Using DRPE
(Data Recovery and Parity Embedding) technology, the validation data is embedded into the compressed image to add
an information validation section to ensure the integrity and
reliability of the data.
8021
Authorized licensed use limited to: National Institute of Technology - Jamshedpur. Downloaded on January 17,2025 at 06:48:16 UTC from IEEE Xplore. Restrictions apply.
(a) 2D-Logistic
(c) 2D-Sine-Cosine
(b) 2D-SLIM
Fig. 1: Three types of chaotic algorithm attractor trajectory maps
Fig. 2: Comparison of Maximum Lyapunov Exponents of
Three Chaos Algorithms.
4.2 Image Decryption
The decryption process is roughly opposite to the encryption process: using the same hash function and initial conditions as the encryption process to calculate the initial value of
the 2D-Sine-Cosine chaotic map, and using the chaotic initial conditions to perform reverse chaotic mapping on the encrypted image, restoring the row and column positions. Reverse the 2D-Sine-Cosine chaotic mapping iteration formula
to map the new rows and columns back to their original positions. Perform reverse DRPE operation on the decrypted image to verify the integrity and reliability of the data. Finally,
perform an inverse DCWT operation on the decrypted image and combine it with the CVX reconstruction algorithm
to restore the image to the original signal space.
5
Fig. 3: Block diagram of image encryption process.
Step 3: By applying the SHA-512 hash function to the
original image, a 512 bit hash value K is obtained. Then,
the hash value K is divided into decimal 8-bit blocks, K =
{k1 , k2 , k3 ...., k64 }, and incorporated into the calculation of
the initial conditions of the 2D-Sine-Cosine chaotic map.
x0 = mod(sum(k(1, 1 : 8))/256, 1)
(5)
y0 = mod(sum(k(2, 9 : 64))/256, 1)
Calculate the next state value based on the iterative formula of the 2D-Sine-Cosine chaotic mapping algorithm
(xn+1 , yn+1 ). Assuming the size of the original image is
M x N, where M represents the number of rows and N represents the number of columns. The position of each pixel
can be represented as (i, j), where i represents the row index and j represents the column index. Based on the current
iteration index, use the chaotic mapping results xindex and
yindex to map the pixels at the corresponding positions of the
current plaintext image to new rows and columns to update
the ciphertext image.
Row = mod(floor(x(index) ∗ (M − 1)), M) + 1
(6)
Col = mod(floor(y(index) ∗ ( N − 1)), N) + 1
Step 4: Repeat step 3 until all pixels are processed in a
loop, and output the ciphertext image.
Simulation Results and Performance Analysis
5.1 Simulation Experiment
Our experiments are implemented using Pycharm.2023.
The selected test images are shown in Figure 4, which are
boat (a), baboon(b), and peppers(c) from left to right. The
encrypted image is shown in Figure 5, with boat (a), baboon (b), and peppers (c) from left to right; The decrypted
and reconstructed image is shown in Figure 6 (sampling rate
s=0.875), with boat (a), baboon (b), and peppers(c) from left
to right.
5.2 Reconstructing image quality analysis
Peak Signal to Noise Ratio is an intuitive image quality
metric used to compare the similarity between the original
image and the compressed image. The definition of PSNR is
as formula(7):
P SN R = 10 lg 1
MN
i=1
I2
(7)
2 − R(i, j)2 )
(P
(i,
j)
j=1
M N
Among them, I represents the maximum possible pixel
value, which is taken as 255 in this paper. M and N represent the height and width of the image, respectively. The
position of each pixel can be represented as (i, j).
The larger the PSNR value, the better the reconstruction
effect. We will compare the PSNR values of the algorithm
proposed in this paper with other algorithms. The test image selected for the simulation experiment is “boat”, and the
results are shown in Table 1.
It can be seen that when the sampling rate is 0.25, the algorithm in this paper is close to the algorithm in Ref.[14],
8022
Authorized licensed use limited to: National Institute of Technology - Jamshedpur. Downloaded on January 17,2025 at 06:48:16 UTC from IEEE Xplore. Restrictions apply.
(a) boat
(b) baboon
(c) peppers
(d) boat
(e) baboon
(f) peppers
(g) boat
(h) baboon
(i) peppers
Fig. 4: Display of simulation results. (a),(b),(c)Plain images. (d),(e),(f)Ciphertext images. (g),(h),(i)Reconstructed image at a
sampling rate of 0.875.
Table 1: PSNR of different methods
CR
Ref.[14]
Ref.[16]
Proposed
0.25
0.50
0.75
0.90
26.52
29.23
29.22
35.39
24.49
31.24
38.46
41.06
26.44
32.44
39.63
44.34
while when the compression rate s 0.5, the PSNR value of
the algorithm in this paper is higher than the other two algorithms, which has a significant advantage.
The Structural Similarity Index takes into account the differences in brightness, contrast, and structure, and returns
a value between 0 and 1. The closer the value is to 1, the
higher the structural similarity between the two images. The
specific calculation formula for SSIM is as formula(8):
SSIM =
(2μX μY + C1 ) (2δXY + C2 )
2 + δ2 + C )
(μ2X + μ2Y + C1 ) (δX
2
Y
(8)
Among them, C1 and C2 are constants, where 2.5522 and
7.6522 are taken, respectively. μX and μY represent the average pixel values of the original and reconstructed images,
while δX , deltaY , and δXY represent the standard deviation
and covariance between the pixels of the original and reconstructed images, respectively. The test image selected for the
simulation experiment is ”boat”, and the results are shown
in Table 2. It can be seen that regardless of the compression
ratio range, the algorithm proposed in this paper has a significant advantage in SSIM values compared to the other two
classic algorithms, indicating that under this algorithm, the
structural similarity between the reconstructed image and the
original image is high and the restoration degree is good.
5.3 Correlation analysis of adjacent pixels
Adjacent pixel correlation analysis reveals the spatial
structure and patterns in an image by statistically analyzing
the correlation between pixels. For a ciphertext image, the
8023
Authorized licensed use limited to: National Institute of Technology - Jamshedpur. Downloaded on January 17,2025 at 06:48:16 UTC from IEEE Xplore. Restrictions apply.
Table 3: NPCR and UACI using different methods
Table 2: SSIM of different methods
CR
Ref.[14]
Ref.[16]
Proposed
Index
Ref.[14]
Ref.[16]
Proposed
Expected
0.25
0.50
0.75
0.3455
0.5323
0.6756
0.3213
0.5378
0.6875
0.3846
0.5607
0.7134
NPCP(%)
UACI(%)
99.6098
33.4697
99.6368
33.5787
99.6189
33.5167
99.6094
33.4635
5.5
Anti noise attack analysis
pixel distribution should exhibit a high degree of randomness.
This paper selects plaintext and ciphertext images of
“boat” and analyzes their correlation from three directions:
horizontal, vertical, and diagonal. Figure 5 shows the correlation analysis of adjacent pixels of “boat”.
It can be seen that there is a clear linear relationship between the pixels of (a),(b),(c). while the pixel distribution
in the encrypted image of (d),(e),(f)is chaotic and random.
This indicates that the encryption algorithm has a significant
effect in protecting images.
In the actual transmission process of images, communication channels may be affected by various noise interference
or attacks. When designing encryption algorithms, these potential threats need to be considered to ensure that the algorithm has a certain degree of robustness against noise attacks. We added different amounts of Gaussian noise (noise
parameter ratios g=0.001, 0.01, 0.1) to the test image “boat”
selected for the simulation experiment, and reconstructed the
image as shown in Figure 5.
5.4 Differential attack analysis
The Number of Pixel Change Rate calculates the proportion of different pixels between two ciphertexts to all points
by comparing the values of pixels at the same position in
two images. A higher NPCR indicates that the encryption
algorithm is very sensitive to changes in pixel values, making it difficult to analyze keys and having good resistance to
attacks. The definition of NPCR is as follows:
This paper proposes a 2D-Sine-Cosine hyper chaotic mapping algorithm based on sine and cosine functions. This
chaotic sequence has complex dynamic characteristics. By
combining this hyper chaotic mapping algorithm with compressive sensing technology, efficient encryption and decryption of image data can be achieved.
The main steps of this algorithm include compressive
sensing encoding, identity information verification, chaotic
sequence generation, encryption and decryption processes.
The simulation experiment results show that the algorithm
performs well in protecting image data. It can effectively
resist common attacks such as differential attacks and noise
attacks, and the quality of reconstructed images is high. This
algorithm has advantages in security, embedding capacity,
and image quality, providing a feasible and effective solution for image confidentiality and transmission.
1 |sgn (C1 (i, j) − C2 (i, j))|×100% (9)
M N i=1 j=1
M
N P CR =
N
According to the above calculation formula, the theoretical NPCR value of two random images is (255/256) ×
100% = 99.6094%.
Unified Average Changing Intensity is used to measure
the average brightness difference between an encrypted image and the original image. A higher UACI value indicates
that the encryption algorithm has caused significant changes
in pixel values, indicating good resistance to attacks. The
definition of UACI is as follows:
1 |C1 (i, j) − C2 (i, j)|
×100% (10)
M N i=1 j=1
255 − 0
M
U ACI =
N
According to the above calculation formula, the
theoretical
NPCR value of two random images
is 2 × 255×1+255×2+...1×255
× 100% = 33.4635%.
65536
In the formulas, C1 and C2 represent two ciphertext images, while M and N represent the height and width of the
images. The position of each pixel can be represented as
(i, j), where i represents the row index and j represents the
column index.
Randomly select a pixel to be modified to simulate differential attacksThe NPCR and UACI values obtained under different methods are shown in Table 3. It can be seen
from the table that the NPCR and UACI values under the
three encryption methods are very close to the ideal values.
This indicates that the encryption scheme proposed in the
text can effectively propagate the small differences in plaintext images throughout the entire ciphertext, and has good
resistance to differential attacks.
6
Conclusion
References
[1] L. Wang, K. Lu and P. Liu, “Compressed Sensing of a Remote
Sensing Image Based on the Priors of the Reference Image,”
IEEE Geosci. Remote. Sens. Lett., vol. 12, no. 4, pp. 736-740,
2015.
[2] S. Wang ,et al. “Physically Transient Threshold Switching Devices for Image Compression and Encryption Computing,”
IEEE Electron. Device Lett., vol. 44, no. 9, pp. 1575-1578,
2023.
[3] P. Mathur, A. Yadav, V. K. Verma and R. Purohit, “Paradigms
of Image Compression and Encryption: A Review,” in “2019
2nd International Conference on Intelligent Communication
and Computational Techniques (ICCT),” Jaipur, pp. 313-317,
2019.
[4] W. Feng, Y. He, H. Li and C. Li, “A Plain-Image-Related
Chaotic Image Encryption Algorithm Based on DNA Sequence
Operation and Discrete Logarithm,”IEEE Access, vol. 7, pp.
181589-181609, 2019.
[5] M. Gabr, Y. Korayem, Y. -L. Chen, P. L. Yee, C. S. Ku and W.
Alexan,“R3—Rescale, Rotate, and Randomize: A Novel Image Cryptosystem Utilizing Chaotic and Hyper-Chaotic Systems,” IEEE Access, vol. 11, pp. 119284-119312, 2023.
[6] X. Wang and P. Liu,“A New Image Encryption Scheme Based
on a Novel One-Dimensional Chaotic System,” IEEE Access,
vol. 8, pp. 174463-174479, 2020.
[7] W. Huang, D. Jiang, Y. An, L. Liu and X. Wang, “A Novel
Double-Image Encryption Algorithm Based on Rossler Hyper-
8024
Authorized licensed use limited to: National Institute of Technology - Jamshedpur. Downloaded on January 17,2025 at 06:48:16 UTC from IEEE Xplore. Restrictions apply.
(a) Horizontal correlation
(b) Vertical correlation
(c) Diagonal correlation
(d) Horizontal correlation
(e) Vertical correlation
(f) Diagonal correlation
Fig. 5: Correlation analysis of adjacent pixels. (a),(b),(c)Analysis of correlation between adjacent pixels in plain images.
(d),(e),(f)Analysis of correlation between adjacent pixels in plain images.
(a) Reconstructed image at g=0.001
(b) Reconstructed image at g=0.01
(c) Reconstructed image at g=0.1
Fig. 6: Reconstructed images under different noise parameter ratios
chaotic System and Compressive Sensing,” IEEE Access, vol.
9, pp. 41704-41716, 2021,
[8] Xingyuan, W. , Cheng, L. , et al. “A novel triple-image encryption and hiding algorithm based on chaos, compressive sensing
and 3d dct”. Inf. Sci., vol. 574, no. 1, 2021.
[9] Sun, Y., Cao, L., et al.“Double Color Image Visual Encryption Based on Digital Chaos and Compressed Sensing.” Int. J.
Bifurcat. Chaos, vol. 33, no. 4, pp. 2350044, 2023.
[10] Ahmad, J., Tahir, A., et al.“ A novel multi-chaos based compressive sensing encryption technique”. in International Conference on Advances in the Emerging Computing Technologies
(AECT), pp. 1-4, 2020.
[11] Feng, X. F., Nan, S. X., et al.“ A Lossless Compression and
Encryption Method for Remote Sensing Image Using LWT,
Rubik’s Cube and 2D-CCM.” International Journal of Bifurcation and Chaos, vol. 32, no. 10, pp. 2250149, 2022.
[12] Liu, L., Jiang, D., et al.“ 2D Logistic-Adjusted-Chebyshev
map for visual color image encryption.” J. INF. SECUR. APPL,
vol. 60, pp. 102854, 2021.
[13] Zhang, B., Rahmatullah, B., et al.“A plain-image correlative
semi-selective medical image encryption algorithm using enhanced 2D-logistic map.” Multimedia Tools and Applications,
vol. 82, no. 10, pp. 15735-15762, 2023.
[14] Wu Y, Yang G, Jin H, Noonan JP.“ Image encryption using
the two-dimensional logistic chaotic map.” Optics and Lasers
in Engineering., vol. 21, no. 1, pp. 013014 , 2012.
[15] Xu, Q., Sun, K., Cao, C., et al.“ A fast image encryption algorithm based on compressive sensing and hyperchaotic map.”
Opt. Lasers Eng., vol. 121, pp. 203-214 , 2019.
[16] Zhou, K., Fan, J., Fan, H., et al.“ Secure image encryption
scheme using double random-phase encoding and compressed
sensing.” Opt. Laser Technol., vol. 121, pp. 105769, 2020.
8025
Authorized licensed use limited to: National Institute of Technology - Jamshedpur. Downloaded on January 17,2025 at 06:48:16 UTC from IEEE Xplore. Restrictions apply.
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )