A memristor chaotic image encryption method based on improved Josephus scrambling and cyclic shift

By improving the Josephus chaotic and cyclic shifting methods, combining the pseudo-random sequence generated by the memristor chaotic system, dynamically control the chaotic parameters and perform pixel and binary cyclic displacements, the problem of poor security of encryption algorithms in the prior art is solved, and more efficient image encryption is achieved.

CN117376488BActive Publication Date: 2025-05-23NAVAL UNIV OF ENG PLA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311337062.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-13
Publication Date
2025-05-23
Estimated Expiration
2043-10-13

AI Technical Summary

Technical Problem

In the prior art, the image encryption algorithm has poor security, especially due to the limitation of the key space and the degree of chaotic stagnation, which leads to poor encryption effect.

Method used

The memristor chaotic image encryption method based on improved Josepus chaotic and cyclic shift is adopted. The pseudo-random integer sequence is generated through the memristor chaotic system, and the parameters of Josepus chaotic are dynamically controlled, and the pixel position cyclic displacement and binary cyclic displacement are combined to improve the chaotic effect.

Benefits of technology

It significantly improves the security of the encryption algorithm, enhances the key space and degree of chaos, and improves the encryption effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117376488B_ABST
    Figure CN117376488B_ABST
Patent Text Reader

Abstract

The present application relates to the field of chaotic image encryption technology, and in particular to a memristor chaotic image encryption method based on improved Josephus scrambling and cyclic shift. The present application converts a plaintext image into a first matrix, and then generates a pseudo-random integer sequence through a memristor chaotic system, determines the parameters of the Josephus scrambling algorithm with the value of the pseudo-random integer sequence, and performs Josephus scrambling on the first matrix to obtain a first scrambled matrix, and then performs position cyclic shift scrambling and binary cyclic shift diffusion on the first scrambled matrix to obtain a second scrambled matrix, and finally generates a chaotic matrix through a memristor chaotic system and performs an XOR operation with the second scrambled matrix, and finally obtains a ciphertext matrix to complete encryption. The present application determines the parameters of the Josephus scrambling algorithm through a pseudo-random integer sequence, and then combines it with a cyclic shift algorithm, thereby improving the matrix scrambling effect, thereby improving the security of the encryption algorithm, and solving the problem of poor security of the encryption algorithm in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of chaotic image encryption, and in particular to a memristor chaotic image encryption method based on improved Josephus scrambling and cyclic shift. Background Art

[0002] With the rapid development of Internet technology and the widespread application of social media, the application of digital images in all walks of life is becoming more and more popular. However, in the process of image transmission, due to the freedom, openness and wide sharing of the network, it is extremely vulnerable to unauthorized illegal theft or attack. In order to ensure the security of image transmission, the use of image encryption technology has become one of the most effective means to ensure the security of image information at this stage. However, due to the characteristics of images such as large data volume, high redundancy and strong pixel correlation, traditional text encryption technology is difficult to meet the security requirements of image encryption.

[0003] Chaos is a dynamic motion generated by a nonlinear system. It has the characteristics of ergodicity, non-periodicity and pseudo-randomness. Therefore, it can be used to generate pseudo-random sequences and is widely used in image encryption. In addition, chaotic systems are extremely sensitive to small changes in initial values ​​and parameters, making the initial values ​​and parameters a good encryption key. Therefore, chaos-based encryption methods have become a hot research direction in the field of image encryption. However, most of these image encryption methods use some low-dimensional discrete chaotic systems to encrypt images. At the same time, the scrambling process they use is limited to the row and column transformation of the image pixel level. This easily leads to problems such as limited key space and insufficient scrambling, which in turn results in poor encryption effect.

[0004] Image scrambling is an important part of the image encryption process. At present, Arnold transform, Jigsaw transform, Rubik's cube transform, cellular automaton, etc. are all commonly used scrambling methods. The Josephus-based scrambling method is a scrambling method that has been relatively less studied and has a high degree of scrambling.

[0005] However, in the existing research results, most of the Josephus-based scrambling methods have only improved the counting period during scrambling, and some chaotic systems used to generate pseudo-random sequences use discrete chaotic systems or lower-dimensional chaotic systems. It is impossible to deeply integrate the pseudo-random sequences generated by the chaotic system with the parameters of Josephus scrambling, and the security of the encryption algorithm is poor. Summary of the invention

[0006] The present application provides a memristor chaotic image encryption method based on improved Josephus scrambling and cyclic shift, which solves the problem of poor security of encryption algorithms in the prior art.

[0007] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0008] In an embodiment of the first aspect, the present application provides a memristive chaotic image encryption method based on improved Josephus scrambling and cyclic shift, comprising:

[0009] Convert the plaintext image into a matrix form and use it as the first matrix;

[0010] Generate pseudo-random integer sequences through memristor chaotic systems;

[0011] Determine the parameters of the Josephus scrambling algorithm by the value of the pseudo-random integer sequence, perform Josephus scrambling on the rows and / or columns of the first matrix, and obtain a first scrambled matrix;

[0012] Performing element position cyclic shift scrambling and / or element binary cyclic shift diffusion on the first scrambled matrix using a cyclic shift algorithm to obtain a second scrambled matrix;

[0013] Generating a chaotic matrix through the memristor chaotic system;

[0014] The chaotic matrix and the second scrambled matrix are XORed to obtain a ciphertext matrix to complete encryption.

[0015] The present application converts a plaintext image into a first matrix, generates a pseudo-random integer sequence through a memristor chaotic system, determines the parameters of the Josephus scrambling algorithm with the value of the pseudo-random integer sequence, performs Josephus scrambling on the first matrix, obtains a first scrambled matrix, performs position cyclic shift scrambling and binary cyclic shift diffusion on the first scrambled matrix, obtains a second scrambled matrix, and finally generates a chaotic matrix through a memristor chaotic system and performs an XOR operation with the second scrambled matrix to finally obtain a ciphertext matrix and complete encryption. The present application determines the parameters of the Josephus scrambling algorithm through a pseudo-random integer sequence, and then combines it with a cyclic shift algorithm, thereby improving the matrix scrambling effect, thereby improving the security of the encryption algorithm, and solving the problem of poor security of the encryption algorithm in the prior art.

[0016] In some implementations, converting the plaintext image into a matrix form includes:

[0017] receiving a plaintext image, and when the plaintext image is a trapezoid, a rhombus, a circle or other irregular shapes, padding the number of rows and / or columns of the plaintext image with zeros to obtain a rectangular image;

[0018] Converting the rectangular image into a pixel sequence;

[0019] The pixel sequence is converted into a matrix form, which is used as the first matrix.

[0020] In some implementations, the memristor chaotic system adopts a Chua memristor chaotic system, and the mathematical model of the Chua memristor chaotic system is:

[0021]

[0022] Where W(w)=-0.4+2.4w 2 , w is the magnetic flux of the memristor, α, β, ξ are system parameters.

[0023] In some embodiments, the process of generating a pseudo-random integer sequence includes:

[0024] Selecting a first key according to the initial values ​​of the state variables and system parameters of the Chua memristor chaotic system, bringing the first key into the Chua memristor chaotic system, and obtaining four groups of first pseudo-random sequences;

[0025] The four groups of the first pseudo-random sequences are rounded to obtain four groups of the pseudo-random integer sequences, which are a first pseudo-random integer sequence, a second pseudo-random integer sequence, a third pseudo-random integer sequence, and a fourth pseudo-random integer sequence.

[0026] In some implementations, the Josephus scrambling algorithm is expressed as:

[0027]

[0028] Among them, n represents the total number, s represents the counting starting point, p represents the counting period, and d represents the counting direction.

[0029] In some implementations, when Josephus scrambling is performed on a row, the counting starting point is determined by the value of the first pseudo-random integer sequence; the counting period is determined by the value of the second pseudo-random integer sequence; and the counting direction is determined by the value of the third pseudo-random integer sequence.

[0030] In some implementations, when Josephus scrambling is performed on a column, the counting starting point is determined by the value of the second pseudo-random integer sequence; the counting period is determined by the value of the first pseudo-random integer sequence; and the counting direction is determined by the value of the fourth pseudo-random integer sequence.

[0031] In some embodiments, when performing the element position circular shift scrambling, a position circular shift scrambling algorithm is used to determine the left or right shift step of the element by the value of the first pseudo-random integer sequence corresponding to the row where the element is located in the first scrambling matrix; and determine the up or down step of the element by the value of the second pseudo-random integer sequence corresponding to the column where the element is located.

[0032] In some embodiments, when performing the binary cyclic shift of the elements, the elements in the first scrambled matrix are converted into binary, and a binary cyclic shift algorithm is used to determine the number of bits by which the elements in each row are cyclically shifted left or right by the value of the second pseudo-random integer sequence corresponding to the row where the elements in the first scrambled matrix are located; and the number of bits by which the elements in each column are cyclically shifted left or right by the value of the first pseudo-random integer sequence corresponding to the column where the elements in the first scrambled matrix are located is determined.

[0033] In some embodiments, the chaotic matrix generation process includes:

[0034] Selecting a second key according to the state variables of the Chua memristor chaotic system and the initial values ​​of the system parameters;

[0035] Bringing the second key into the Chua memristor chaotic system to obtain four sets of second pseudo-random sequences;

[0036] Rounding the two groups in the second pseudo-random sequence respectively, performing an XOR operation modulo 256, and obtaining a first sequence;

[0037] Round off the other two groups in the second pseudo-machine sequence respectively, perform an XOR operation modulo 256, and obtain a second sequence;

[0038] The first sequence and the second sequence are cross-arranged and converted into a matrix form as a chaotic matrix.

[0039] Beneficial Effects

[0040] The present application introduces a chaotic pseudo-random sequence to improve the traditional Josephus scrambling, and can dynamically control the counting starting point, counting cycle and counting direction of the Josephus scrambling, thereby improving the scrambling effect.

[0041] This application adopts a high-dimensional memristor chaotic system with stronger irregularity and pseudo-randomness, and combines improved Josephus scrambling with pixel position cyclic displacement and pixel point binary cyclic displacement to perform scrambling and diffusion, thereby improving the security of the algorithm.

[0042] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0044] The methods, systems and / or programs in the accompanying drawings will be further described according to exemplary embodiments. These exemplary embodiments will be described in detail with reference to the drawings. These exemplary embodiments are non-limiting exemplary embodiments, wherein example numbers represent similar mechanisms in the various views of the accompanying drawings.

[0045] Figure 1 It is a flow chart of a memristor chaotic image encryption method based on improved Josephus scrambling and cyclic shift in one embodiment;

[0046] Figure 2 is a transient diagram of each component of Chua memristor chaos in one embodiment;

[0047] Figure 3 is a schematic diagram of Josephus transformation in one embodiment;

[0048] Figure 4 is a schematic diagram of the corresponding positional relationship between a pseudo-random integer sequence and matrix rows and columns in one embodiment;

[0049] Figure 5 is a schematic diagram of a CST of cyclic displacement of element positions in one embodiment;

[0050] Figure 6 is a schematic diagram of a binary circulative shift CircShift in one embodiment;

[0051] Figure 7 is a decryption flow chart in one embodiment;

[0052] Figure 8 This is a comparison effect diagram of a plaintext image and a ciphertext image in one embodiment;

[0053] Fig. 9 is a key space comparison table in the embodiment;

[0054] Fig.10 This is a comparison diagram of an image decrypted using a correct key and an image decrypted using a slightly changed key in an embodiment;

[0055] Fig.11 is a key sensitivity comparison table in one embodiment;

[0056] Fig.12 is a histogram of an image before and after encryption in one embodiment;

[0057] Fig.13 This is a comparison diagram of the correlation between adjacent pixels before and after encryption in one embodiment;

[0058] Fig.14 is a comparison table of correlations between adjacent pixels before and after encryption in one embodiment;

[0059] Fig.15 is an information entropy comparison table in one embodiment. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0061] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0062] In the description of the present invention, it should be noted that the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0063] See also Figure 1 In the first aspect of the embodiment, the present application provides a memristive chaotic image encryption method based on improved Josephus scrambling and cyclic shift, comprising:

[0064] S1. Convert the plaintext image into a matrix form and use it as the first matrix.

[0065] In some implementations, converting the plaintext image into a matrix form includes:

[0066] S11. Receive a plaintext image. When the plaintext image is in a non-rectangular shape, pad the number of rows and / or columns of the plaintext image with zeros to obtain a rectangular image.

[0067] Specifically, the non-rectangular shape includes: trapezoid, rhombus, circle or other irregular shapes.

[0068] S12. Convert the aforementioned rectangular image into a pixel sequence.

[0069] S13. Convert the pixel sequence into a matrix form and use it as the first matrix.

[0070] S2. Generate pseudo-random integer sequences through memristive chaotic systems.

[0071] In some implementations, the aforementioned memristor chaotic system adopts a Chua memristor chaotic system, and the mathematical model of the Chua memristor chaotic system is shown in formula (1):

[0072]

[0073] Where W(w)=-0.4+2.4w 2 , w is the magnetic flux of the memristor, α, β, ξ are system parameters.

[0074] It should be noted that memristor is an emerging electronic component. Its concept was first proposed by Cai Shaotang in 1971 and is considered to be the fourth basic electronic component that describes the relationship between charge and magnetic flux. This component has the advantages of non-volatility, low power consumption and high speed. Compared with ordinary chaos, memristor chaotic system has stronger irregularity and pseudo-randomness, so it has received widespread attention in many application fields. However, the research on using memristor chaotic system in the field of image encryption is still in its initial stage. In the existing research results, memristor chaotic system has expanded the research ideas of image encryption algorithm and significantly improved the security performance of image encryption algorithm, but most of the research results only use memristor chaotic system to generate pseudo-random sequence for diffusion, and do not use memristor chaotic pseudo-random sequence to control the parameters of scrambling algorithm, resulting in low scrambling efficiency. The scrambling method used in some research results is too simple, only using part of the pseudo-random sequence generated by the memristor chaotic system, and not making full use of the key space of the memristor chaotic system. Most of the scrambling methods based on Josephus have only improved the counting cycle during scrambling, and some chaotic systems used to generate pseudo-random sequences use discrete chaotic systems or lower-dimensional chaotic systems, which cannot deeply fuse the pseudo-random sequences generated by the chaotic system with the parameters of Josephus scrambling, thus seriously affecting the image encryption effect. In view of this, the present application uses the Chua memristor chaotic system to generate four sets of pseudo-random sequences, and improves the Josephus scrambling algorithm, adding parameters for controlling the counting direction, so that the parameters of the Josephus scrambling algorithm correspond to the generated pseudo-random sequences, and better fuse them, thereby improving the scrambling effect.

[0075] Furthermore, the initial value of the state variable and the system parameters of the Chua memristor chaotic system are used as the components of the first key. The first key is substituted into formula (1) to obtain four sets of first pseudo-random sequences: k , y′k , z′ k , w′ k , and then round the four groups of first pseudo-random sequences by formula (2) to obtain the first pseudo-random integer sequence, the second pseudo-random integer sequence, the third pseudo-random integer sequence and the fourth pseudo-random integer sequence x k ,y k , z k , w k , the expression of formula (2) is as follows:

[0076]

[0077] Among them, floor means rounding down.

[0078] It should be noted that in the process of using chaotic systems to generate pseudo-random sequences, the difference between each group of pseudo-random sequences will not be obvious in the initial stage due to transient effects. For example, two groups of data with initial values ​​of [0.01, 0, 0, 0] and [0.01001, 0.001, 0.001, 0.001] are substituted into the fourth-order Runge-Kutta equation with a step size of 0.1 to solve the Chua memristor chaotic system, and two groups of pseudo-random sequences are obtained. The two groups of pseudo-random sequences are subtracted one by one to obtain transient diagrams in four directions, as shown in Figure 1. Figure 2 As shown in the figure, it can be seen that when two sets of initial values ​​with very small differences are substituted, the difference is not obvious at first, but as time goes by, the difference increases significantly. In order to avoid the negative impact of transient properties on the encryption effect in the initial period, we exclude the part with small differences in the early stage and select the chaotic pseudo-random sequence with huge differences in the later stage for image encryption.

[0079] Preferably, when the first key is substituted into formula (1), the Runge-Kutta method with a step size of 0.1 is used to iterate and the first 500 items are removed to obtain the first pseudo-random sequence.

[0080] S3. Determine the parameters of the Josephus scrambling algorithm through the value of the pseudo-random integer sequence, perform Josephus scrambling on the rows and / or columns of the first matrix, and obtain a first scrambled matrix.

[0081] In some implementations, the expression of the Josephus scrambling algorithm is shown in formula (3):

[0082]

[0083] Among them, n represents the total number, s represents the counting starting point, p represents the counting period, and d represents the counting direction.

[0084] See also Figure 3It can be understood that Josephus scrambling, also known as Josephus permutation, can be summarized as the following mathematical model: q = Josephus (n, s, p), where n represents the total number, s represents the starting point, and p represents the counting cycle, which is counted in a clockwise direction. Figure 3 As shown, if n=8, s=1, p=3, the starting position is 1 and the counting period is 3, so the first number to leave the circle is 3, the next one starts counting from 4, the counting period is 3, and the second number to leave the circle is 6. Repeat this process until the last element, and finally get the Josephus sequence q={3,6,1,5,2,8,4,7}. In short, as long as n, s and p are selected, the Josephus sequence q is unique. However, the sequence changes produced by traditional Josephus scrambling are relatively few and lack randomness, so it is necessary to increase disturbances to improve the effect of scrambling. This application introduces the parameter d, and the counting direction can be changed according to the value of d, which increases the change effect of Josephus scrambling.

[0085] Further, when the first matrix is ​​row-scrambled, the total number n is the total number of rows M of the first matrix, the first pseudo-random integer sequence is processed by formula (4), the result is used as the counting starting point s, the second pseudo-random integer sequence is processed by formula (5), the result is used as the counting period p, the value of the third pseudo-random sequence is modulo 2, and the result is used as the counting direction d. The expressions of formula (4) and formula (5) are as follows:

[0086] x i mod(M+1-i)(i=1,2,3...M) (4)

[0087] y i mod(M+1-i)(i=1,2,3...M) (5)

[0088] Further, when the first matrix is ​​scrambled, the total number n is the total number of columns N of the first matrix, the second pseudo-random integer sequence is processed by formula (6), the result is used as the counting starting point s, the first pseudo-random integer sequence is processed by formula (7), the result is used as the counting period p, the value of the fourth pseudo-random sequence is modulo 2, and the result is used as the counting direction d. The expressions of formula (6) and formula (7) are as follows:

[0089] y j mod(N+1-j)(j=1,2,3...N) (6)

[0090] x j mod(N+1-j)(j=1,2,3...N) (7)

[0091] It can be understood that there is no order for the aforementioned row scrambling and column scrambling. The row scrambling may be performed first and then the column scrambling, or the column scrambling may be performed first and then the row scrambling.

[0092] See also Figure 4 It can be understood that, in the first scrambled matrix obtained after the first matrix is ​​subjected to the aforementioned row scrambling and column scrambling, its rows and columns form a corresponding relationship with the pseudo-random integer sequence, Figure 4 The corresponding relationship between the first scrambling matrix and the pseudo-random integer sequence in one embodiment is given, for example, the first row and x 1 Correspondingly, the second line is x 2 Corresponding to... row i and x i Corresponding to...the mth row and x m The first column corresponds to y 1 Correspondingly, the second column is 2 Corresponding to...the jth column and y j Corresponding to...the nth column and y n correspond.

[0093] S4. Performing element position cyclic shift scrambling and / or element binary cyclic shift diffusion on the first scrambled matrix using a cyclic shift algorithm to obtain a second scrambled matrix.

[0094] It can be understood that the element position cyclic shift scrambling can realize the cyclic shift of the sequence by cyclically shifting the elements of a sequence to the right or left so that the highest or lowest bit of the sequence wraps around to the other end of the sequence. The specific mathematical model is shown in formula (8):

[0095] H 1 =CST(M,r,c), (8)

[0096] Among them, M is the matrix before cyclic shift, H 1 is the matrix after cyclic shift, r is the step size of cyclic left or right shift, c is the step size of cyclic up or down shift, connect the elements of each column or row into a ring, and cyclically shift r or c steps in this ring respectively, such as Figure 5 As shown, the row is rotated right by 2 bits.

[0097] It can be understood that the element binary cyclic shift diffusion takes a specific element as the operation unit, converts the value of the element into binary form, and achieves the diffusion effect by shifting the binary number to the left or right by a specified number of bits. The specific mathematical model is shown in formula (9):

[0098] Η 2 =CircShift(t,c), (9)

[0099] Where t is the element to be shifted in binary cycle, c is the number of bits (number of digits) of the cyclic right or left shift, and H 2 is the final result after cyclic shift, such as Figure 6 As shown, all elements in the column are converted to binary and then circularly shifted right by two bits.

[0100] In some implementations, when performing cyclic shift scrambling of element positions, the values ​​of the first pseudo-random integer sequence corresponding to the rows in the first scrambling matrix are substituted into formula (8) so that each row is cyclically shifted right by x. i modN bits, substitute the value of the second pseudo-random integer sequence corresponding to the column in the first scrambled matrix into equation (8), so that each column is cyclically shifted up by i modM bit.

[0101] In some embodiments, when performing binary cyclic shift of elements, the elements in the first scrambled matrix are converted to binary, and the values ​​of the second pseudo-random integer sequence corresponding to the rows in the first scrambled matrix are substituted into formula (9) so that the elements of each row are cyclically shifted right by y. i Mod 8 bits, substitute the value of the first pseudo-random integer sequence corresponding to the column in the first scrambled matrix into equation (9), so that the elements of each column are cyclically shifted to the left by x i mod8 bits.

[0102] S5. Generate chaotic matrix through chaotic system.

[0103] In some embodiments, the chaotic matrix generation process includes:

[0104] S51. Select a second key according to the state variables of the Chua memristor chaotic system and the initial values ​​of the system parameters.

[0105] S52. Bring the second key into the Chua memristor chaotic system to obtain four sets of second pseudo-random sequences: Then, the four groups of second pseudo-random sequences are rounded by formula (10) to obtain the first pseudo-random integer sequence, the second pseudo-random integer sequence, the third pseudo-random integer sequence and the fourth pseudo-random integer sequence: The expression of formula (10) is as follows:

[0106]

[0107] Among them, floor means rounding down.

[0108] S53. Perform an XOR operation on the first pseudo-random integer sequence and the second pseudo-random integer sequence obtained above, modulo 256, to obtain a first sequence.

[0109] S54. Perform an XOR operation on the third pseudo-random integer sequence and the fourth pseudo-random integer sequence obtained above, modulo 256, to obtain a second sequence.

[0110] S55. Alternately arrange the first sequence and the second sequence, and convert them into a matrix form as a chaotic matrix.

[0111] S6. Perform an XOR operation on the chaotic matrix and the second scrambled matrix to obtain a ciphertext matrix, thus completing encryption.

[0112] See also Figure 7 In an embodiment of the second aspect, the present application provides a decryption method, comprising:

[0113] V1. Convert the ciphertext image into a matrix form and use it as the ciphertext matrix.

[0114] V2. Select the second key used by the encryption party, adopt the memristor chaotic system used by the encryption party, and obtain four groups of second pseudo-random sequences. After integerization according to formula (10), the first two groups are respectively modulo 256 and then XOR operation is performed to obtain the first sequence. The second two groups after integerization are respectively modulo 256 and then XOR operation is performed to obtain the second sequence. The first sequence and the second sequence are cross-arranged and converted into a matrix form, which is used as a chaotic matrix.

[0115] V3. Perform an XOR operation on the ciphertext matrix and the chaotic matrix to obtain the second scrambled matrix.

[0116] V4. Select the first key used by the encryption party, adopt the memristive chaotic system used by the encryption party, obtain four groups of first pseudo-random integer sequences, determine the coefficients of the cyclic shift algorithm according to the value of the first pseudo-random integer sequence according to the scrambling method used by the encryption party, perform inverse element cyclic shift and inverse binary cyclic shift diffusion on the second scrambled matrix and the elements in the second scrambled matrix respectively, and obtain the first scrambled matrix.

[0117] V5. Determine the coefficients of the Josephus scrambling algorithm by the value of the first pseudo-random integer sequence, and perform Josephus scrambling on the columns and / or rows of the first scrambling matrix according to the method used by the encryption party to obtain the first matrix.

[0118] V6. Convert the first matrix into an image form, obtain the plaintext image, and complete the decryption operation.

[0119] The following is an explanation of the beneficial effects of the present application through simulation results and performance analysis. The present invention conducts a comprehensive analysis of the performance of the encryption algorithm and uses Matlab 2021a software to conduct a simulation experiment on a computer. The specific operating environment is as follows: Intel(R) Core(TM) i7-9750H CPU@2.60GHz 2.59GHz, 16GB memory, 64-bit Windows 11 operating system. The plaintext image and the encrypted ciphertext image are shown in Figure 2. Figure 8 shown.

[0120] Next, the algorithm is analyzed through image encryption performance indicators such as key space, histogram, information entropy, and adjacent pixels.

[0121] Key space analysis:

[0122] The key space refers to the total number of all possible keys that can be used for encryption and decryption in an encryption system. The keys provided by the algorithm of the present invention specifically include Each set of pseudo-random sequences is taken to 15 decimal places, and the precise value of the system parameter is taken to 4 decimal places, so the size of the key space is (10 4 ) 3 ×(10 15 ) 8 =10 132 ≈2 437 , far exceeding the current limit that can be achieved through brute force cracking2 100 Assuming that an image encryption algorithm with a 128-bit key is used and that 10,000 decryption operations can be performed per nanosecond, the total time required to crack the algorithm will be at least 5.3×10 17 From this we can see that the encryption scheme we provide has a large enough key space to meet actual security needs. Fig. 9 The key space comparison between the encryption algorithm of the present invention and the existing encryption algorithms is shown. Fig. 9The data results in this paper come from the analysis of references, including: [1] Wang X, Sun HA chaotic image encryption algorithm based on improved Joseph traversal and cyclic shift function [J]. Optics & Laser Technology, 2020, 122: 105854, [2] Wang R, Deng GQ, Duan X F. An image encryption scheme based on double chaotic cyclic shift and Josephus problem [J]. Journal of Information Security and Applications, 2021, 58: 102699, [3] Yang N, Zhang S, Bai M, et al. Medical image encryption based on Josephus traversing and hyperchaotic Lorenz system [J]. Journal of Shanghai Jiao Tong University, 2022, 12: 1-18 and [4] Niu Y, Zhou H, Zhang X. Hybrid encryption algorithm based on gray curve and Josephus permutation[J]. Computational Intelligence and Neuroscience, 2022, 2022: 7076416.

[0123] Key sensitivity analysis:

[0124] First use the key Encrypt the plaintext image to get the ciphertext image, then use the correct key and a slightly changed key Decrypt the ciphertext image, and the decrypted image is as follows Fig.10 As shown. From the decryption result Fig.10 It can be seen that even if the key is only slightly changed, the result obtained after decryption by the encryption algorithm is completely different.

[0125] The pixel change rate (NPCR) and unified average change intensity (UACI) of the four initial values ​​are calculated. Fig.11As shown, it is concluded that NPCR and UACI are very close to the ideal values ​​NPCR = 99.6094% and UACI = 33.4635%, which shows that the algorithm is highly sensitive to key changes and can provide better defense protection.

[0126] Histogram analysis:

[0127] The histogram describes the distribution of pixel values ​​in an image. If the distribution is uneven, an attacker may be able to obtain a certain amount of information through statistical analysis. Therefore, in a good encryption algorithm, the ciphertext image must present a uniformly distributed histogram. Fig.12 The histograms of the plaintext image and the ciphertext image are shown. In comparison, it can be found that the histogram distribution of the plaintext image is very uneven, and it is easy for an attacker to obtain the original image by statistically analyzing the distribution of grayscale values. However, after encryption by the algorithm, the generated cipher image has a relatively uniform histogram distribution, and the difference between each grayscale value is small, which means that it is difficult for an attacker to obtain any valid information of the original image through statistical analysis.

[0128] Adjacent pixel correlation analysis:

[0129] There is a strong correlation between the pixels of ordinary images, so it is necessary to reduce the correlation from a security perspective so that the correlation between adjacent elements in the encrypted image should be as small as possible, including horizontal correlation, vertical correlation and diagonal correlation. When the correlation properties of adjacent elements are completely destroyed, it is difficult for attackers to crack the ciphertext image through statistical analysis.

[0130] In order to test the correlation between adjacent pixels, pixel pairs are selected from three directions respectively, and their correlation coefficients are calculated to simulate the correlation comparison diagram of adjacent pixels before and after encryption (such as Fig.13 ), the specific values ​​are as follows Fig.14 shown. Fig.14 The correlation coefficients of the images in three directions after encryption are shown, as well as the comparison results with other literature. Fig.13 The results of correlation test before and after image encryption are also shown after randomly selecting pixels. The experimental results show that the plaintext image has a high correlation in three directions, while the encrypted image has almost no correlation. Therefore, the encryption algorithm of the present invention can effectively prevent attacks similar to statistical analysis. Fig.14 The data results are derived from the analysis of the aforementioned references [1] to [4].

[0131] Information entropy analysis:

[0132] Information entropy is an important indicator to measure the encryption effect of encryption algorithms. The ideal value of information entropy of a good encryption algorithm should be close to 8. According to the information entropy formula, we can get the information entropy and compare the results with other literature, such as Fig.15 As shown. The entropy of the encryption result of the present invention is significantly higher than that of the original image and other documents, and is very close to 8, which shows that the algorithm of the present invention has a good encryption effect. In order to avoid the unfair influence of information entropy on random measurement of images of different sizes, the local information entropy of the ciphertext image is calculated. Assuming that the number of selected regions K = 40, the total number of pixels in a single region T B =43×43, calculate the local information entropy Although the result is smaller than the global information entropy, it is also very close to 8, indicating that the ciphertext image encrypted by the algorithm of the present invention has good local randomness. Fig.15 The data results are derived from the analysis of references [1] to [4].

[0133] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application. The scope of the present application is defined by the claims and their equivalents.

Claims

1. Memristive chaos image encryption method based on improved Josephus scrambling and cyclic shift, It is characterized in that include: Convert the plaintext image into a matrix form and use it as the first matrix; Generate pseudo-random integer sequences through memristor chaotic systems; The memristor chaotic system adopts the Chua memristor chaotic system, and the mathematical model of the Chua memristor chaotic system is shown in formula (1): Where W(w)=-0.4+2.4w 2 , w is the magnetic flux of the memristor, α, β, ξ are system parameters; Taking the initial value of the state variable and the system parameters of the Chua memristor chaotic system as the components of the first key, substituting the first key into equation (1), we get four sets of first pseudo-random sequences: k , y′ k , z′ k , w′ k , and then round the four groups of first pseudo-random sequences by formula (2) to obtain the first pseudo-random integer sequence, the second pseudo-random integer sequence, the third pseudo-random integer sequence and the fourth pseudo-random integer sequence x k ,y k , z k , w k , the expression of formula (2) is as follows: Among them, floor means rounding down; Determine the parameters of the Josephus scrambling algorithm by the value of the pseudo-random integer sequence, perform Josephus scrambling on the rows and / or columns of the first matrix, and obtain a first scrambled matrix; The expression of the Josephus scrambling algorithm is shown in formula (3): Among them, n represents the total number, s represents the counting starting point, p represents the counting period, and d represents the counting direction; When the first matrix is ​​scrambled, the total number n is the total number of rows M of the first matrix, the first pseudo-random integer sequence is processed by formula (4), the result is used as the counting starting point s, the second pseudo-random integer sequence is processed by formula (5), the result is used as the counting period p, the value of the third pseudo-random sequence is modulo 2, and the result is used as the counting direction d; The expressions of formula (4) and formula (5) are as follows: x i mod(M + 1 - i) (i = 1, 2, 3... M) (4) y i mod(M+1-i)(i=1,2,3...M) (5) When the first matrix is ​​scrambled, the total number n is the total number of columns N of the first matrix, the second pseudo-random integer sequence is processed by formula (6), and the result is used as the counting starting point s, the first pseudo-random integer sequence is processed by formula (7), and the result is used as the counting period p, the value of the fourth pseudo-random sequence is modulo 2, and the result is used as the counting direction d; the expressions of formula (6) and formula (7) are as follows: y j mod(N+1-j)(j=1,2,3...N) (6) x j mod(N+1-j)(j=1,2,3...N) (7) In the first scrambled matrix obtained after performing the aforementioned row scrambling and column scrambling on the first matrix, its rows and columns form a corresponding relationship with the pseudo-random integer sequence; Performing element position cyclic shift scrambling and / or element binary cyclic shift diffusion on the first scrambled matrix using a cyclic shift algorithm to obtain a second scrambled matrix; Generating a chaotic matrix through the memristor chaotic system; The chaotic matrix and the second scrambled matrix are XORed to obtain a ciphertext matrix to complete encryption.

2. The memristor chaotic image encryption method based on improved Josephus scrambling and cyclic shift as claimed in claim 1, It is characterized in that The converting of the plaintext image into a matrix form comprises: receiving a plaintext image, and when the plaintext image is of an irregular shape, padding the number of rows and / or columns of the plaintext image with zeros to obtain a rectangular image; Converting the rectangular image into a pixel sequence; The pixel sequence is converted into a matrix form, which is used as the first matrix.

3. The memristor chaotic image encryption method based on improved Josephus scrambling and cyclic shift as claimed in claim 1, It is characterized in that When performing the element position circular shift scrambling, a position circular shift scrambling algorithm is used to determine the left or right shift step of the element by the value of the first pseudo-random integer sequence corresponding to the row where the element is located in the first scrambling matrix; and determine the up or down step of the element by the value of the second pseudo-random integer sequence corresponding to the column where the element is located.

4. The memristor chaotic image encryption method based on improved Josephus scrambling and cyclic shift as claimed in claim 1, It is characterized in that When performing the binary cyclic shift of the elements, the elements in the first scrambled matrix are converted into binary, and a binary cyclic shift algorithm is used to determine the number of bits of the elements in each row to be cyclically shifted left or right by the value of the second pseudo-random integer sequence corresponding to the row where the elements in the first scrambled matrix are located; The number of bits by which the elements in each column are cyclically shifted left or right is determined by the value of the first pseudo-random integer sequence corresponding to the column where the elements in the first scrambling matrix are located.

5. The memristor chaotic image encryption method based on improved Josephus scrambling and cyclic shift as claimed in claim 1, It is characterized in that The generation process of the chaotic matrix includes: Selecting a second key according to the state variables of the Chua memristor chaotic system and the initial values ​​of the system parameters; Bringing the second key into the Chua memristor chaotic system to obtain four sets of second pseudo-random sequences; Rounding the two groups in the second pseudo-random sequence respectively, performing an XOR operation modulo 256, and obtaining a first sequence; Round off the other two groups in the second pseudo-random sequence respectively, perform an XOR operation modulo 256, and obtain a second sequence; The first sequence and the second sequence are cross-arranged and converted into a matrix form as a chaotic matrix.

Citation Information

Patent Citations

  • Image encryption method based on improved magic cube transformation and memristor chaos

    CN113129195A