An image encryption method based on memristive chaos and block Josephus scrambling

By combining the memristor chaotic system and blocked Josephus image encryption method, the problem of poor encryption effect in the prior art is solved, and higher chaotic effect and security are achieved.

CN117376489BActive Publication Date: 2025-04-29NAVAL UNIV OF ENG PLA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311343302.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-13
Publication Date
2025-04-29
Estimated Expiration
2043-10-13

AI Technical Summary

Technical Problem

In the prior art, the image encryption method based on Josephus messing is poor in encryption effect, and the pseudo-random sequence of the chaotic system does not blend deeply with the parameters of the messing algorithm.

Method used

An image encryption method is adopted that combines pseudo-random integer sequences and blocked Josephus chaotic system based on memristor chaotic system. The specific steps include converting the plaintext image into a pixel matrix, generating four sets of pseudo-random integer sequences through the memristor chaotic system, using these sequences to determine the parameters of the Josephus chaotic algorithm, chaotic rows and chunks of the pixel matrix, and finally generating a ciphertext image through pixel diffusion.

Benefits of technology

By deeply integrating the memristor chaotic system and the Josephus chaotic algorithm, the chaotic effect and security of image encryption are significantly improved, and the problem of poor encryption effect in the existing technology is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117376489B_ABST
    Figure CN117376489B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of chaotic image encryption technology, and in particular to an image encryption method based on memristor chaos and block Josephus scrambling. The present application converts a plaintext image into a pixel matrix, and then generates four groups of pseudo-random integer sequences through a memristor chaos system, combines the values ​​of two groups with an improved Josephus scrambling algorithm, scrambles the pixel matrix in rows and columns, obtains a first scrambled matrix, and then divides the first scrambled matrix into blocks, combines another group of pseudo-random integer sequences with the Josephus scrambling algorithm to scramble each sub-block to obtain a second scrambled matrix, and finally uses the remaining group of pseudo-random integer sequences to perform pixel diffusion on the second scrambled matrix and convert it into a ciphertext image. The pseudo-random integer sequence can correspond to the parameters of the Josephus scrambling algorithm, can better combine the memristor chaos system with the scrambling algorithm, scramble the matrix in rows and columns, and then scramble the matrix in blocks, and then diffuse the elements of the matrix, so as to achieve a strong encryption effect, and solve the problem of poor encryption effect in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of chaotic image encryption, and in particular to an image encryption method based on memristor chaos and block Josephus scrambling. Background Art

[0002] As human society enters the era of information network and intelligence, communication between people is becoming more and more frequent. Image information is favored by people due to its intuitiveness, and a lot of transmitted information appears in the form of images. However, image information containing personal privacy information and confidential information is vulnerable to attacks and information leakage during transmission. Therefore, it is imperative to design an efficient and highly encrypted image encryption algorithm to protect the security of image information. On the other hand, due to the characteristics of high redundancy, huge data volume, and strong pixel correlation, traditional text encryption technology is not suitable for image encryption and cannot meet its security requirements. Chaotic systems are very suitable for chaotic image encryption due to their initial value sensitivity, non-periodicity, and pseudo-randomness. Combining chaotic systems with scrambling methods is the main direction of current research on chaotic image encryption. The mainstream scrambling methods used in the prior art include Arnold transform, Rubik's cube transform, etc. Relatively speaking, Josephus transform is a scrambling method with better scrambling effect and less research. In the existing research results, most of the Josephus-based scrambling only improves the counting period during scrambling, and some chaotic systems used to generate pseudo-random sequences adopt discrete chaotic systems or lower-dimensional chaotic systems, which cannot deeply integrate the pseudo-random sequences generated by the chaotic systems with the parameters of Josephus scrambling, thus seriously affecting the image encryption effect and resulting in poor encryption effect. Summary of the invention

[0003] The present application provides an image encryption method based on memristor chaos and block Josephus scrambling, which solves the problem of poor encryption effect in the prior art.

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

[0005] In an embodiment of the first aspect, the present application provides an image encryption method based on memristive chaos and block Josephus scrambling, comprising:

[0006] Convert the plaintext image into a pixel matrix;

[0007] Generate four sets of pseudo-random integer sequences through a memristor chaotic system;

[0008] Determine the parameters of the Josephus scrambling algorithm by using the values ​​of the two sets of pseudo-random integer sequences, and perform Josephus scrambling on the rows and / or columns of the pixel matrix to obtain a first scrambled matrix;

[0009] Dividing the first scrambled matrix into a number of sub-blocks, determining the parameters of the Josephus scrambling algorithm by using another set of values ​​of the pseudo-random integer sequence, and performing Josephus scrambling on the sub-blocks respectively to obtain a second scrambled matrix;

[0010] The remaining set of pseudo-random integer sequences is used to perform pixel diffusion on the second scrambled matrix and convert it into a ciphertext image to complete the encryption operation.

[0011] The present application converts a plaintext image into a pixel matrix, and then generates four sets of pseudo-random integer sequences through a memristor chaotic system, combines the values ​​of two sets of pseudo-random integer sequences with the Josephus scrambling algorithm, scrambles the pixel matrix in rows and columns, obtains a first scrambled matrix, and then divides the first scrambled matrix into blocks, combines the values ​​of another set of pseudo-random integer sequences with the Josephus scrambling algorithm to scramble each sub-block to obtain a second scrambled matrix, and finally uses the remaining set of pseudo-random integer sequences to diffuse the pixels of the second scrambled matrix and convert it into a ciphertext image, thereby completing the encryption operation. The pseudo-random integer sequence can correspond to the parameters of the Josephus scrambling algorithm, and the memristor chaotic system is well combined with the scrambling algorithm. The present application scrambles the matrix in rows and columns and then scrambles it in blocks, and finally diffuses the elements of the matrix, thereby achieving a strong encryption effect and solving the problem of poor encryption effect in the prior art.

[0012] In some implementations, converting the plaintext image into a pixel matrix includes:

[0013] 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;

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

[0015] The pixel sequence is converted into a matrix form and used as a pixel matrix.

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

[0017]

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

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

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

[0021] The four groups of the first pseudo-random sequences are rounded to obtain four groups of pseudo-random integer sequences, namely 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.

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

[0023] q 2 =Josephus(n,s,p),

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

[0025] In some implementations, performing Josephus scrambling on the rows of the pixel matrix includes:

[0026] Select half of the pixel matrix by row to perform Josephus scrambling: select M / 2 as the total number, where M represents the total number of rows of the pixel matrix; and process the value of the first pseudo-random integer sequence by the following formula:

[0027] x i mod[floor(M / 2-i)](i=1,2,3,...,M / 2),

[0028] Among them, x i represents the first pseudo-random integer sequence, and uses the obtained result as the counting starting point; selects a subsequence in the fourth pseudo-random integer sequence as the first periodic subsequence, and uses the value of the first periodic subsequence as the counting period p; places the scrambled rows in the upper half of the pixel matrix, and places the unscrambled rows in the lower half of the pixel matrix.

[0029] In some implementations, performing Josephus scrambling on the columns of the pixel matrix includes:

[0030] Select half of the pixel matrix by column to perform Josephus scrambling: select N / 2 as the total number, where N represents the total number of columns of the pixel matrix; and process the value of the second pseudo-random integer sequence by the following formula:

[0031] yi mod[floor(N / 2-i)](i=1,2,3,...,N / 2),

[0032] Among them, y i represents the second pseudo-random integer sequence, and uses the obtained result as the counting starting point; selects a subsequence in the fourth pseudo-random integer sequence as the second periodic subsequence, and uses the value of the second periodic subsequence as the counting period; places the scrambled columns in the left half of the pixel matrix, and places the unscrambled columns in the right half of the pixel matrix.

[0033] In some implementations, the generation process of the second scrambling matrix includes:

[0034] Divide the first scrambled matrix into a plurality of sub-blocks of the same size, the number of the sub-blocks being determined by the components in the key, and number the sub-blocks;

[0035] Divide the third pseudo-random integer sequence into a plurality of subsequences, the number of the subsequences being the same as the number of elements in the sub-blocks, and the number of elements in the subsequences being the same as the number of the sub-blocks;

[0036] Performing Josephus scrambling on the sub-block to obtain the second scrambling matrix: selecting the number of elements in the sub-block as the total number; processing the value of the sub-sequence by the following formula, and using the obtained result as the counting starting point:

[0037] z ij mod(Tj)(i=1,2,3...L 2 ; j = 1, 2, 3, ..., T),

[0038] Among them, z ij represents the subsequence, the value of i corresponds to the number of the subblock, and the value of j corresponds to the element position in the subblock; a subsequence is selected from the fourth pseudo-random integer sequence as the third periodic subsequence, and the value of the third periodic subsequence is used as the counting period.

[0039] In some embodiments, the pixel diffusion comprises:

[0040] Given an initial vector H with all initial values ​​0 1 , substitute the fourth pseudo-random integer sequence into the following formula to perform pixel diffusion:

[0041]

[0042] Wherein, n=1,2,3...M×N; i=1,2,3...M; j=1,2,3...N, M and N are the total number of rows and the total number of columns of the pixel matrix respectively;

[0043] When n=1, use the following formula:

[0044]

[0045] Among them, V 0 ∈(0,255), determined by the components in the key.

[0046] In an embodiment of the second aspect, the present application provides an image decryption method based on memristive chaos and block Josephus scrambling, comprising:

[0047] Convert the ciphertext image into a matrix form as a ciphertext matrix;

[0048] Using the encryption party's memristive chaotic system and key to generate a pseudo-random integer sequence;

[0049] Using the encryption party's pixel diffusion method, combining the value of the pseudo-random integer sequence and the components of the key, the ciphertext matrix is ​​subjected to pixel inverse diffusion to obtain a second scrambled matrix;

[0050] Dividing the second scrambled matrix into a plurality of sub-blocks, the number of the sub-blocks being determined by the components in the key, using the encryption method, determining the parameters of the Josephus scrambling algorithm by the values ​​of the pseudo-random integer sequence, and performing inverse Josephus scrambling on the sub-blocks to obtain a first scrambled matrix;

[0051] Using the encryption method, the parameters of the Josephus scrambling algorithm are determined by the value of the pseudo-random integer sequence, and the rows and / or columns of the first scrambling matrix are inversely scrambled by Josephus to obtain a pixel matrix;

[0052] The pixel matrix is ​​converted into an image form to obtain a plaintext image, thereby completing the decryption operation.

[0053] Beneficial Effects

[0054] The Josephus block scrambling method designed in this application can repeatedly divide and reorganize the rows and columns of the image, and scramble each block, which can effectively improve the scrambling effect.

[0055] This application combines a high-dimensional memristor chaotic system with stronger irregularity and pseudo-randomness with the Josephus block scrambling method to perform scrambling and diffusion, thereby improving the security of the algorithm.

[0056] 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

[0057] 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.

[0058] 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.

[0059] Figure 1 is a flow chart of an image encryption method based on memristive chaos and block Josephus scrambling in one embodiment;

[0060] Figure 2 is a schematic diagram of Josephus transformation in one embodiment;

[0061] Figure 3 It is a flow chart of an image decryption method based on memristive chaos and block Josephus scrambling in a preferred embodiment;

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

[0063] Figure 5 is a key space comparison table in one embodiment;

[0064] Figure 6 This is a comparison effect diagram of an image decrypted using a correct key and an image decrypted using a slightly changed key in one embodiment;

[0065] Figure 7 is a key sensitivity comparison table in one embodiment;

[0066] Figure 8 is a histogram of an image before and after encryption in one embodiment;

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

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

[0069] Fig.11 is an information entropy comparison table in one embodiment. DETAILED DESCRIPTION

[0070] 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 here 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.

[0071] 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.

[0072] 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.

[0073] See also Figure 1 In an embodiment of the first aspect, the present application provides an image encryption method based on memristive chaos and block Josephus scrambling, comprising:

[0074] S1. Convert the plaintext image into a pixel matrix.

[0075] In some implementations, converting the plaintext image into a pixel matrix specifically includes:

[0076] 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.

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

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

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

[0080] S2. Generate four sets of pseudo-random integer sequences through a memristor chaotic system.

[0081] 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):

[0082]

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

[0084] 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 key, and the key K is selected: (x 0 ,y 0 ,z 0 ,w 0 ,V 0 ,L,α,β,ζ), substitute the key into formula (1) to get four sets of first pseudo-random sequences: x′ i ,y′ i ,z′ i ,w′ i , 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 i ,y i ,z i ,w i , the expression of formula (2) is as follows:

[0085]

[0086] Among them, floor means rounding down.

[0087] Preferably, when the 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 to avoid the negative impact of the transient nature of the chaotic system on the encryption effect.

[0088] S3. Determine the parameters of the Josephus scrambling algorithm through the values ​​of the two sets of pseudo-random integer sequences, perform Josephus scrambling on the rows and / or columns of the pixel matrix, and obtain a first scrambled matrix.

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

[0090] q 2 =Josephus(n,s,p), (3)

[0091] Among them, n represents the total number, s represents the counting starting point, and p represents the counting period. Figure 2 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 is unique. However, the sequence produced by traditional Josephus scrambling has relatively few changes and lacks randomness, so it is necessary to increase disturbances to improve the scrambling effect. The present application determines the parameters of the Josephus scrambling algorithm by the value of the pseudo-random integer sequence, which effectively improves the scrambling effect.

[0092] Furthermore, when performing row scrambling on the pixel matrix, half of the pixel matrix is ​​selected row by row for Josephus scrambling: M / 2 is selected as the total number, where M represents the total number of rows of the pixel matrix. The value of the first pseudo-random integer sequence is processed by formula (4):

[0093] x i mod[floor(M / 2-i)](i=1,2,3,...,M / 2) (4)

[0094] Among them, x i represents the first pseudo-random integer sequence, and the result is used as the counting starting point. A subsequence is selected from the fourth pseudo-random integer sequence as the first periodic subsequence, and the value of the first periodic subsequence is used as the counting period p. The scrambled rows are placed in the upper half of the pixel matrix, and the unscrambled rows are placed in the lower half of the pixel matrix.

[0095] Furthermore, when the pixel matrix is ​​scrambled by column, half of the pixel matrix is ​​selected by column for Josephus scrambling: N / 2 is selected as the total number, where N represents the total number of columns of the pixel matrix. The value of the second pseudo-random integer sequence is processed by formula (5):

[0096] y i mod[floor(N / 2-i)](i=1,2,3,...,N / 2) (5)

[0097] Among them, y i Represents the second pseudo-random integer sequence, and the result is used as the counting starting point. A subsequence is selected from the fourth pseudo-random integer sequence as the second periodic subsequence, and the value of the second periodic subsequence is used as the counting period. The scrambled columns are placed in the left half of the pixel matrix, and the unscrambled columns are placed in the right half of the pixel matrix.

[0098] It can be understood that performing the above-mentioned row scrambling and column scrambling operations on the pixel matrix is ​​actually to rearrange and combine the rows and columns in the pixel matrix. We found that iterating the above-mentioned row scrambling and column scrambling 14 times or more can achieve a better scrambling effect.

[0099] S4. Divide the first scrambled matrix into several sub-blocks, determine the parameters of the Josephus scrambling algorithm through the values ​​of another set of pseudo-random integer sequences, perform Josephus scrambling on the several sub-blocks respectively, and obtain a second scrambled matrix.

[0100] In some implementations, the generation process of the second scrambling matrix includes:

[0101] S41. Divide the first scrambled matrix into a number of sub-blocks of the same size, where the number of sub-blocks is determined by the component L in the key.

[0102] Preferably, the first scrambled matrix is ​​divided into L 2 sub-blocks, and number each sub-block as: S 1 ,S 2 ...S L2 In the process of block division, the first scrambled matrix can be padded with zeros according to actual needs to ensure that the number of elements in the first scrambled matrix meets the block division requirements. The size of the sub-block is recorded as T, Ceiling(·) means rounding up.

[0103] S42. Divide the third pseudo-random integer sequence into a number of subsequences, the number of subsequences is the same as the number of elements in the sub-blocks, and the number of elements in the subsequences is the same as the number of sub-blocks.

[0104] Specifically, the third pseudo-random integer sequence z i Divide into T subsequences, denoted as z i ={z i1 ,z i2 ...z iT}, that is, all subsequences have a length of L 2 .

[0105] S43. Perform Josephus scrambling on the sub-block to obtain the second scrambling matrix: Select the number of elements in the sub-block as the total number. Process the value of the sub-sequence through formula (6):

[0106] z ij mod(Tj)(i=1,2,3...L 2 ; j=1,2,3,...,T) (6)

[0107] The result is used as the starting point for counting, where z ijRepresents a subsequence, the value of i corresponds to the number of the subblock, and the value of j corresponds to the position of the element in the subblock. For example, when i=2, the counting starting point is z 2j , for number S 2 The sub-block of is subjected to Josephus scrambling, and the counting starting point is the jth element in the sub-block. A sub-sequence is selected from the fourth pseudo-random integer sequence as the third periodic sub-sequence, and the value of the third periodic sub-sequence is used as the counting period.

[0108] S5. Perform pixel diffusion on the second scrambled matrix and then convert it into a ciphertext image to complete the encryption operation.

[0109] In some implementations, pixel diffusion specifically includes:

[0110] Given an initial vector H with all initial values ​​0 1 , substitute the fourth pseudo-random integer sequence into formula (7) for pixel diffusion, and the expression of formula (7) is:

[0111]

[0112] Wherein, n=1,2,3...M×N; i=1,2,3...M; j=1,2,3...N, M and N are the total number of rows and the total number of columns of the pixel matrix respectively;

[0113] When n=1, use formula (8):

[0114]

[0115] Among them, V 0 ∈(0,255), which is composed of the key component V 0 Sure.

[0116] Finally, the vector matrix H 1 Convert to ciphertext image and complete the encryption operation.

[0117] See also Figure 3 In an embodiment of the second aspect, the present application provides an image decryption method based on memristor chaos and block Josephus scrambling, which is used to decrypt an image encrypted by the image encryption method based on memristor chaos and block Josephus scrambling, and the decryption method is the inverse process of the aforementioned encryption method, including:

[0118] V1. Convert the ciphertext image into a matrix form as the ciphertext matrix;

[0119] V2. Use the encryption party's memristive chaos system and key to generate a pseudo-random integer sequence;

[0120] V3. Use the encryption party's pixel diffusion method to perform pixel inverse diffusion on the ciphertext matrix in combination with the value of the pseudo-random integer sequence and the component of the key to obtain a second scrambled matrix;

[0121] V4. Divide the second scrambled matrix into a number of sub-blocks, the number of sub-blocks is determined by the components in the key, the parameters of the Josephus scrambling algorithm are determined by the value of the pseudo-random integer sequence, and the sub-blocks are inversely scrambled by Josephus to obtain the first scrambled matrix;

[0122] V5. Using the encryption method, the parameters of the Josephus scrambling algorithm are determined by the value of the pseudo-random integer sequence, and the rows and / or columns of the first scrambling matrix are inversely scrambled by Josephus to obtain a pixel matrix;

[0123] V6. Convert the pixel matrix into an image form, obtain a plaintext image, and complete the decryption operation.

[0124] The following is an explanation of the beneficial effects of the present application through simulation software, and Matlab 2021a software is used to simulate and verify the encryption method of the present application and analyze its performance. Figure 4 shown.

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

[0126] Keyspace:

[0127] The larger the key space of an encryption algorithm, the more difficult it is to crack it through brute force attacks. The keys used in this application include K:(x 0 ,y 0 ,z 0 ,w 0 ,V 0 ,L,α,β,ζ), the pseudo-random sequence is taken to 15 decimal places, and the system parameters are taken to 4 decimal places. Therefore, the size of the key space is (10 4 ) 3 ×(10 15 ) 6 ≈2 338 , far exceeding the limit of the existing brute force cracking technology. Based on this, even if brute force cracking is used, it is almost impossible to find the initial key used under existing computer conditions, so it can effectively resist brute force attacks. Figure 5 The key space comparison between the algorithm of the present invention and the existing algorithms is shown.

[0128] Key Sensitivity:

[0129] While keeping other keys unchanged, change a key by a very small value, that is, the partial key of a set of keys is (x 0 ,y 0 ,z 0 ,w 0 )=(0.01,0,0,0), and the other group is (x 0 ,y 0 ,z 0 ,w 0 )=(0.01,0.01,0,0), then try to decrypt and simulate the result. Figure 6 As shown, from the decryption results, it can be seen that even if the key changes very slightly, the encryption algorithm can still produce completely different results when decrypting.

[0130] By calculating and analyzing the change rate (NPCR) and unified average change intensity (UACI) of the pixels with four initial values, the experimental results are as follows: Figure 7 As shown in the figure, it is found that NPCR and UACI are very close to the theoretical predicted values. This shows that the encryption algorithm has a high sensitivity to the initial key and can effectively prevent security threats such as statistical analysis.

[0131] Grayscale histogram:

[0132] The number of pixels with each gray value in the image can be obtained in the histogram, which directly reflects whether the distribution of the image matrix elements is uniform. In the encryption algorithm, the more uniform the encryption result, the better the effect. Figure 8 The histograms of the plaintext image and the ciphertext image of "Lena" are shown. From the histogram analysis, we can find 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 this algorithm, we can see that the pixel distribution of the original image has been effectively destroyed, and the pixel distribution has achieved a relatively uniform and smooth effect, which means that it is difficult for an attacker to obtain any valid information of the original image through statistical analysis.

[0133] Adjacent pixel correlation:

[0134] When the correlation properties of adjacent elements of the original image are completely destroyed, it is difficult for an attacker to crack the ciphertext image through statistical analysis. Fig.10 is the simulation result of the correlation between adjacent elements in each direction of the original image and the encrypted image, Fig. 9 It is a comparative analysis with other literature. Fig. 9 The correlation coefficients of the images in three directions after encryption are shown, as well as the comparison results with other literature. Fig.10The results of the correlation test before and after the encryption of the image 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 can effectively prevent attacks such as statistical analysis.

[0135] Information Entropy:

[0136] Information entropy is a measure of information quantification and the amount of information required. When the image information entropy is close to the theoretical maximum value of 8, it indicates that the image information presents a higher degree of confusion, which means that the encryption effect will be better when the encryption algorithm is used for encryption. Fig.11 The information entropy of common images and cipher images is listed and compared with existing literature. Fig.11 It can be seen that the information entropy of the ciphertext image encrypted by this scheme is almost close to the theoretical value of 8, which shows that the scheme can produce good randomness and provide effective security.

[0137] It should be noted that Figure 5 , Fig. 9 and Fig.11The 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 InformationSecurity and Applications,2021,58:102699], [3: Yang N, Zhang S, Bai M,etal.Medical image encryption based on Josephus traversing and hyperchaoticLorenz system[J].Journal of Shanghai Jiao Tong University,2022,12:1-18] and [4: NiuY, Zhou H, Zhang X.Hybrid encryption algorithm based on gray curve andJosephus permutation[J].Computational Intelligence and Neuroscience, 2022, 2022:7076416].

[0138] 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. An image encryption method based on memristive chaos and block Josephus scrambling, characterized in that: include: Convert the plaintext image into a pixel matrix; Generate four sets of pseudo-random integer sequences through a memristor chaotic system; Determine the parameters of the Josephus scrambling algorithm by using the values ​​of the two sets of pseudo-random integer sequences, and perform Josephus scrambling on the rows and / or columns of the pixel matrix to obtain a first scrambled matrix; Dividing the first scrambled matrix into a number of sub-blocks, determining the parameters of the Josephus scrambling algorithm by using another set of values ​​of the pseudo-random integer sequence, and performing Josephus scrambling on the sub-blocks respectively to obtain a second scrambled matrix; The remaining set of pseudo-random integer sequences is used to perform pixel diffusion on the second scrambled matrix and convert it into a ciphertext image to complete the encryption operation.

2. The image encryption method based on memristive chaos and block Josephus scrambling as claimed in claim 1, characterized in that: The converting of the plaintext image into a pixel matrix comprises: 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; Converting the rectangular image into a pixel sequence; The pixel sequence is converted into a matrix form and used as a pixel matrix.

3. The image encryption method based on memristive chaos and block Josephus scrambling as claimed in claim 1, characterized in that: The memristor chaotic system adopts the Chua memristor chaotic system, and the mathematical model of the Chua memristor chaotic system is: Where W(w)=-0.4+2.4w 2 , x, y, z are the state variables of the system, w is the magnetic flux of the memristor, W(w) represents the function of the resistance value of the memristor changing with w, and α, β, ξ are system parameters.

4. The image encryption method based on memristive chaos and block Josephus scrambling as claimed in claim 3, characterized in that: The process of generating a pseudo-random integer sequence involves: Selecting a key according to the initial values ​​of the state variables and system parameters of the Chua memristor chaotic system, substituting the key into the Chua memristor chaotic system, and obtaining four groups of first pseudo-random sequences; The four groups of the first pseudo-random sequences are rounded to obtain four groups of pseudo-random integer sequences, namely 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.

5. The image encryption method based on memristive chaos and block Josephus scrambling as claimed in claim 4, characterized in that: The expression of the Josephus scrambling algorithm is: q2=Josephus(n,s , p), Among them, q2 represents the integer sequence after Josephus scrambling, n represents the total number, s represents the counting starting point, and p represents the counting period.

6. The image encryption method based on memristive chaos and block Josephus scrambling as claimed in claim 5, characterized in that: Performing Josephus scrambling on the rows of the pixel matrix includes: Select half of the pixel matrix by row to perform Josephus scrambling: select M / 2 as the total number, where M represents the total number of rows of the pixel matrix; and process the value of the first pseudo-random integer sequence by the following formula: x i mod[floor(M / 2-i)](i=1,2,3,...,M / 2), Among them, x i represents the first pseudo-random integer sequence, and uses the obtained result as the counting starting point; selects a subsequence in the fourth pseudo-random integer sequence as the first periodic subsequence, and uses the value of the first periodic subsequence as the counting period p; places the scrambled rows in the upper half of the pixel matrix, and places the unscrambled rows in the lower half of the pixel matrix.

7. The image encryption method based on memristive chaos and block Josephus scrambling as claimed in claim 5, characterized in that: Performing Josephus scrambling on the columns of the pixel matrix includes: Select half of the pixel matrix by column to perform Josephus scrambling: select N / 2 as the total number, where N represents the total number of columns of the pixel matrix; and process the value of the second pseudo-random integer sequence by the following formula: y i mod[floor(N / 2-i)](i=1,2,3,...,N / 2), Among them, y i represents the second pseudo-random integer sequence, and uses the obtained result as the counting starting point; selects a subsequence in the fourth pseudo-random integer sequence as the second periodic subsequence, and uses the value of the second periodic subsequence as the counting period; places the scrambled columns in the left half of the pixel matrix, and places the unscrambled columns in the right half of the pixel matrix.

8. The image encryption method based on memristive chaos and block Josephus scrambling as claimed in claim 5, characterized in that: The generation process of the second scrambling matrix includes: Divide the first scrambled matrix into a plurality of sub-blocks of the same size, the number of the sub-blocks being determined by the components in the key, and number the sub-blocks; Divide the third pseudo-random integer sequence into a plurality of subsequences, the number of the subsequences being the same as the number of elements in the sub-blocks, and the number of elements in the subsequences being the same as the number of the sub-blocks; Performing Josephus scrambling on the sub-block to obtain the second scrambling matrix: selecting the number of elements in the sub-block as the total number; processing the value of the sub-sequence by the following formula, and using the obtained result as the counting starting point: z ij mod(T-j)(i=1,2,3...L 2 ;j=1,2,3,...,T), Among them, z ij represents the subsequence, the value of i corresponds to the number of the subblock, and the value of j corresponds to the element position in the subblock; L 2 represents the total number of sub-blocks, T represents the total number of elements in the sub-block; a sub-sequence is selected from the fourth pseudo-random integer sequence as the third periodic sub-sequence, and the value of the third periodic sub-sequence is used as the counting period.

9. The image encryption method based on memristive chaos and block Josephus scrambling as claimed in claim 4, characterized in that: The pixel diffusion includes: Given an initial vector H1 whose initial value is 0, the fourth pseudo-random integer sequence is substituted into the following formula for pixel diffusion: Wherein, n=2,3,4...M×N; i=1,2,3...M; j=1,2,3...N, M and N are the total number of rows and the total number of columns of the pixel matrix respectively; When n=1, use the following formula: Among them, w n (n) represents a fourth pseudo-random integer sequence; V0∈(0,255), determined by the components in the key.

10. An image decryption method based on memristive chaos and block Josephus scrambling, characterized in that: include: Convert the ciphertext image into a matrix form as a ciphertext matrix; Using the encryption party's memristive chaotic system and key to generate a pseudo-random integer sequence; Using the encryption party's pixel diffusion method, combining the value of the pseudo-random integer sequence and the components of the key, the ciphertext matrix is ​​subjected to pixel inverse diffusion to obtain a second scrambled matrix; Dividing the second scrambled matrix into a plurality of sub-blocks, the number of the sub-blocks being determined by the components in the key, using the encryption method, determining the parameters of the Josephus scrambling algorithm by the values ​​of the pseudo-random integer sequence, and performing inverse Josephus scrambling on the sub-blocks to obtain a first scrambled matrix; Using the encryption method, the parameters of the Josephus scrambling algorithm are determined by the value of the pseudo-random integer sequence, and the rows and / or columns of the first scrambling matrix are inversely scrambled by Josephus to obtain a pixel matrix; The pixel matrix is ​​converted into an image form to obtain a plaintext image, thereby completing the decryption operation.

Citation Information

Patent Citations

  • Image encryption method based on hyper-chaotic system and variable step size Josepher problem

    CN110086600A

  • Image encryption method based on multidimensional chaotic system and Josephf scrambling

    CN111105339A