Image encryption and decryption method and image encryption and decryption system
The composite memristor hyperchaos system generates a pseudo-random key and performs bit-plane decomposition and random scrambling on the image, which solves the problems of small key space and insufficient resistance to differential attacks in the existing image encryption technology, and achieves Efficient and secure image encryption and decryption method.
Patent Information
- Application Number
- CN202011336541.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-09-07
- Filing Date
- 2020-11-25
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-11-25
AI Technical Summary
Existing image encryption technology has shortcomings and is difficult to meet the needs of practical applications, especially in terms of small key space, insufficient resistance to differential attacks, and low storage efficiency.
A pseudo-random sequence generator based on a composite memristive hyperchaotic system is used to generate a pseudo-random key. Through bit plane decomposition and reconstruction of the original image, combined with random scrambling and XOR diffusion processing, the encrypted image is obtained, and is ensured through security analysis Resistant to differential attacks and high key spaces.
It achieves rapid generation of encrypted images and high security performance, reduces storage space requirements, and the pixel correlation of encrypted images tends to 0, which can effectively resist differential attacks and has excellent security performance.
Smart Images

Figure CN112636895B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an image encryption and decryption method and an image encryption and decryption system. Background Art
[0002] With the continuous development of information technology, information security, from the security of national secrets to the security of personal privacy, is gaining increasing public attention. Random numbers are closely related to cryptography, which has attracted considerable attention due to its extreme sensitivity to keys, mixed data, pseudo-random behavior, and determinism. Consequently, the research on random sequence generators that meet cryptographic security requirements has become a hot topic. These generators can produce either truly random or pseudo-random sequences, respectively referred to as true random sequence generators and pseudo-random sequence generators. True random number generators based on physical phenomena (such as thermal noise and oscillators) suffer from the disadvantage of slow true random number generation. For practical computing needs, pseudo-random numbers are increasingly being used due to their advantages, such as fast generation speed, repeatability, and reduced storage memory.
[0003] Existing pseudo-random sequence generators include linear congruential generators, carry-add-borrow-subtract generators, inverse congruential generators, and pseudo-random sequence generators based on chaotic systems. However, chaotic systems possess several inherent advantages that make them particularly attractive for implementing pseudo-random sequence generators, such as sensitivity to initial conditions, ergodicity, pseudo-random behavior, and high complexity. Consequently, pseudo-random sequence generator methods, linked to chaos theory, have attracted increasing attention and research. On this basis, several pseudo-random sequence generators based on memristor chaotic systems or memristor hyperchaos have been proposed. Memristors are physically realized dynamic, nonvolatile nanoscale devices. As controllable nonlinear devices, they facilitate the generation of chaotic signals. In particular, memristor hyperchaotic systems exhibit more complex behavioral characteristics than memristor chaotic systems, resulting in better chaotic properties. They also possess greater sensitivity to initial conditions and control parameters, a larger key space, stronger algorithmic anti-cracking capabilities, and more complex dynamic characteristics. This indicates that their dynamic sequences exhibit greater divergence than memristor chaotic systems. All of these advantages are very useful for generating pseudo-random sequences with improved statistical properties. Compared to pseudo-random sequence generators based on composite chaotic systems, traditional chaotic sequence generators are always implemented with finite precision, and their characteristics differ significantly from theoretical results due to finite precision effects. Traditional chaotic sequences implemented with finite precision suffer from numerous shortcomings, such as short chaotic domain periodicity, uneven distribution, poor autocorrelation, chaotic discontinuity, and a small key space, making them difficult to meet practical application requirements. In recent years, a true random bit generator based on a memristive chaotic system and a logistic map, as well as a pseudo-random sequence generator based on a five-dimensional memristive hyperchaotic system and a Lorentz map, have been realized. The security performance of the generated sequences meets cryptographic requirements, and all have been implemented on field-programmable gate array (FPGA) boards.
[0004] In security applications, chaotic pseudo-random sequences have demonstrated outstanding performance in image encryption algorithms. Images are processed differently from text due to their larger data capacity and strong correlation between adjacent pixels. Image encryption algorithms involve various substitution or transposition methods to convert ordinary images into cipher images. Pseudo-random sequence generators are capable of generating sufficiently long pseudo-random digital key streams, which are crucial for encrypting the pixels of an image. Examples include symmetric image encryption schemes using Arnold cat maps, symmetric image encryption algorithms based on hybrid linear-nonlinear coupled lattices, one-dimensional chaotic image encryption systems, and a lossless image encryption algorithm based on edge detection and generalized chaotic maps.
[0005] Patent document CN201710109216.5 discloses an image encryption method, which includes generating a key for encrypting the image and encrypting a portion of the bits in a bit sequence of each pixel in the image based on the key to generate a first encrypted image, where the bit sequence represents the value of the corresponding pixel. The image encryption method also includes determining an image entropy value of the image and scrambling the first encrypted image based on the image entropy value to generate a second encrypted image. The image encryption method uses the public key of the target device or target user to encrypt the key and the image entropy value and stores or transmits the second encrypted image, the encrypted key, and the image entropy value in an associated manner. However, the above-mentioned problem is still not solved.
[0006] Therefore, the existing image encryption technology has shortcomings and needs to be improved and enhanced. Summary of the Invention
[0007] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide an image encryption and decryption method and an image encryption and decryption system to solve the technical problems mentioned in the background technology.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] An image encryption and decryption method includes the following steps:
[0010] S1, obtaining the plaintext image by decomposing and reconstructing the bit plane of the original image;
[0011] S2. Obtain a pseudo-random key and randomly scramble the plaintext image to obtain an encrypted image.
[0012] Preferably, in the image encryption and decryption method, in step S1, the step of obtaining the plaintext image specifically includes:
[0013] S11, decomposing the original image to obtain bit planes, and arranging the bit planes from low to high in hierarchy;
[0014] S12. Select multiple high-order bit planes for reconstruction to obtain a plaintext image.
[0015] Preferably, in the image encryption and decryption method, step S2 specifically includes:
[0016] S21. Obtain a pseudo-random key;
[0017] S22, performing a random scrambling operation on the plaintext image to obtain a first scrambled image;
[0018] S23. Perform XOR diffusion processing on the first scrambled image using the pseudo-random key to obtain an encrypted image.
[0019] Preferably, in the image encryption and decryption method, in step S22, the specific steps of the random scrambling operation are:
[0020] Converting the pseudo-random key into a first random one-dimensional vector and a second random one-dimensional vector; converting the plaintext image into a one-dimensional plaintext vector;
[0021] Perform an Arnold transform on the coordinates of any point of the one-dimensional plaintext vector to obtain a first scrambled image.
[0022] Preferably, the image encryption and decryption method further includes an image decryption operation, specifically:
[0023] S31, obtaining a pseudo-random key;
[0024] S32, performing XOR diffusion processing on the encrypted image using the pseudo-random key to obtain a first diffused image;
[0025] S33: Randomly scramble the first diffused image to obtain a plaintext image.
[0026] An image encryption and decryption system using the image encryption and decryption method includes a receiving module, a pseudo-random generation module, an encryption module and an output module;
[0027] The receiving module is used to receive the image to be processed and transmit it to the encryption module;
[0028] The pseudo-random generation module is used to receive password data and generate a pseudo-random key according to the password data;
[0029] The encryption module obtains the pseudo-random key and is used to execute the encryption method on the image to be processed to obtain an encrypted image;
[0030] The output module is used to output the encrypted image.
[0031] Preferably, in the image encryption and decryption system, the pseudo-random generation module has a composite entropy source; the composite entropy source is composed of a four-dimensional memristor hyperchaotic system, a five-dimensional memristor hyperchaotic system and a six-dimensional memristor hyperchaotic system integrated through random XOR processing, which is used to realize the generation of the pseudo-random key.
[0032] Preferably, the image encryption and decryption system further includes a decryption module for implementing the above-mentioned image decryption operation.
[0033] A computer-readable medium stores computer-executable software. The software is constructed based on the image encryption and decryption system. When executed by a computer, the software implements the image encryption algorithm. During execution, the software implements corresponding image encryption or decryption operation steps according to the functional modules of the image encryption and decryption system.
[0034] An electronic device is provided with the image encryption and decryption system.
[0035] Compared with the prior art, the image encryption and decryption method and image encryption and decryption system provided by the present invention have the following advantages:
[0036] Beneficial effects:
[0037] 1) The image encryption and decryption method provided by the present invention reconstructs the original image to obtain a plaintext image, which greatly reduces the storage space without destroying the obvious features of the image;
[0038] 2) The image encryption and decryption method provided by the present invention uses a pseudo-random key to directly perform random scrambling and XOR diffusion on the plaintext image to obtain an encrypted image. This method is convenient and fast, has great convenience, occupies little system resources, and encrypts and decrypts quickly.
[0039] 3) In the image encryption and decryption method provided by the present invention, the encrypted image obtained through encryption operations has undergone security analysis and differential attack resistance analysis, ensuring the effectiveness of the algorithm and achieving pixel correlation close to zero. Performance comparisons with existing encryption algorithms have also been conducted, and the feedback results demonstrate that the encrypted image obtained using the image encryption method of the present invention has excellent security performance.
[0040] 4) In the image encryption and decryption system provided by the present invention, the pseudo-random generation module used is composed of three continuous memristor hyperchaotic systems. The resulting pseudo-random key has been effectively statistically analyzed and security analyzed, indicating that it has a large key space and good key sensitivity. The generated random number sequence can pass the NIST randomness test and thus has good statistical performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a flowchart of the image encryption operation provided by the present invention;
[0042] Figure 2 This is a flowchart for obtaining a plaintext image provided by the present invention;
[0043] Figure 3 This is a flow chart for generating an encrypted image provided by the present invention;
[0044] Figure 4 This is a flow chart of random scrambling operations provided by the present invention;
[0045] Figure 5 This is a structural block diagram of the image encryption and decryption system provided by the present invention;
[0046] Figure 6 This is a block diagram of the pseudo-random key provided by the present invention and its functional operation;
[0047] Figure 7 This is a time domain waveform diagram of the sensitivity analysis of the pseudo-random key provided by the present invention, 7a is the change of variable parameters, and 7b is the change of initial conditions;
[0048] Figure 8 8a is an autocorrelation diagram and 8b is a cross-correlation diagram of the pseudo-random key provided by the present invention;
[0049] Figure 9 9a is the β3-d2 plane, 9b is the a-β3 plane, and 9c is the a-d2 plane;
[0050] Figure 10 It is a schematic diagram of decomposing the original image provided by the present invention into 8 bit planes;
[0051] Figure 11 The present invention provides an 8-bit grayscale image of 256*256 pixels of the original image Lena;
[0052] Figure 12 The original image and the reconstructed plaintext image provided by the present invention are different. 12a is an 8-bit plane grayscale original image of 256*256 pixels, and 12b is a plaintext image obtained by using Figure 11 The 5th, 6th, 7th, and 8th bit planes are used to reconstruct the plaintext image, and 12c is used to Figure 11 The plaintext image reconstructed from the 6th, 7th, and 8th bit planes;
[0053] Figure 13 It is a topological diagram of the image encryption and decryption method executed by the image encryption and decryption system provided by the present invention;
[0054] Figure 14 The results of using the image encryption and decryption algorithm provided by the present invention on the original images Lena and Baboon are shown, (14a) and (14d) are the original images, (14b) and (14e) are the encrypted images, and (14c) and (14f) are the decrypted images;
[0055] Figure 15 It is a flow chart of the image decryption operation provided by the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0057] Digital images have always been regarded as the main carrier of information exchange because of their intuitive, vivid and figurative characteristics. What is stored in the digital image file is mainly the color and grayscale information of the image, but the image information in the image transmission process may involve a large amount of private information, so ensuring the security of the image during transmission and storage has become a focus of attention and research. More and more experiments have shown that not all chaotic image encryption algorithms are safe. The present invention uses a pseudo-random sequence generator based on a composite memristor hyperchaotic system to scramble the position or pixel value of the image pixels for replacement, and obtains an encrypted image that greatly improves relevant security standards such as key space, histogram analysis, key sensitivity, resistance to differential attacks and correlation between adjacent pixels (the aforementioned parameters will be evaluated using chaotic image encryption effectiveness analysis). Please refer to Figure 1 The present invention provides an image encryption and decryption method, comprising the following steps:
[0058] S1, obtaining the plaintext image by decomposing and reconstructing the bit plane of the original image;
[0059] Specifically, in an image, a pixel is a number composed of bits. The grayscale of each pixel is composed of 8 bits (bytes). This is equivalent to an 8-bit image consisting of 8 1-bit planes, such as Figure 10 shown. Figure 11 The original image Lena is decomposed into eight bit planes, from top to bottom, from the highest-order bit to the lowest-order bit, i.e., bit planes 1 to 8. Each bit plane is obtained by processing a threshold grayscale transformation function (the threshold is denoted as ε) to obtain a binary image. Generally, all grayscales greater than ε are mapped to 1, and all grayscales less than ε are mapped to 0. However, to facilitate subsequent image encryption operations, in this invention, all grayscales less than ε are mapped to 0.5.
[0060] Decomposing an image into bit planes allows us to determine the adequacy of the number of bits used to quantize the image. Reconstruction is done by multiplying the pixels of the nth plane by a constant 2. n-1 The planes used to reconstruct an image can be less than all the bit planes decomposed. Figure 11 It can be seen that the higher the bit order, the more information the image contains. Figure 11 As an example of the original image Lena in FIG, three bit planes (the 6th, 7th, and 8th bit planes are used in this embodiment) are used to form Figure 12The image in c is a good representation of the original image. Although the main features of the original image are restored, it is somewhat flat and lacks details, especially in the background area. Including the fifth bit plane in the reconstruction effectively improves this situation, and we get Figure 12 b. After many tests, even if more bit planes are added, it will not make a greater contribution to the appearance of the image. At the same time, when using the encryption method provided by the present invention, the time consumed for encrypting the 8-bit plane Lena image is 0.1568s, while the time consumed for encrypting the 4-bit plane Lena image is 0.1576s, that is, the time consumed for encryption can be considered equal. However, using 4 bit planes to reconstruct the original image can reduce the storage capacity by 50%. Therefore, in order to reduce the data storage capacity and improve the data transmission efficiency, the encryption method provided by the present invention uses the four high-order bit planes (i.e., the 5th, 6th, 7th, and 8th bit planes) to reconstruct the original image after decomposing the original image to obtain the plaintext image.
[0061] See also Figure 2 As a preferred solution, in this embodiment, in step S1, the step of obtaining the plaintext image specifically includes:
[0062] S11. Decompose the original image into bit planes, and arrange them from low to high levels. In this embodiment, the number of bit planes obtained by decomposition is 8, and the arrangement order is arranged according to the above specifications.
[0063] S12: Select multiple high-order bit planes for reconstruction to obtain a plaintext image. Preferably, in this embodiment, the number of bit planes involved in reconstructing the plaintext image is 4-8, and more preferably 4.
[0064] See accordingly Figure 5 The present invention also provides an image encryption and decryption system using the above-mentioned image encryption and decryption method, comprising a receiving module 1, a pseudo-random generation module 2, an encryption module 3 and an output module 4;
[0065] The receiving module 1 is used to receive the image to be processed and transmit it to the encryption module 3;
[0066] The pseudo-random generation module 2 is used to receive password data and generate a pseudo-random key according to the password data;
[0067] The encryption module 3 obtains the pseudo-random key and is used to execute the encryption method on the image to be processed to obtain an encrypted image. Specifically, the encryption module 3 first checks whether the original image transmitted by the receiving module 1 meets the storage and processing standards (in this embodiment, the standard is whether it is already a 4-bit plane plaintext image). If so, step S2 is executed; if not, the original image is processed according to the steps of step S1 to obtain a plaintext image.
[0068] The output module 4 is used to output the encrypted image.
[0069] S2. Obtain a pseudo-random key and randomly scramble the plaintext image to obtain an encrypted image.
[0070] Specifically, in this embodiment, the encryption module 3 obtains the pseudo-random key of the pseudo-random generation module 2, encrypts the plaintext image to obtain an encrypted image, and outputs the encrypted image through the output module 4 for subsequent processing (such as storage and transmission).
[0071] See also Figure 3 As a preferred solution, in this embodiment, it is characterized in that the step S2 specifically includes:
[0072] S21. Obtain a pseudo-random key;
[0073] Specifically, the pseudo-random key is generated by the pseudo-random generator. As a preferred solution, in this embodiment, please refer to Figure 6 , the pseudo-random generation module 2 has a composite entropy source; the composite entropy source (not shown) is composed of a four-dimensional memristive hyperchaotic system, a five-dimensional memristive hyperchaotic system and a six-dimensional memristive hyperchaotic system integrated through random XOR processing, and is used to generate the pseudo-random key according to the user's key; the specific XOR processing process is: for the real number sequences output by the three memristive hyperchaotic systems, they are XORed to enhance randomness, and the generated output samples are used as the final bit sequence. In recent years, in order to improve the complexity and security level of the system in the pseudo-random generator, many researchers have suggested using a composite chaotic system, because the composite chaotic system may have better randomness and complex chaotic characteristics, so that the cryptographic system can obtain higher security, but there has been no better construction of a suitable composite chaotic system. In the present invention, the pseudo-random generation module 2 uses a four-dimensional, a five-dimensional and a six-dimensional memristive hyperchaotic system to form a composite system as the entropy source of the pseudo-random number generator. The following introduces these three memristive hyperchaotic systems respectively:
[0074] The system equation of the four-dimensional memristor hyperchaotic system provided by the present invention is shown in formula (1). The flux-controlled memristor W(x1) = -βx1 is used, which contains only one linear term, not a constant term. When the parameter values are set to a = 35, b = 3, c = 28, k = 2, β = 0.24 and the initial conditions are [0.1, 0.1, 0.1], it has been verified that the Lyapunov exponents of the four-dimensional memristor hyperchaotic system provided by the present invention are LE1 = 1.976, LE2 = 0.1252, LE3 = 0, and LE4 = -11.950. The four-dimensional memristor hyperchaotic system contains two positive Lyapunov exponents, indicating that it is a four-wing memristor hyperchaotic system.
[0075]
[0076] The system equation of the five-dimensional memristor hyperchaotic system provided by the present invention is shown in formula (2). When the memristor is selected as W(x5)=1-β2|x5|, x5 and β are its flux variable and positive parameter, and when the system parameters are a2=10, b2=12, c2=30, d2=2, e2=3, β2=0.2, and the initial value of the system is given as (x1(0), x2(0), x3(0), x4(0), x5(0))=[0.1, 0.1, 0.1, 0.1, 0.1], the Lyapunov exponents of the five-dimensional memristor hyperchaotic system are calculated to be: LE1=3.5610, LE2=0.3092, LE3=0, LE4=-2.0660, LE5=-23.4708. It can be seen that equation (2) has two positive Lyapunov exponents, which means that the five-dimensional memristor hyperchaotic system (2) can exhibit hyperchaotic dynamics and find a new critical point called the permanent point.
[0077]
[0078] The dynamical behavior of the five-dimensional memristor hyperchaotic system is rich. Under different initial values of the system parameters, attractors coexist, including symmetric attractors and multi-wing attractors. Therefore, under selected initial conditions, chaotic attractors or hyperchaotic attractors, periodic attractors, and quasi-periodic attractors can also coexist.
[0079] The system equation of the six-dimensional memristor hyperchaotic system provided by the present invention is shown in formula (3), which is a flux-controlled memristor model. A six-dimensional memristive hyperchaotic system with a line equilibrium point is constructed. When the system parameters a3=10,b3=60,c3=20,d3=15,e3=40,f3=1,g3=50,h3=10,m=13,n=0.02 and the initial value is [1,1,1,1,1,1], the Lyapunov exponent is LE=[10.16,2.187,0.0136,-0.5759,-16.08,-18.86]. The complex behavior of the six-dimensional memristive hyperchaotic system (3) is characterized by the phase diagram, Lyapunov exponent spectrum, bifurcation diagram and spectral entropy. Under different system parameters and initial values, the system exhibits a variety of dynamic behaviors, including quasi-periodic bifurcations, single-wing and double-wing as well as four-wing chaotic attractors.
[0080]
[0081] The method used by a single chaotic system to generate a pseudo-random sequence generator is too simple, easily intercepted, and lacks complexity. The above process demonstrates that the chaotic properties of the new composite memristor hyperchaotic system rely on the aforementioned four-, five-, and six-dimensional memristor hyperchaotic systems. In practical applications, these three systems are combined through random XOR post-processing to generate a pseudo-random sequence that meets security requirements. Therefore, compared to the complexity of each individual hyperchaotic system, the pseudo-random sequence based on this composite memristor hyperchaotic system has a better randomness and better meets security requirements.
[0082] Next, the pseudo-random number sequence generated by the pseudo-random generation module 2 provided by the present invention is subjected to a NIST randomness test:
[0083] The SP800-22 test group provided by the National Institute of Standards and Technology (NIST) recommends using 16 statistical testing methods for randomness testing of binary sequences of arbitrary length. Some of these 16 test items contain multiple sub-test items, and the results of each test item include two indicators: P-value and pass rate. For the P-value, when P-value ≥ 0.01, the pseudo-random sequence is random. The value of α is usually [0.001, 0.01], and the significance level set here is α = 0.01. For the pass rate value, if the value is within the confidence interval, it means that the sequence passes the test. Let β be the number of groups of the tested sequence, then the confidence interval is:
[0084]
[0085] In this experiment, the pseudorandom sequence generated by the proposed method generated 130 different binary sequences with a length of 1M bits. That is, β = 130, and the calculated confidence interval was [0.96384, 1]. The results are shown in Table 1. It can be seen that in each test result, the P-value is greater than the significance level α, and the pass rate values are all within the confidence interval. Therefore, the generated sequences can completely pass the NIST test, indicating that the sequences are random.
[0086] Table 1 NIST test results
[0087]
[0088] Next, the pseudo-random number sequence generated by the pseudo-random generation module 2 provided by the present invention is tested for safety performance.
[0089] Complexity Analysis:
[0090] The complexity of the composite memristor hyperchaotic system is mainly reflected by the approximate entropy. Approximate entropy (ApEn) is a nonlinear dynamic parameter used to quantify the regularity and unpredictability of time series fluctuations. It uses a non-negative number to represent the complexity of a time series, reflecting the possibility of new information in the time series. Its physical meaning is the probability of generating a new pattern in the time series when the dimension changes. The greater the probability of generating a new pattern, the more complex the time series, and the corresponding approximate entropy. Therefore, the approximate entropy is extended to measure the randomness of binary sequences. In this embodiment, the effect of the length of the pseudo-random sequence on the approximate entropy value is first tested. Generally, the more uniform the probability distribution and the more complex the sequence, the greater the approximate entropy.
[0091] definition:
[0092] 1. When there exists an N-dimensional time series κ(1),κ(2),…,κ(N) sampled at equal time intervals.
[0093] 2. Reconstruct the m-dimensional vectors X(1), X(2),…, X(N-m+1), where X(i) = [κ(i), κ(i+1),…, κ(i+m-1)].
[0094] 3. For 1≤i≤N-m+1, count the number of vectors that meet the following conditions:
[0095]
[0096] Among them, d[X,X * ] is defined as d[X,X * ]=max|κ(a)-κ *(a)|, κ(a) is an element of vector X, d represents the distance between vectors X(i) and X(j), which is determined by the maximum difference between the corresponding elements, and the value of j ranges from [1, N-m+1], including j=i.
[0097] 4. Approximate entropy (ApEn) is defined as:
[0098] ApEn=θ m (r)-θ m+1 (r) (6);
[0099] Where m is an integer, indicating the length of the comparison vector; r is a real number, indicating the measure of “similarity”, usually r = 0.2*std, where std represents the standard deviation of the original time series.
[0100] After calculating and processing the above data, we get Table 2. As can be seen from Table 2, with the increase of the length of the chaotic sequence, the complexity of the chaotic sequence increases, and the value of the approximate entropy (ApEn) of the chaotic sequence also becomes larger and larger, showing the superiority of randomness.
[0101] Table 2 Sequence complexity
[0102] Sequence length (bits) ApEn 1320 0.6930 6600 0.6931 22000 0.7707
[0103] Key space analysis:
[0104] It is generally believed that when the key space is less than 2 128 is not secure enough. For an ideal cryptographic system, it should be large enough to make brute force attacks infeasible. In a composite memristor hyperchaotic system, when other parameters or initial values are fixed and a certain parameter or initial value is changed, the changed parameter or initial value is called the key. The key is not secure enough for any value greater than or equal to 10 -12 Therefore, the key space is larger than 10 12 Therefore, the key space of the composite memristor hyperchaotic system is 10 228 ≈2 760 , enough to resist various violent attacks.
[0105] Initial value sensitivity analysis:
[0106] In this initial value sensitivity analysis, the bit change rate is used to measure its sensitivity to the key. That is, the degree to which the number of bits in the sequence generated by the pseudo-random sequence generator varies when the key is slightly changed. The corresponding bit change rate is calculated by counting the changes in the values of '0' and '1' at corresponding positions in the binary sequence:
[0107]
[0108] Where n and n' are binary sequences generated before and after a slight change in the system's initial key. The ideal bit change rate is 50%. The closer the bit change rate obtained through simulation is to 50%, the greater the sensitivity of the pseudo-random sequence generator to the initial value. The specific calculation mechanism is shown in Table 3, demonstrating the excellent sensitivity of the pseudo-random sequence generated by the pseudo-random generation module 2 provided by the present invention.
[0109] Table 3 Initial value sensitivity analysis
[0110]
[0111] When measuring the sensitivity of initial values, correlation analysis refers to analyzing two or more correlated variable elements to measure the degree of correlation between the two sequences. The autocorrelation function refers to a sequence {η i} and its corresponding shift sequence {η i+t The correlation between the two sequences is similar to the autocorrelation function of a pseudorandom sequence with good performance. The cross-correlation function is used to measure the correlation between two given sequences at different times. The autocorrelation function of a pseudorandom sequence with good performance tends to 0. The correlation coefficient between the two sequences can be expressed as:
[0112]
[0113] Among them, X i ,Y i (i=0,1,…,n), n is the length of the sequence; μ and σ represent the mean and standard deviation. o =0, indicating that the difference between the two sequences is very obvious and there is almost no correlation.
[0114] Taking the above into consideration, each pseudo-random sequence is tested with the corresponding pseudo-random sequence after a slight change in the key (for example, changing one of the values), and three situations of slight changes in the key are obtained, namely K a , K b Three situations, the specific changes are: x0→x0+10 -12 、a→a+10 -12 x0 and b→b+10 -12 , and then get Table 4. Please also refer to Figure 7 ,pass Figure 7 7a and 7b show that the system trajectory separates after about 5 iterations, indicating that it is very sensitive to small changes in the key. Figure 8The autocorrelation graph and cross-correlation graph in the figure and the uniform result of the correlation coefficient approaching 0 in Table 4 verify that there is almost no correlation between the pseudo-random sequences generated by the method of this invention. It can be seen that the pseudo-random sequence generator proposed by the method of the present invention has high sensitivity to the key and is ideal and meets the security requirements.
[0115] Table 4 Correlation coefficients of different initial keys
[0116]
[0117] Spectral entropy analysis:
[0118] The method of calculating the relative power spectrum based on Fourier transform and combining it with Shannon entropy to calculate the spectral entropy complexity of the sequence is called SampEn algorithm, which is used to analyze the complexity and security of chaotic systems. Generally, the SampEn algorithm can be described as follows: given a chaotic random sequence of length N {x(n), n=0,1,2,2,N-1}, use Remove the DC part, where For the mean of a given sequence, perform discrete Fourier transform on the sequence x(n):
[0119]
[0120] Where k = 0, 1, 2, 2, N-1.
[0121] Taking half of X(k) to calculate the total power of the sequence, we get:
[0122]
[0123] Find the relative power spectrum probability of a sequence based on its total power:
[0124]
[0125] See also Figure 9 , we can see that the complexity of spectral entropy changes when the system parameters change. The results show that when β∈(6.2,6.8) and d2∈(0,8) ( Figure 9 a), β∈(4,6) and a3∈(6,10) ( Figure 9 b) and a3∈(10,10.5) and d2∈(4,6) ( Figure 9 c), the spectral entropy is in the high complexity region. As can be seen from the figure, the system has high complexity within the specified range, that is, chaos or hyperchaos exists within these ranges.
[0126] S22, performing a random scrambling operation on the plaintext image to obtain a first scrambled image;
[0127] See also Figure 4 、 Figure 13 and Figure 14 As a preferred solution, in this embodiment, in step S22, the specific steps of the random scrambling operation are:
[0128] Converting the pseudo-random key into a first random one-dimensional vector and a second random one-dimensional vector; converting the plaintext images (images 14a and 14d) into a one-dimensional plaintext vector;
[0129] Perform an Arnold transform on the coordinates of any point of the one-dimensional plaintext vector to obtain a first scrambled image.
[0130] Specifically, in this embodiment, the random scrambling is to generate a pseudo-random number vector X of length 2(M×N) by means of a pseudo-random sequence generator based on a composite memristor hyperchaotic system. Each random number X i ∈{1,2,…,10MN}, then generate random one-dimensional vectors a and b from X, both of size M×N. Then convert the image matrix P into a one-dimensional vector A of size M×N. Perform Arnold transformation on any coordinate position of vector A to obtain the row coordinates (m,n), that is:
[0131]
[0132] Thus we get m=1+aj, n=b+(ab+1)j. Here, we optimize ab+1 as a new random number, still denoted as a, then n=b+aj. Finally, we get the first scrambled image D after scrambling. Figure 14 b and 14e.
[0133] S23. Perform XOR diffusion processing on the first scrambled image using the pseudo-random key to obtain an encrypted image.
[0134] Specifically, in this embodiment, the first scrambled image D is expanded into a one-dimensional vector and compared with the pseudo-random sequence C of length M*N generated by the proposed pseudo-random sequence generator. d ∈{d=1,2,…,M×N} is used for XOR diffusion processing, that is, the final encrypted image is: T=D⊕C, see Figure 8 (c) and (f).
[0135] Next, the encrypted image obtained by processing will be subjected to security analysis.
[0136] 1. Key space and execution efficiency:
[0137] In a specific implementation, the initial value of the state variable of the composite memristor hyperchaotic system of the present invention is used as the original key, and the key space can reach 2 600, equivalent to a 600-bit key length. If system parameters are also used as the original key, the key space is even larger. Therefore, the algorithm for constructing pseudo-random keys in the encryption method provided by this invention is resistant to exhaustive attacks. The experimental hardware environment was a laptop computer with a 1.8 GHz Intel Celeron CPU and 8 GB of memory; the software environment was Windows 7 with the Matlab 2014 compiler. The main means of improving efficiency lies in the use of integer operations and the implementation of a subgraph parallel encryption strategy.
[0138] 2. Histogram and correlation analysis:
[0139] Due to the spectral characteristics of digital images, it is necessary to ensure that the encryption method provided by the present invention has similar security and performance when encrypting any image. The histogram distribution of the ideal ciphertext image should be uniform to prevent attackers from obtaining certain information from the fluctuating histogram. The present invention encrypts the original two-dimensional plaintext image P through the proposed algorithm to obtain an encrypted image similar to noise, such as Figure 14 b and 14e. This invention uses a four-bit layer for image analysis and encryption. While conserving memory, some unimportant values (primarily image micro-detail data that does not affect image visuals) are inevitably lost. In this case, the histogram does not reflect uniformity. Next, we will perform a security analysis on the encrypted image to verify its uniformity.
[0140] The strength of the correlation between adjacent pixels indicates the effectiveness of image encryption. Naturally, the correlation between adjacent pixels in a plaintext image will be high. A good encryption algorithm can eliminate these correlations, preventing attackers from gaining information about the image through correlation. This analysis test randomly selected 1,000 pairs of pixel values from two horizontally, vertically, and diagonally adjacent pixels in the plaintext image P and the encrypted image T. The correlation coefficients shown in Table 6 were then calculated using the correlation coefficient formula (Formula 4). Among the correlation coefficients between the two images, the two correlation coefficients for the encrypted image generated using the encryption method proposed in this invention are the smallest among all comparable algorithms. The existing image encryption algorithm [Ref. 20] has the smallest correlation coefficient. The existing image encryption algorithm [Ref. 21] has the smallest correlation coefficient. Furthermore, the correlation coefficients for the encrypted image generated by the proposed scheme are close to zero in all three directions, effectively eliminating the correlation between adjacent pixels in the planar image, making the resulting image completely unrecognizable. Histogram and correlation tests demonstrate the proposed scheme's resistance to statistical attacks.
[0141] Table 6 Correlation coefficient analysis
[0142]
[0143] 3. Differential attack analysis:
[0144] Differential cryptographic attacks are one of the most effective methods known to date for attacking iterative block ciphers. They involve analyzing the influence of the difference between a plaintext pair and a ciphertext pair to recover certain key bits. The pixel change rate (NPCR) and the uniform average change intensity (UACI) are two widely used metrics for evaluating the strength of image encryption algorithms / ciphers under differential attacks. Assume that the encrypted images after pixel changes of the original plaintext image are P and T, respectively. The pixel values at (i, j) in P and T are represented as P(i, j) and T(i, j), and their bipolar array representations are as shown in Equation (13):
[0145]
[0146] Then NPCR and UACI can be defined using equations (14) and (15):
[0147]
[0148]
[0149] For the reconstructed 4-bit grayscale image (n=4), the results in Table 8 document the significant changes in image pixels between the original and encrypted images. The NPCR and UACI results are calculated as the average of 1000 trials. With only a single pixel change, they show a significant difference in the resulting image, demonstrating strong key sensitivity, sufficient to resist differential attacks.
[0150] Table 8 NPCR and UACI
[0151] image Lena Baboon NPCR (%) 83.4564 83.2596 UACI (%) 34.6828 34.7289
[0152] 4. Image information entropy analysis:
[0153] Information entropy is a measure of system complexity, reflecting the randomness of system information. The more complex the system information is and the more different situations occur, the larger its information entropy is. Its value can be calculated using the information entropy calculation formula, as shown in Table 7. The closer it is to 8 bits, the less likely the algorithm is to leak information. In this invention, the information entropy calculation formula is:
[0154]
[0155] According to Table 7, the entropy value of the original plaintext image is relatively low, and the information entropy of the encrypted image is close to 8. Among the information entropy values of the two images, compared with all references, the entropy value of the encrypted image generated by the algorithm proposed in this invention is relatively close to 8 bits.
[0156] Table 7 Information entropy
[0157] image Lena Baboon Encrypted Image 7.9972 7.9971 Ref.
[24] 7.9972 7.9025 Ref.
[25] 7.8683 Ref.
[26] 7.9030 7.9026
[0158] As a preferred solution, this embodiment also includes an image decryption operation, specifically:
[0159] S31, obtaining a pseudo-random key;
[0160] S32, performing XOR diffusion processing on the encrypted image using the pseudo-random key to obtain a first diffused image;
[0161] S33: Randomly scramble the first diffused image to obtain a plaintext image.
[0162] As a preferred solution, this embodiment further includes a decryption module for implementing the aforementioned image decryption operation. In this case, the receiving module 1 is further configured to transmit the received image to be processed to the decryption module. Preferably, during the image input process, the user is required to select an encryption or decryption function option. If encryption is selected, the image to be processed is transmitted to the encryption module 3; if decryption is selected, the image to be processed is transmitted to the decryption module. The resultant image processed by the decryption module (i.e., the obtained plaintext image) is output and displayed via the output module 4. It should be noted that, after obtaining the pseudo-random key, the decryption module performs the aforementioned image decryption operation on the encrypted image.
[0163] Specifically, the image encryption and decryption method provided by the present invention also includes an image decryption operation, and its specific operation process is the inverse process of the image encryption operation. The processing steps (random scrambling or XOR diffusion processing) and calculation formulas used are the same as those of the image encryption operation, and will not be repeated here.
[0164] The present invention also provides a computer-readable medium storing computer-executable software. The software is constructed using the aforementioned image encryption and decryption system. When executed by a computer, the software implements the aforementioned image encryption algorithm. During execution, the corresponding image encryption or decryption steps are performed according to the functional modules of the image encryption and decryption system. Specifically, the medium can exist independently or attached to an electronic device. As long as the corresponding software is internally provided with the aforementioned image encryption and decryption system, it can implement the aforementioned image encryption and decryption method.
[0165] The present invention also provides an electronic device having the above-mentioned image encryption and decryption system. Specifically, the device form is not limited, as long as it can use corresponding software to implement the above-mentioned image encryption and decryption method.
[0166] In summary, the present invention provides a method for generating a novel hybrid chaotic sequence using three different memristor hyperchaotic systems. A comprehensive cryptographic security analysis was conducted to verify the effectiveness of the proposed pseudorandom sequence generator algorithm in cryptographic applications. The security of the pseudorandom sequence generated by the pseudorandom generation module 2 and the resulting encrypted image were tested using NIST 800-22. This fully demonstrates that the encrypted image generated using the image encryption and decryption method provided by the present invention has extremely high security performance while significantly reducing the storage space involved.
[0167] It is understandable that those skilled in the art can make equivalent substitutions or changes based on the technical solution and inventive concept of the present invention, and all these changes or substitutions should fall within the scope of protection of the claims attached to the present invention.
Claims
1. An image encryption and decryption method, characterized in that: Including image encryption steps: S1, obtaining a plaintext image by decomposing and reconstructing the bit plane of the original image; S2, obtaining a pseudo-random key, and obtaining an encrypted image by randomly scrambling the plaintext image; In step S1, the step of obtaining the plaintext image specifically includes: S11, decomposing the original image to obtain bit planes, and arranging the bit planes from low to high in hierarchy; S12, selecting a plurality of high-order bit planes for reconstruction to obtain a plaintext image; The step S2 specifically includes: S21, obtaining a pseudo-random key; S22, performing a random scrambling operation on the plaintext image to obtain a first scrambled image; S23, performing XOR diffusion processing on the first scrambled image using the pseudo-random key to obtain an encrypted image; In step S22, the specific steps of the random scrambling operation are: Converting the pseudo-random key into a first random one-dimensional vector and a second random one-dimensional vector; converting the plaintext image into a one-dimensional plaintext vector; Performing Arnold transformation on the coordinates of any point of the one-dimensional plaintext vector to obtain a first scrambled image; It also includes image decryption operations, specifically: S31, obtaining a pseudo-random key; The pseudo-random key is generated by a pseudo-random generator, and the pseudo-random generation module has a composite entropy source; the composite entropy source is composed of a four-dimensional memristor hyperchaotic system, a five-dimensional memristor hyperchaotic system, and a six-dimensional memristor hyperchaotic system integrated through random XOR processing, and is used to realize the generation of the pseudo-random key according to the user's key; the specific XOR processing process is: for the real number sequences output by the three memristor hyperchaotic systems, an exclusive OR operation is performed to enhance the randomness, and the generated output sampling is used as the final bit sequence; The pseudo-random generation module uses a composite system composed of a four-dimensional, a five-dimensional and a six-dimensional memristor hyperchaotic system as the entropy source of the pseudo-random number generator; The system equation of the four-dimensional memristor hyperchaotic system is as follows: The flux-controlled memristor used is W(x1)=-βx1, where a1, b1, c1, k1, and β are system parameters; The system equation of the five-dimensional memristor hyperchaotic system is as follows: When the memristor is selected as W(x5)=1-β2|x5|, a2, b2, c2, d2, e2 are system parameters, and x5 and β2 are its flux variables and positive parameters; The system equation of the six-dimensional memristor hyperchaotic system is shown below, which is a memristor model based on flux control. A six-dimensional memristor hyperchaotic system with a line equilibrium point: a3, b3, c3, d3, e3, f3, g3, h3, m, n are system parameters; S32, performing XOR diffusion processing on the encrypted image using the pseudo-random key to obtain a first diffused image; S33: Randomly scramble the first diffuse image to obtain a plaintext image.
2. An image encryption and decryption system using the image encryption and decryption method according to claim 1, characterized in that: It includes a receiving module, a pseudo-random generation module, an encryption module and an output module; The receiving module is used to receive the image to be processed and transmit it to the encryption module; The pseudo-random generation module is used to receive password data and generate a pseudo-random key according to the password data; The encryption module obtains the pseudo-random key and is used to execute the encryption method on the image to be processed to obtain an encrypted image; The output module is used to output the encrypted image.
3. The image encryption and decryption system according to claim 2, characterized in that: The pseudo-random generation module has a composite entropy source; the composite entropy source is composed of a four-dimensional memristor hyperchaotic system, a five-dimensional memristor hyperchaotic system and a six-dimensional memristor hyperchaotic system integrated through random XOR processing, and is used to realize the generation of the pseudo-random key.
4. The image encryption and decryption system according to claim 3, characterized in that: It also includes a decryption module for implementing the image decryption operation described in claim 1.
5. A computer-readable medium, characterized in that Computer executable software is stored, and the software is constructed by the image encryption and decryption system described in any one of claims 2-4. After being executed by the computer, the image encryption algorithm described in claim 1 is implemented. When executed, the corresponding image encryption or decryption operation steps are implemented according to the functional modules of the image encryption and decryption system.
6. An electronic device, characterized in that: An image encryption and decryption system as described in any one of claims 2-4.
