Fast Image Encryption Algorithm for Logistics-Sine-Cosine Mapping

Because images are vulnerable to external attacks in the process of network transmission and traditional image encryption algorithms have limitations such as long encryption time, insufficient entropy or poor diffusion of cipher image information when encrypting color images, a fast image encryption algorithm based on logistics-sine-cosine mapping is proposed. The algorithm first generates five sets of encrypted sequences from the logistics-sine-cosine mapping, then uses the order of the encryption sequence to scramble the image pixels and designs a new pixel diffusion network to further improve the key sensitivity and plain-image sensitivity of the encryption algorithm. Finally, in a series of security analysis experiments, the experimental image Lena was tested 100 times, and the average encryption time was 0.479 s. The average value of the information entropy, pixel change rate and uniform average change intensity of the cipher image reached 7.9994, 99.62% and 33.48%, respectively. The experimental results show that the fast image encryption algorithm based on logistics-sine-cosine mapping takes less time to encrypt, and the cipher image has good information entropy and diffusivity. It is a safe and effective fast image encryption algorithm.


Introduction
Traditional image encryption, such as IDEA, AES, DES and 3-DES [1], is mainly aimed at data stream encryption, which is not only inefficient and computationally expensive, but these limitations become more and more obvious when encrypting color images. Existing image encryption is roughly divided into spatial domain-based pixel scrambling, chaotic system-based, transformation-domain-based, secret segmentation and secret sharing, neural network and cellular automata-based image encryption.
An image encryption algorithm based on spatial-domain pixel scrambling refers to the use of a specific algorithm to change the position of 3-channel pixels in an image without changing the RGB value of the pixel. As a result, such algorithms are generally less secure, but also relatively low in computational complexity.
An image encryption method based on chaos [2][3][4][5][6] uses the self-similarity of chaos to generate a random sequence as a factor sequence of encryption. The key space is large, the encryption speed is fast, but its limitations are also obvious: there is a trivial key. At present, only high-dimensional chaos or super chaos sacrifice speed can break this limitation.
The image encryption algorithm based on the transformation domain transforms the image from the airspace domain to the frequency domain encryption and then transforms it into the airspace, but because of the limitation of computer accuracy, part of the data accuracy will be lost during the encryption process, which is lossy encryption.
Based on secret segmentation and secret sharing image encryption, the image is encrypted into m cipher images and a threshold k (m ≥ k) is set; only by obtaining n (n ≥ k) different cipher images can the plain image be restored, and its advantage is that even if part of the data is lost, the plain image can still be restored, but the data redundancy is relatively large.

Motivations and Contributions
Because images are vulnerable to external attacks in the process of network transmission and traditional image encryption algorithms have limitations such as long encryption time, insufficient entropy or poor diffusion of cipher image information when encrypting color images, a fast image encryption algorithm based on logistics-sine-cosine mapping is proposed that generates encryption sequences with high efficiency based on logisticssine-cosine mapping and designs an efficient pixel scrambling method and three-round pixel diffusion based on the encryption sequence, which has high encryption efficiency, sufficient information entropy and good diffusion of cipher images.

Related Work
In terms of the research status of color image encryption: Liu et al. [7] proposed a color image hyperchaotic encryption algorithm using DNA dynamic coding and adaptive arrangement and designed a new four-dimensional hyperchaotic system and plain-imagerelated adaptive permutation method, which makes the operation result more unpredictable and improves the sensitivity of the algorithm to plain images and keys. Zou et al. [8] used DNA coding and sequencing to construct short DNA strands and long DNA strands, in which short DNA strands were used for DNA strand exchange and long DNA strands were used for DNA strand diffusion, and the experimental results verified that the proposed algorithm has high safety and excellent efficiency. Samiullah et al. [9] propose a new symmetric block cipher scheme. It uses DNA-based dynamic S-boxes and hyperchaotic systems connected with MD5 to generate obfuscation and diffusion to encrypt color images, greatly improving the computational efficiency of encryption algorithms. Liu et al. [10] proposed a hyperchaotic image encryption algorithm based on plain image information and DNA calculation, which enhanced the relationship between pixel position, grayscale value and plain image, which not only showed excellent encryption performance, but also resisted various typical attacks. Liang et al. [11] introduced DNA strand displacement and a four-dimensional multi-stable superchaotic system, which increased the connection between the original image and the key so that the encryption algorithm has good resistance to exhaustive attacks, statistical attacks and known original image attacks on RGB color images. Chu et al. [12] proposed a three-dimensional image encryption method based on the memristor chaotic system and RNA cross-mutation. During the entire encryption process, the Arnold matrix, RNA encoding and decoding rules, and crossover and mutation algorithms are determined by the memristor chaotic system, which can encrypt 3D images at the same time and effectively resist various attacks. Lu et al. [13] proposed an adaptive compression encryption method for content based on CS and ribonucleic acid (RNA). Chaotic sequences driven by pure image hashes are utilized throughout the encryption process, enhancing the correlation between the algorithm and the pure image, improving resistance to known and selected plain image attacks. Ghorbani et al. [14] proposed a safe and effective encryption scheme based on ribonucleic acid (RNA) and 2D He and non-maps, which improved the advantages of the most advanced algorithm. Sha et al. [15] proposed an image cryptographic system based on the genetic center law (GCD), Gartner-Moria-Pratt (KMP) algorithm and chaotic system, which realizes DNA-level bidirectional pixel shuffling through shared stack push operation to accelerate the shuffling of overall pixels and replaces pixel values by simulating the protein synthesis process in GCD, with satisfactory low time complexity and excellent safety effects. Zhang et al. [16] defined the 3D bit plane based on the genetic center method, converted k raw images into 8-bit binary and converted to 3D matrix, arranged the 3D matrix by rotating the bit plane and arranged between the bit planes, encoded the scrambled 3D matrix into DNA code and obtained encrypted images through RNA decoding operations, which has strong security and ideal performance. Hasimoto-Beltran et al. [17] propose a new integer chaos-based coupling mapping lattice CML, and encrypt images based on random bit flipping of bitstreams that are not exposed to the attacker's dynamic reference point (DRP) and random selection of the CML byte trajectories of DRP and bit flipping processes, which has good security and scalability. Li et al. [18] studied an optical image encryption scheme based on fractional Fourier transform and a five-dimensional host-induced nonlinear fractional-order laser ultra-chaotic system and implemented the system by analyzing the dynamic characteristics of the proposed fractional-order laser super chaotic system and using the DSP platform. An image encryption scheme combining BP neural network, GF(17) domain diffusion and hyperchaotic random point scrambling algorithm is proposed, which provides new research prospects for optical image encryption. Kumar et al. [19] proposed image encryption of light carrying optical vortex arrays to minimize the quality degradation during actual implementation, providing an effective method for designing optical cryptographic systems. Chen et al. [20] proposed an exciting optical image encryption method based on spatial nonlinear optics, which realized the high degree of freedom to explore and apply light and provided new research prospects for the development of optical encryption for the protection of information in various optical structures and optical materials. Cheremkhin et al. [21] proposed the optical implementation of an information optical encryption system using a new multi-level customizable digital data container with high data density, which has efficient error correction ability. Kumar et al. [22] propose two-dimensional XORor-logic manipulation of beams carrying optical vortex arrays, which brings new possibilities for high-dimensional data processing, cryptography, and computing. Chen et al. [23] propose an RG-based VSS scheme that encodes multiple secret images at once, which has no pixel expansion and higher secret sharing ability than traditional VC-based VSS. Chen et al. [24] proposed a new RG-based VSS scheme, which not only improves the capacity of secret communication, but also avoids the problem of pixel expansion, thereby significantly reducing the overhead of storage and communication. De et al. [25] improved several schemes and provided many upper limits for the random grid model by exploiting (many) known outcomes in the deterministic model and provided new schemes for the deterministic model by utilizing some of the known outcomes of the random grid model. Lin et al. [26] propose a random grid-chain-based encryption scheme suitable for processing batch binary, grayscale, and color images, and its decryption process is done by the human vision system, which requires neither additional pixel expansion nor any coding base matrix. Shyu et al. [27] devised an innovative algorithm for visual multi-secret sharing using circular or cylindrical random meshes, which is able to share multiple (instead of just or two) secret images in two shares without causing any additional pixel expansion compared to traditional visual cryptography. Cheng et al. [28] adopt ultra-chaotic system and permutation-diffusion architecture to realize the encryption of color images by mixing RGB components, strengthen the dependence between the three components of RGB, and greatly improve the algorithm's ability to resist statistical attacks and differential attacks. Xiong et al. [29] proposed a color image chaotic encryption algorithm combining cyclic redundancy check (CRC) and nine-house graph, after moving and shuffling pixels through the nine-house graph theory, extracting R, G, and B components to form a binary matrix, and finally cyclic shifting according to cyclic redundancy check (CRC), which better solved the problem of insufficient entropy of cipher image information. Chai et al. [30] used dynamic DNA encryption and chaos system to encrypt color images, first shuffling the three components R, G and B by using plain synchronous components and then converting the permutations and combinations into DNA matrix for encryption according to DNA coding rules, which effectively improved the ability of the algorithm to resist plain attacks. Tsafack et al. [31] proposed a new two-dimensional trigonometric logistics-sine-cosine mapping, which first generates three sets of key streams from the map and calculates the Hamming distance in combination with the image R, G and B components, and finally XOR the output distance vector with the key stream to realize the encryption of the image, which greatly improves the security of the cryptosystem. Fei et al. [32] proposed an image encryption algorithm for jump diffusion based on a two-dimensional absolute sine-cosine coupling chaotic system (2D-ASCC) with higher complexity and better pseudo-randomness, which effectively improves the security performance of the encryption algorithm. Hoang et al. [33] proposed a chaos-based multi-image encryption algorithm, which adopts the permutation diffusion architecture for the first time and constructs the disturbance amount according to the pixel coordinates and the original image content, respectively, in the process of pixel arrangement and diffusion, so that the encryption algorithm has good resistance to differential attacks. Sridevi et al. [34] proposed a chaos-assisted color image encryption algorithm. First, the color image is split into RGB planes, and then chaotic maps and attractors are introduced to double obfuscate and diffuse the images, and finally, the separated RGB planes are merged to produce encrypted images, which greatly improves the anti-attack ability of the algorithm. Pour et al. [35] proposed an image encryption algorithm with a large key space and good attack resistance. The algorithm uses chaos game representation (CGR) images to encrypt images, converting image pixels into binary and combining them to generate binary strings, with each pair of bits acting as a letter of the DNA sequence. Zhang et al. [36] designed a two-dimensional sine-cosine coupled chaotic system (2D-SCCM) with better randomness and traversability and wider hyperchaotic range, and proposed a color image encryption algorithm with high encryption efficiency and strong security based on the chaotic system. The algorithm first uses a combination of pure image and hash function to generate a key, then fuses the random sequence generated by 2D-SCCM and Arnold map to construct an S-Box, and finally encrypts the color image by constructing an S-Box, chaos system and hash function. Su et al. [37] proposed an image encryption algorithm based on binary tree space-time chaos and middle-order traversal. The algorithm uses the intermediate traversal sequence to sort the plain images and introduces a coupled mapping lattice to generate a chaotic sequence; it sets the chaotic interference value and finally performs an XOR operation on the adjacent pixels of the image to encrypt the image, which has good robustness. Zhang et al. [38] proposed a multidigital image encryption algorithm with excellent image encryption effect and security. The cyclic matrix is constructed by logical mapping, and the sparse transformation of plain images is realized by combining discrete cosine transformation (DCT), and the Lorenz chaotic system and logic graph are used to generate chaotic bond sequences to encrypt images. Li et al. [39] proposed a multi-image encryption scheme based on a DNA chaos algorithm based on a computational integral imaging framework. By merging multiple images into one image with a computational integral imaging algorithm, the efficiency and security of image encryption are significantly improved, and the contour effect caused by the DNA encryption algorithm is solved because of the high randomness of the chaotic algorithm. To reduce redundant encryption operations and focus on protecting important areas, Song et al. [40] proposed a fast image encryption algorithm based on the object detection model and chaotic system, so that the detected objects were well-protected. Yu et al. [41] proposed an image encryption algorithm with good attack resistance. The algorithm uses the scattering medium as the physical key and fuses the four-step phase-shifted digital hologram to convert the plain image into four noise-like holograms, and achieve the effect of encrypting the image by combining the wavelet transform (LWT) into a new image. Adeel et al. [42] proposed a new method for encrypting color images based on a set of integer keys and a one-dimensional chaotic system, which improves the security of color image encryption by selecting the key associated with the chaotic system to optimize the security of the cryptographic image, which can be used for the secure encryption of image data. Basha et al. [43] proposed a color image encryption technology based on bit-level chaos, which decomposes the color image into red, blue and green color image components based on the logistic-sine-tent-Chebyshev (LSTC) map for encryption, which has good resistance to statistical attacks, differential attacks and brute force attacks. Hosny et al. [44] proposed a new color image cryptographic system that changes the value of image pixels according to the 2D logical sine diagram to reconstruct the scrambled image, and uses the key to diffuse the scrambled image to obtain an encrypted image, which has the characteristics of wide key space, high key sensitivity and good encryption effect. Wang et al. [45] proposed a color image encryption algorithm based on Fisher-Yates scrambling and DNA subsequence operations (elongation operation, truncation operation, deletion operation and insertion operation), which uses the chaotic sequence generated by the Chen system and the Fisher-Yates scrambling method to scramble the plain image of the R, G and B channels, and then introduces DNA coding rules to destroy the scrambled plain-image information to obtain encrypted color images, which have good performance and can resist various typical attacks. Based on logistic sine-cosine mapping, the encryption algorithm in this paper generates the encryption sequence with high efficiency, and an efficient pixel scrambling method and three-round pixel diffusion method are designed based on the encryption sequence, which has high encryption efficiency, sufficient information entropy and good diffusion of cipher images. The encryption diagram and decryption diagram are shown in Figures 1 and 2, respectively. technology based on bit-level chaos, which decomposes the color image into red, blue and green color image components based on the logistic-sine-tent-Chebyshev (LSTC) map for encryption, which has good resistance to statistical attacks, differential attacks and brute force attacks. Hosny et al. [44] proposed a new color image cryptographic system that changes the value of image pixels according to the 2D logical sine diagram to reconstruct the scrambled image, and uses the key to diffuse the scrambled image to obtain an encrypted image, which has the characteristics of wide key space, high key sensitivity and good encryption effect. Wang et al. [45] proposed a color image encryption algorithm based on Fisher-Yates scrambling and DNA subsequence operations (elongation operation, truncation operation, deletion operation and insertion operation), which uses the chaotic sequence generated by the Chen system and the Fisher-Yates scrambling method to scramble the plain image of the R, G and B channels, and then introduces DNA coding rules to destroy the scrambled plain-image information to obtain encrypted color images, which have good performance and can resist various typical attacks. Based on logistic sine-cosine mapping, the encryption algorithm in this paper generates the encryption sequence with high efficiency, and an efficient pixel scrambling method and three-round pixel diffusion method are designed based on the encryption sequence, which has high encryption efficiency, sufficient information entropy and good diffusion of cipher images. The encryption diagram and decryption diagram are shown in Figures 1 and 2, respectively.

Logistics-Sine-Cosine Mapping
The logistics-sine-cosine mapping [31] is a map composed of two seed maps of logistics and sine maps cascading with cosine maps: The mapped bifurcation plot, the Lyapunov index, is shown in Figure 3.
As long as r∈[0,1], x∈(0,1), the map can exhibit complex and random behavior. technology based on bit-level chaos, which decomposes the color image into red, blue and green color image components based on the logistic-sine-tent-Chebyshev (LSTC) map for encryption, which has good resistance to statistical attacks, differential attacks and brute force attacks. Hosny et al. [44] proposed a new color image cryptographic system that changes the value of image pixels according to the 2D logical sine diagram to reconstruct the scrambled image, and uses the key to diffuse the scrambled image to obtain an encrypted image, which has the characteristics of wide key space, high key sensitivity and good encryption effect. Wang et al. [45] proposed a color image encryption algorithm based on Fisher-Yates scrambling and DNA subsequence operations (elongation operation, truncation operation, deletion operation and insertion operation), which uses the chaotic sequence generated by the Chen system and the Fisher-Yates scrambling method to scramble the plain image of the R, G and B channels, and then introduces DNA coding rules to destroy the scrambled plain-image information to obtain encrypted color images, which have good performance and can resist various typical attacks. Based on logistic sine-cosine mapping, the encryption algorithm in this paper generates the encryption sequence with high efficiency, and an efficient pixel scrambling method and three-round pixel diffusion method are designed based on the encryption sequence, which has high encryption efficiency, sufficient information entropy and good diffusion of cipher images. The encryption diagram and decryption diagram are shown in Figures 1 and 2

Logistics-Sine-Cosine Mapping
The logistics-sine-cosine mapping [31] is a map composed of two seed maps of logistics and sine maps cascading with cosine maps: The mapped bifurcation plot, the Lyapunov index, is shown in Figure 3.

Logistics-Sine-Cosine Mapping
The logistics-sine-cosine mapping [31] is a map composed of two seed maps of logistics and sine maps cascading with cosine maps: (1) The mapped bifurcation plot, the Lyapunov index, is shown in Figure 3.

Key Distribution and Cryptographic Algorithm Structure
Considering the accuracy of computer calculations, the key is a 320-bit binary number generated by a random binary number generator, consisting of 32-bit binary numbers 0 , 1 , 2 , 3 , 4 and 0 , 1 , 2 , 3 , 4 , where x is the initial value and r is the control parameter.
The initial value x and the control parameter r are converted from Equation (2) to floating-point numbers: Bring each set of x, r into the logistics-sine-cosine map separately to generate a set of chaotic sequences ω, φ, c, primary 0 , step of length 5. Then bring each set of ω, φ, c, primary 0 , step into the third and fourth iterations to generate an encryption sequence with length H × W × 3; finally, five sets of encryption sequences, 0 , 1 , 2 , 3 and 4 , are obtained.

Pixel Scrambling
Assuming that the plain image P is a color image of H × W, the five sets of encryption sequences with length H × W × 3 generated by the key are 0 , 1 , 2 , 3 and 4 . The rules for scrambling are as follows: Assuming that the positive sequence corresponding to the encryption sequence 0 is (sorted from smallest to largest), there must be Here is how to scramble an image: Step 1: use sequence scramble to store the position information of the elements in the positive sequence in the 0 of the encrypted sequence; for example, the Ath element B in the positive sequence is the Cth element in the encryption sequence 0 ; then the value of the Ath element of sequence scramble is C.
Step 2: transform the image P into a sequence with a one-dimensional length H × W × 3, so that = ( + 0 ) 256 to get a new ; use sequence scramble to scramble the sequence ; for example, the Dth element value in the sequence is E and the Dth As long as r∈[0, 1], x∈(0, 1), the map can exhibit complex and random behavior.

Key Distribution and Cryptographic Algorithm Structure
Considering the accuracy of computer calculations, the key is a 320-bit binary number generated by a random binary number generator, consisting of 32-bit binary numbers x 0 , x 1 , x 2 , x 3 , x 4 and r 0 , r 1 , r 2 , r 3 , r 4 , where x is the initial value and r is the control parameter.
The initial value x and the control parameter r are converted from Equation (2) to floating-point numbers: Bring each set of x, r into the logistics-sine-cosine map separately to generate a set of chaotic sequences ω, ϕ, c, primar 0 , step of length 5. Then bring each set of ω, ϕ, c, primar 0 , step into the third and fourth iterations to generate an encryption sequence with length H × W × 3; finally, five sets of encryption sequences, S 0 , S 1 , S 2 , S 3 and S 4 , are obtained.

Pixel Scrambling
Assuming that the plain image P is a color image of H × W, the five sets of encryption sequences with length H × W × 3 generated by the key are S 0 , S 1 , S 2 , S 3 and S 4 . The rules for scrambling are as follows: Assuming that the positive sequence corresponding to the encryption sequence S 0 is S sorted (sorted from smallest to largest), there must be S sorted Here is how to scramble an image: Step 1: use sequence X scramble to store the position information of the elements in the positive sequence S sorted in the S 0 of the encrypted sequence; for example, the Ath element B in the positive sequence S sorted is the Cth element in the encryption sequence S 0 ; then the value of the Ath element of sequence X scramble is C.
Step 2: transform the image P into a sequence S P with a one-dimensional length H × W × 3, so that S P = (S P + S 0 )mod256 to get a new S P ; use sequence X scramble to scramble the sequence S P ; for example, the Dth element value in the sequence S P is E and the Dth element value in sequence X scramble is F; then the Fth element value in the scrambled sequence S SP is E (S SP is the sequence after scrambling).
For the sake of description, see the following example: Assuming that the image P is a color image of 2 × 2, the generated encryption sequence S 0 = (2.1, 2.8, 2.6, 2.7, 1.3, 1.6, 0.55, 0.53, 0.74, 1.8, 1.2, 2.5); then the corresponding positive sequence S sorted = (0.53, 0.55, 0.74, 1.2, 1.3, 1.6, 1.8, 2.1, 2.5, 2.6, 3.7, 2.8); it is easy to conclude that the position of the 0th element in S sorted in the S 0 is 7th (counting from 0); then the value of the 0th element of sequence X scramble is 7 and so on to get the complete sequence X scramble = (7, 6, 8, 10, 4, 5, 9, 0, 11, 2, 3, 1). The image P is transformed into a sequence S P with a one-dimensional length of 2 × 2 × 3, so that S P = (S P + S 0 )mod256 to get a new S P , and then sequence X scramble is used to scramble the sequence S P ; for example, the value of the 0th element in the sequence S P is 111, and the value of the 0th element in the sequence X scramble is 7, and then the value of the 7th element in the scrambled sequence S SP is 111. Figure 4 shows a schematic diagram of the position change before and after the P-pixel of the image is scrambled. element value in sequence scramble is F; then the Fth element value in the scrambled sequence is E ( is the sequence after scrambling). For the sake of description, see the following example: Assuming that the image P is a color image of 2 × 2, the generated encryption sequence 0 = (2. it is easy to conclude that the position of the 0th element in in the 0 is 7th (counting from 0); then the value of the 0th element of sequence scramble is 7 and so on to get the complete sequence scramble = (7, 6, 8, 10, 4, 5, 9, 0, 11, 2, 3, 1). The image P is transformed into a sequence with a one-dimensional length of 2 × 2 × 3, so that = ( + 0 ) 256 to get a new , and then sequence scramble is used to scramble the sequence ; for example, the value of the 0th element in the sequence is 111, and the value of the 0th element in the sequence scramble is 7, and then the value of the 7th element in the scrambled sequence is 111. Figure 4 shows a schematic diagram of the position change before and after the P-pixel of the image is scrambled. When decrypting, perform the reverse operation of pixel scrambling: Step 1 uses sequence to store the position information of the element in the 0 of the encryption sequence in the positive sequence ; for example, the Cth element B in the encryption sequence 0 is the Ath element in the positive sequence , and then the value of the Cth element of the sequence is A.
Step 2: suppose the image after encryption scrambling is . The is reduced to a one-dimensional sequence of length H × W × 3, and the sequence is restored by using sequence ; for example, the Fth element value in the sequence is E, and the Fth element value in sequence is D, and then the Dth element value in the restored sequence is E. Finally, let = ( − 0 ) 256 to restore the pixel scrambling.

Pixel Diffusion
Suppose that the image before diffusion is an H × W color image after scrambling; first, convert the image into a one-dimensional sequence of length H × W × 3, and then use the 1 to scramble the 2 , 3 and 4 . The scrambling rules are the same as the pixel scrambling rules to obtain a new 2 , 3 and 4 sequence.
For ease of description, here the functions F(L, n) and G(M, n) are set, and F(L, n) represents shifting L left by n units; where L is a sequence, n is an integer, and when n is negative, L is shifted right by -n units. For example, L = (0,1,2,3,4,5, 6,7,8,9), n = 3 and then F(L, n) = (3,4,5,6,7,8,9,0,1,2) for the function G(M, n); assuming that the binary number corresponding to M is , then G(M, n) means that the n bits of the low (right) are shifted out, and the other numbers are shifted n bits to the right, and the decimal number corresponding to the zero is filled in the n empty bits of the high (left); for example, G(5, 1) = 2.
When X is the main diffusion sequence, 2 is the round of the encryption sequence; when Y is the main diffusion sequence, 3 is the round of the encryption sequence, and when Z is the main diffusion sequence, 4 is the round of the encryption sequence. Given the space, only X is given here as the diffusion rule for the principal diffusion vector: Step 1 divides the sequence into three groups of X, Y and Z so that N = H × W, X =  When decrypting, perform the reverse operation of pixel scrambling: Step 1 uses sequence X sort to store the position information of the element in the S 0 of the encryption sequence in the positive sequence S sorted ; for example, the Cth element B in the encryption sequence S 0 is the Ath element in the positive sequence S sorted , and then the value of the Cth element of the sequence X sort is A.
Step 2: suppose the image after encryption scrambling is P s . The P s is reduced to a one-dimensional sequence S SP of length H × W × 3, and the sequence S SP is restored by using sequence X sort ; for example, the Fth element value in the sequence S SP is E, and the Fth element value in sequence X sort is D, and then the Dth element value in the restored sequence S P is E. Finally, let S P = (S P − S 0 )mod256 to restore the pixel scrambling.

Pixel Diffusion
Suppose that the image P S before diffusion is an H × W color image after scrambling; first, convert the image P S into a one-dimensional sequence S SP of length H × W × 3, and then use the S 1 to scramble the S 2 , S 3 and S 4 . The scrambling rules are the same as the pixel scrambling rules to obtain a new S 2 , S 3 and S 4 sequence.
For ease of description, here the functions F(L, n) and G(M, n) are set, and F(L, n) represents shifting L left by n units; where L is a sequence, n is an integer, and when n is negative, L is shifted right by -n units. For example, L = (0,1,2,3,4,5,6,7,8,9), n = 3 and then F(L, n) = (3,4,5,6,7,8,9,0,1,2) for the function G(M, n); assuming that the binary number corresponding to M is M b , then G(M, n) means that the n bits of the M b low (right) are shifted out, and the other numbers are shifted n bits to the right, and the decimal number corresponding to the zero is filled in the n empty bits of the high (left); for example, G(5, 1) = 2.
When X is the main diffusion sequence, S 2 is the round of the encryption sequence; when Y is the main diffusion sequence, S 3 is the round of the encryption sequence, and when Z is the main diffusion sequence, S 4 is the round of the encryption sequence. Given the space, only X is given here as the diffusion rule for the principal diffusion vector: Step 1 divides the sequence S SP into three groups of X, Y and Z so that N = H × W, X = S SP [0:N], Y = S SP [N:2 × N], Z = S SP [2 × N:3 × N] and round = log N 2 + 1; divide the encryption sequence S 2 into three groups of sequences, K x , K y and K z ; let K x = S 2 [0:N], K y = S 2 [N:2 × N] and K z = S 2 [2 × N:3 × N].
Step 2: set X as the main diffusion sequence, and the other two as the secondary diffusion sequence; that is, V p is X, V sp1 is Y and V sp2 is Z, and the diffusion steps are as follows: Repeat Lines 8 through 18 of the above equation until n > round, and finally splice and recombine the three groups of sequences of X, Y and Z into sequences S DP , which can complete a diffusion.
To illustrate the above steps more vividly, assuming that N = 10, round = log N 2 + 1 = 4, the change element is y 0 and Figure 5 is a diffusion diagram of the Y main diffusion sequence, it can be seen that when the y 0 changes, after round + 1 small diffusion, it will lead to the change of all elements.
In general, the diffusion process is that the image data is divided into three groups, three rounds of diffusion; each round of diffusion selects one of X, Y or Z as the main diffusion sequence and the other two as the secondary diffusion sequence. The main diffusion vector diffuses at the same time to carry out round cycle shift, and finally realizes that the change of any element will cause all the output elements to change, which further improves the key sensitivity and plain sensitivity of the encryption algorithm in this paper.
When decrypting, the reverse operation of the encryption operation on the cipher image can be performed, limited by space, and only X is given as the corresponding decryption step when the main diffusion sequence: In general, the diffusion process is that the image data is divided into three groups, three rounds of diffusion; each round of diffusion selects one of X, Y or Z as the main diffusion sequence and the other two as the secondary diffusion sequence. The main diffusion vector diffuses at the same time to carry out round cycle shift, and finally realizes that the change of any element will cause all the output elements to change, which further

Experimental and Safety Analysis
The experimental environment in this article is as follows: the hardware environment is Intel(R) Core(TM) i5-7200U CPU @ 2.

Key Randomness Analysis
The key for the encryption algorithm in this article is a 320-bit binary number ge ated by the random binary number generator. Therefore, 1000 keys are generated by dom binary number generator, and the NIST statistical test suite is used to test the domness of the generated keys, and the results are averaged to evaluate the random of the encryption algorithm keys in this paper. The test results are shown in Table 1, in the 15 tests of the NIST statistical test, the randomly generated binary number passed the test, indicating that the 320-bit binary numbers generated by the random nary number generator in this paper are of good randomness and can be used for im encryption.

Key Security Analysis
The key space of the encryption algorithm in this article is 2 320 > 2 100 , which can t retically resist any form of brute force attack [46], and the following is further proof o actual size of the key space.

Key Randomness Analysis
The key for the encryption algorithm in this article is a 320-bit binary number generated by the random binary number generator. Therefore, 1000 keys are generated by random binary number generator, and the NIST statistical test suite is used to test the randomness of the generated keys, and the results are averaged to evaluate the randomness of the encryption algorithm keys in this paper. The test results are shown in Table 1, and in the 15 tests of the NIST statistical test, the randomly generated binary numbers all passed the test, indicating that the 320-bit binary numbers generated by the random binary number generator in this paper are of good randomness and can be used for image encryption.

Key Security Analysis
The key space of the encryption algorithm in this article is 2 320 > 2 100 , which can theoretically resist any form of brute force attack [46], and the following is further proof of the actual size of the key space.
In this paper, the number of bit change rate (NBCR) [47] is used to evaluate the key sensitivity of the algorithm. NBCR (P 1 , P 2 ) = Ham (P 1 , P 2 ) 3 * H * W * 8 (5) That is the ratio of the total Hamming distance to the total number of bits. Randomly generate a 320-bit binary number key, change one bit on the basis of the original key from high bit to low bit, encrypt the plain image P with the key before and after the change, obtain two cipher images of C 1 and C 2 , and calculate the NBCR (C 1 , C 2 ) of the two images of C 1 and C 2 , and then decrypt the cipher image with the key before and after the change C 1 to obtain the images D 1 and D 2 , and calculate the NBCR (D 1 , D 2 ). The results are shown in Figure 7. NBCR (C 1 , C 2 ) and NBCR (D 1 , D 2 ) are both around 0.5 and the oscillation amplitude is extremely small, indicating that the key sensitivity of the algorithm in this paper is good, and changing any bit in the key will lead to a completely different cipher image and decryption image. after the change, obtain two cipher images of 1 and 2 , and calculate the NBCR ( 1 , 2 ) of the two images of 1 and 2 , and then decrypt the cipher image with the key before and after the change 1 to obtain the images 1 and 2 , and calculate the NBCR ( 1 , Figure 7. NBCR( 1 , 2 ), NBCR( 1 , 2 ).

Image Encryption/Decryption Experiments
The experimental images shown in Figure 6 were encrypted 100 times, and the key was randomly generated each time, as shown in Figure 8. The results of a randomly selected experiment, algorithm time complexity and the average running time are shown in Table 2 (W and H represent the width and height of the encrypted image, respectively). It can be seen that the encryption algorithm in this paper is lossless, and the encryption time is shorter than that of the literature [42][43][44][45]. Although the proposed encryption algorithm is slightly better than the literature [42][43][44][45] in the time comparison experiment of encrypting Lena images, it can be seen that the encryption time of the proposed algorithm increases with the size of the encrypted image, and the encryption efficiency of the proposed algorithm will gradually decrease as the image size increases, and further improvement is needed.

Image Encryption/Decryption Experiments
The experimental images shown in Figure 6 were encrypted 100 times, and the key was randomly generated each time, as shown in Figure 8. The results of a randomly selected experiment, algorithm time complexity and the average running time are shown in Table 2 (W and H represent the width and height of the encrypted image, respectively). It can be seen that the encryption algorithm in this paper is lossless, and the encryption time is shorter than that of the literature [42][43][44][45]. Although the proposed encryption algorithm is slightly better than the literature [42][43][44][45] in the time comparison experiment of encrypting Lena images, it can be seen that the encryption time of the proposed algorithm increases with the size of the encrypted image, and the encryption efficiency of the proposed algorithm will gradually decrease as the image size increases, and further improvement is needed.

Histogram Analysis
The image histogram visually reflects the distribution of gray values of the image, and an attacker can use this feature to analyze the statistical law between plain and cipher images to potentially decipher the key. For this to happen, the histogram of the cipher image must be evenly distributed and completely different from the histogram of the plain image, and the more evenly distributed, the less statistics an attacker will be able to obtain. The pixel histogram of the cipher image based on the encryption scheme in this paper is shown in Figure 9, and the pixel histogram of the cipher image is completely different from the original image and evenly distributed.

Histogram Analysis
The image histogram visually reflects the distribution of gray values of the image, and an attacker can use this feature to analyze the statistical law between plain and cipher images to potentially decipher the key. For this to happen, the histogram of the cipher image must be evenly distributed and completely different from the histogram of the plain image, and the more evenly distributed, the less statistics an attacker will be able to obtain. The pixel histogram of the cipher image based on the encryption scheme in this paper is shown in Figure 9, and the pixel histogram of the cipher image is completely different from the original image and evenly distributed.

Correlation Analysis
In an image, neighboring pixels are often highly correlated, and if this high correlation is not eliminated, an attacker can use this feature to predict its surrounding pixels from one pixel and eventually restore the entire plain image, so it is necessary to completely avoid statistical analysis attacks, eliminating these strong correlations. The correlation coefficient for each upward direction is calculated as follows (horizontal, vertical and diagonal): where x and y are two adjacent pixels, N is the total number of pixels in the image, R xy is the correlation coefficient of x, y, cov(x,y) is the covariance of x and y, D(x) is the standard deviation, D(x) is the variance and E(x) is the mean.

Correlation Analysis
In an image, neighboring pixels are often highly correlated, and if this high correlation is not eliminated, an attacker can use this feature to predict its surrounding pixels from one pixel and eventually restore the entire plain image, so it is necessary to completely avoid statistical analysis attacks, eliminating these strong correlations. The correlation coefficient for each upward direction is calculated as follows (horizontal, vertical and diagonal): where x and y are two adjacent pixels, N is the total number of pixels in the image, is the correlation coefficient of x, y, cov(x,y) is the covariance of x and y, � ( ) is the standard deviation, D(x) is the variance and E(x) is the mean.
The experimental images were encrypted 100 times; each time the key was randomly generated and 3000 pairs of neighboring pixels were randomly selected. The correlations before and after encryption are shown in Figure 10, and the correlation coefficients are shown in Table 3. Most of the correlation coefficients after encryption are close to 0, indicating that the confusion and diffusion of the encryption scheme in this paper are good, The experimental images were encrypted 100 times; each time the key was randomly generated and 3000 pairs of neighboring pixels were randomly selected. The correlations before and after encryption are shown in Figure 10, and the correlation coefficients are shown in Table 3. Most of the correlation coefficients after encryption are close to 0, indicating that the confusion and diffusion of the encryption scheme in this paper are good, which further reduces the occurrence of statistical analysis attacks, but some correlation coefficients are large, and further work is needed to optimize them.

Information Entropy Analysis
Information entropy is a quantitative measure of how random a signal source is. That is, information entropy can be used to measure the randomness of an image, which calculates the spread of pixels at each gray level for each color channel. If the uniform distribution is better, then it will be more resistant to statistical attacks. For the R, G and B channels with color image intensity between 0-255, the ideal entropy value of encrypted messages is 8; the higher the value, the more uniform the distribution. The information entropy calculation formula is as follows: where x i is the grayscale value and P(x i ) is the probability of the grayscale x i . As shown in Table 4, the three-channel information entropy of the Lena ciphertext image is slightly better than the literature [42][43][44][45], indicating that the randomness of the ciphertext image based on the encryption scheme in this paper is good.

Information Entropy Analysis
Information entropy is a quantitative measure of how random a signal source is. That is, information entropy can be used to measure the randomness of an image, which calculates the spread of pixels at each gray level for each color channel. If the uniform distribution is better, then it will be more resistant to statistical attacks. For the R, G and B channels with color image intensity between 0-255, the ideal entropy value of encrypted messages  The ability to resist differential attacks is an important indicator for evaluating cryptographic algorithms. Attackers usually make minor adjustments to the plain image and then compare the differences between the cipher image produced before and after the adjustment to carry out the attack. To examine the effect of single-pixel change on the cipher image in the original image, the color map in the public image dataset USC-SIPI "Misc" was selected for the anti-differential attack analysis of the encryption scheme in this paper, and the color images of 256 × 256 and 512 × 512 correspond to the ideal pixel change rate (NPCR), and the unified average changing intensity (ACI) values are shown in Table 5 [31]. Keeping the key unchanged, randomly test each image 100 times, randomly select the value of any channel of one pixel each time and add 1, change the NPCR and UACI values of the cipher image before and after, as shown in Table 6, and average the results. In Table 6, all the pictures have passed the test, indicating that the proposed algorithm has good resistance to differential attacks and can effectively resist known plain-image attacks and selective plain-image attacks. Keeping the key unchanged, randomly test the experimental image Lena 100 times, randomly select the value of any channel of one pixel each time and add 1, change the NPCR and UACI values of the cipher image before and after, as shown in Table 7, and average the results. Compared with the literature [42][43][44][45], the NPCR and UACI of the encryption scheme in this paper are slightly higher overall. This proves that the encryption scheme in this paper has good ability to resist differential attacks. Image noise refers to unwanted or unwanted interference information that exists in image data. In the process of image acquisition and transmission, because of the influence of image sensor material, working environment, transmission channel [48], etc., the image may be contaminated by a variety of noise, which will have a certain impact on the decryption of the terminal picture. Therefore, the ability to resist a certain intensity of saltand-pepper-noise attacks is an indicator of the performance of image encryption algorithms. In this paper, the noise pollution in the transmission of pepper-salt noise is simulated, and different intensities of pepper-salt noise are added to the cipher image to test the noise resistance ability of the proposed algorithm.
The cipher image of the test image Lena shown in Figure 8 was decrypted by adding salt-and-pepper noise with noise densities of 0.05, 0.1, 0.15 and 0.2, respectively, and the decrypted image is shown in Figure 11. It can be seen from Figure 11 that when the salt and pepper densities are 0.05 and 0.1, respectively, the decryption algorithm in this paper can basically restore the original image. When the salt density is 0.15, the restored image is blurry, but the original image can still be recognized; when the salt density is 0.2, the restored image can still recover the general outline. The experimental results show that the greater the intensity of the noise, the deeper the impact on the image, and the worse the quality of the decrypted image, but the algorithm in this paper can still distinguish the main information of the original image from the overall visual effect, indicating that the algorithm can tolerate a certain degree of noise and have strong anti-interference ability. and pepper densities are 0.05 and 0.1, respectively, the decryption algorithm in this paper can basically restore the original image. When the salt density is 0.15, the restored image is blurry, but the original image can still be recognized; when the salt density is 0.2, the restored image can still recover the general outline. The experimental results show that the greater the intensity of the noise, the deeper the impact on the image, and the worse the quality of the decrypted image, but the algorithm in this paper can still distinguish the main information of the original image from the overall visual effect, indicating that the algorithm can tolerate a certain degree of noise and have strong anti-interference ability. Figure 11. Decrypt images after different salt-and-pepper noise was added to cipher images.

Analysis of Shear Resistance
A clipping attack is an attack method that intercepts a ciphertext image during transmission and destroys or deletes part of the data [49]. The part that is usually clipped is an area in the image that has a strong correlation between pixels, and the lost information is difficult to recover. Therefore, breaking the correlation between pixels is an indicator to measure the anti-clipping performance of image encryption algorithms. If the correlation between image pixels is strong, the cipher image after the loss of information cannot provide enough valid information, and the decryption may fail. The cipher image of the test image Lena shown in Figure 8 is cut 1/16, 1/4 and 1/2 (the pixels at the clipping position are all 0, and the clipping sample is shown in Figure 12), and the decryption of the cut cipher image is obtained as shown in Figure 13. It can be seen from Figure 13 that when

Analysis of Shear Resistance
A clipping attack is an attack method that intercepts a ciphertext image during transmission and destroys or deletes part of the data [49]. The part that is usually clipped is an area in the image that has a strong correlation between pixels, and the lost information is difficult to recover. Therefore, breaking the correlation between pixels is an indicator to measure the anti-clipping performance of image encryption algorithms. If the correlation between image pixels is strong, the cipher image after the loss of information cannot provide enough valid information, and the decryption may fail. The cipher image of the test image Lena shown in Figure 8 is cut 1/16, 1/4 and 1/2 (the pixels at the clipping position are all 0, and the clipping sample is shown in Figure 12), and the decryption of the cut cipher image is obtained as shown in Figure 13. It can be seen from Figure 13 that when the cipher image is cut by 1/16, the image can basically be decrypted and restored to the original image; when cutting 1/4, the approximate image information can still be recovered after decryption; when cutting 1/2, the restored image information can see the general outline. Experimental results show that the proposed algorithm has a certain recovery ability when subjected to shear attacks, and the proposed encryption algorithm can resist shear attacks to a certain extent.
A clipping attack is an attack method that intercepts a ciphertext image during transmission and destroys or deletes part of the data [49]. The part that is usually clipped is an area in the image that has a strong correlation between pixels, and the lost information is difficult to recover. Therefore, breaking the correlation between pixels is an indicator to measure the anti-clipping performance of image encryption algorithms. If the correlation between image pixels is strong, the cipher image after the loss of information cannot provide enough valid information, and the decryption may fail. The cipher image of the test image Lena shown in Figure 8 is cut 1/16, 1/4 and 1/2 (the pixels at the clipping position are all 0, and the clipping sample is shown in Figure 12), and the decryption of the cut cipher image is obtained as shown in Figure 13. It can be seen from Figure 13 that when the cipher image is cut by 1/16, the image can basically be decrypted and restored to the original image; when cutting 1/4, the approximate image information can still be recovered after decryption; when cutting 1/2, the restored image information can see the general outline. Experimental results show that the proposed algorithm has a certain recovery ability when subjected to shear attacks, and the proposed encryption algorithm can resist shear attacks to a certain extent.   A clipping attack is an attack method that intercepts a ciphertext image during transmission and destroys or deletes part of the data [49]. The part that is usually clipped is an area in the image that has a strong correlation between pixels, and the lost information is difficult to recover. Therefore, breaking the correlation between pixels is an indicator to measure the anti-clipping performance of image encryption algorithms. If the correlation between image pixels is strong, the cipher image after the loss of information cannot provide enough valid information, and the decryption may fail. The cipher image of the test image Lena shown in Figure 8 is cut 1/16, 1/4 and 1/2 (the pixels at the clipping position are all 0, and the clipping sample is shown in Figure 12), and the decryption of the cut cipher image is obtained as shown in Figure 13. It can be seen from Figure 13 that when the cipher image is cut by 1/16, the image can basically be decrypted and restored to the original image; when cutting 1/4, the approximate image information can still be recovered after decryption; when cutting 1/2, the restored image information can see the general outline. Experimental results show that the proposed algorithm has a certain recovery ability when subjected to shear attacks, and the proposed encryption algorithm can resist shear attacks to a certain extent.   Through a series of security experiments such as key randomness analysis, key security analysis, statistical analysis, anti-differential attack analysis and damage resistance analysis, it is proved that the encryption scheme proposed in this paper has a large key space and is a lossless color image encryption algorithm. By comparing the literature [42][43][44][45], it shows that the encryption scheme in this paper has good encryption efficiency, image information entropy, robustness and resistance to differential attacks.

Conclusions
Because images are vulnerable to external attacks in the process of network transmission and traditional image encryption algorithms have limitations such as long encryption time, insufficient entropy or poor diffusion of cipher image information when encrypting color images, this paper proposes a fast image encryption algorithm for logistics-sine-cosine mapping. A random binary number generator is used to generate 320-bit binary numbers as keys, and five sets of encrypted sequences are generated based on logistics-sine-cosine. Five sets of encryption sequences are used to scramble and spread the image pixels, and the color image is encrypted with small computing resources and high efficiency. A large number of color images of different resolutions and sizes were selected from the gallery and a series of security analysis experiments. Experimental results show that the encryption algorithm in this paper has a short encryption time, robustness and resistance to differential attacks, and is a safe and effective color image encryption algorithm, but it has certain limitations in correlation and needs to be further optimized. At the same time, although the proposed encryption algorithm is slightly better than the literature [42][43][44][45] in the time comparison experiment of encrypting Lena images, it can be seen that the encryption time of the proposed algorithm increases with the size of the encrypted image, and as the image size increases, the encryption efficiency of the proposed algorithm will gradually decrease, and further improvement is needed.