Image encryption method based on chaos and modular inverse matrix
Through the image encryption method based on chaotic and modulus matrix, the problem of low image encryption efficiency and weak security in the existing technologies is solved, and an efficient and secure image encryption and decryption process is achieved to ensure the security spread of image information.
Patent Information
- Application Number
- CN202210680647.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-16
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-06-16
AI Technical Summary
The existing image encryption methods are inefficient and have weak security, making it difficult to effectively protect the security of image information.
Adopting image encryption methods based on chaos and modulus matrix, the chaotic sequence is generated through logistic mapping, random original images, after blocks, use the mold reverse matrix and random matrix to perform image diffusion to generate encrypted images.
Improve the efficiency and security of image encryption, ensure the lossless recovery of the post -dense images, and effectively protect the security of image information.
Smart Images

Figure CN115150053B_ABST
Abstract
Description
Technical Field
[0001] The method relates to an information encryption technology, in particular to an image encryption method. Background Art
[0002] Image is an important carrier of network information interaction and information dissemination. It has the characteristics of image, intuitiveness and large amount of information, and has been widely used in many fields. However, due to the openness of network systems, image information leakage problems occur from time to time. Therefore, it is particularly important to study efficient and secure image encryption methods.
[0003] In order to improve the security and efficiency of image encryption, an image encryption method based on chaos and modular inverse matrix is proposed. This method uses the good randomness and complexity of chaos to construct a random matrix to encrypt the image and fully diffuse the plaintext image. The proposed modular inverse matrix solves the calculation error caused by the inverse matrix accuracy in the traditional matrix algorithm, so that the decrypted image can restore the original image losslessly. Summary of the invention
[0004] The purpose of the present invention is to solve the problems of low efficiency and weak security of existing image encryption, and propose an image encryption method based on chaos and modular inverse matrix.
[0005] The image encryption method based on chaos and modular inverse matrix is characterized in that the encryption process includes the following steps:
[0006] Step 1: Generate chaotic sequence: Let the original image be A , whose size is m × n , the Logistic map is defined as:
[0007] x d+1 = x d × μ ×(1– x d ), (1)
[0008] Among them, the control parameters μ ∈(3.5699, 4), iterated value x d ∈(0, 1); Randomly select the initial value of the Logistic map x 0 and control parameters μ 1 , iteration 1000+ mn times, discarding the first 1000 values, and obtaining a length of mn Chaotic sequence X 1= { x 1 i}; Randomly select the initial value of the mapping again y 0 and control parameters μ 2 , iteration 1000+4 mn times, discarding the first 1000 values, and obtaining a length of 4 mn Chaotic sequence Y 1 = { y 1 j};
[0009] Step 2: Scramble the original image: A Convert to a length of mn One-dimensional vector of B 1 ;right X 1 To sort,
[0010] [ X 2 , Z ] = sort ( X 1 ), (2)
[0011] in, sort (·) is the ascending sorting function, Z is a sequence of index values, X 2 is the new sequence after sorting; using Z And formula (3) B 1 The elements in are shuffled.
[0012] b 2 i = b 1 z(i) , i =1, 2, …, mn , (3)
[0013] in, b 1 i ∈ B 1 , z (i)∈ Z , B 2 = {b 2 i} is the scrambling vector;
[0014] Step 3: Image segmentation: B 2 Convert to s The size is k × k The two-dimensional matrix B 2 1 , B 2 2 , …, B 2 s , k is a positive integer, s=mn / k 2 ,like mn Cannot be k 2 Divisible by B 2 Perform zero padding operation;
[0015] Step 4: Generate a random matrix: Y 1 Integerization,
[0016] y 2 j = mod ( floor ( y 1 j ×10 14 ), 256), j= 1, 2, …, 4 mn , (4)
[0017] in, mod (·) is the modulo function, floor (·) is the rounding function, y 1 j ∈ Y 1 , which can generate a length of 4 mn Integer chaotic sequence Y 2 ={ y 2 j};use Y 2 The elements in are constructed in a certain way. s The size is k × kA matrix with an odd determinant U 1 , U 2 , …, U s ;
[0018] Step 5: Calculate the modular inverse matrix: Calculate U 1 , U 2 , …, U s The modulo 256 inverse matrix of V 1 , V 2 , …, V s ,satisfy
[0019] mod( U t × V t , 256) = 1, t= 1, 2, …, s , (5)
[0020] in, V t It is composed of integers;
[0021] Step 6: Image Diffusion: Calculation,
[0022] E t = mod ( B 2 t × V t , 256), t= 1, 2, …, s , (6) Among them, E t is the diffusion matrix;
[0023] Step 7: Generate encrypted image: In a certain way, E 1 , E 2 , …, E s Combined into a size of m × n Image E , which is the encrypted image.
[0024] The image encryption method based on chaos and modular inverse matrix is characterized in that the decryption process includes the following steps:
[0025] Step 1: Generate chaotic sequence: Use x 0 and μ 1 , iterate formula (1) 1000+ mn times, discarding the first 1000 values, and obtaining a length of mn Chaotic sequence X 1 = { x 1 i}; Reuse y 0 and μ 2 , iterative formula (1) 1000+4 mn times, discarding the first 1000 values, and obtaining a length of 4 mn Chaotic sequence Y 1 = { y 1 j};
[0026] Step 2: Image segmentation: E Convert to s The size is k × k The two-dimensional matrix E 1 , E 2 , …, E s ;
[0027] Step 3: Generate a random matrix: Use formula (4) to Y 1 Integerization can produce a length of 4 mn Integer chaotic sequence Y 2 ={ y 2 j};use Y 2 The elements in are constructed in a certain way. s The size is k × k A matrix with an odd determinant U 1 , U 2 , …, Us ;
[0028] Step 4: Image diffusion recovery: Calculation,
[0029] B 2 t = mod ( E t × U t , 256), t= 1, 2, …, s , (7)
[0030] In a certain way, B 2 1 , B 2 2 , …, B 2 s Combined into a size of m × n Image B 3 ;
[0031] Step 5: Image scrambling recovery: B 3 Convert to a length of mn One-dimensional vector of B 2 ; Using formula (2) X 1 Sort and get the index value sequence Z ;use Z And formula (8) B 2 The elements in are shuffled.
[0032] b 1 z(i) = b 2 i , i =1, 2, …, mn , (8)
[0033] in, b 2 i ∈ B 2 , z ( i )∈ Z , B 1= { b 1 i} is the scrambled recovery vector;
[0034] Step 6: Generate decrypted image: B 1 Convert to a size of m × n The matrix is the decrypted image.
[0035] Beneficial effects: Aiming at the problems of low encryption efficiency and weak security in existing image encryption methods, the present invention proposes an image encryption method based on chaos and modular inverse matrix. The main contributions are: (1) utilizing the good complexity and randomness of chaos to construct random matrices and modular inverse matrices; (2) using matrix modular operations to change pixel values, the operation is simple, the complexity is low, and the diffusion effect is good; (3) combining the concept of modular inverse matrix, an image encryption method based on chaos and modular inverse matrix is proposed. The method has the characteristics of high efficiency, security and good encryption effect, and can effectively improve the security of image information in network interactive communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 :Image encryption flow chart based on chaos and modular inverse matrix;
[0037] Figure 2 : Image decryption flow chart based on chaos and modular inverse matrix;
[0038] Figure 3 : original image;
[0039] Figure 4 : Encrypted image. DETAILED DESCRIPTION
[0040] The implementation process of the present invention is further described in detail below with reference to specific drawings and examples.
[0041] Figure 1 It is the encryption flow chart of this method.
[0042] Figure 2 It is the decryption flow chart of this method.
[0043] The programming software used is Matlab R2018b, and the Figure 3 The Baboon grayscale image with a size of 512×512 is shown as the experimental object.
[0044] Step 1: Generate a chaotic sequence: Randomly select the initial value 0.2531 of the Logistic map and the control parameter 3.8914, iterate 1000+262144 times, discard the first 1000 values, and you will get a chaotic sequence with a length of 262144. X 1 = { x 1 i}; Randomly select the initial value 0.1262 and the control parameter 3.7253 of the mapping again, iterate 1000+1048576 times, discard the first 1000 values, and get a chaotic sequence with a length of 1048576 Y 1 = { y 1 j}.
[0045] Step 2: Scramble the original image: A Converted to a one-dimensional vector of length 262144 B 1 , using formula (2) X 1 Sort in ascending order to get the index value sequence Z and the sorted sequence X 2 ;use Z And formula (3) B 1 The elements in the scrambled position are obtained to obtain the scrambled vector B 2 = { b 2 i}.
[0046] Step 3: Image Segmentation: Settings k =4, calculated s =16384, B 2 Transformed into 16384 two-dimensional matrices of size 4×4 B 2 1 , B 2 2 , …, B 2 16384 .
[0047] Step 4: Generate a random matrix: First, Y 1 Integerization, get integer chaotic sequenceY 2 ={ y 2 j};use Y 2 The elements in , in a certain way, construct 16384 matrices with odd determinant values U 1 , U 2 , …, U 16384 .
[0048] Step 5: Calculate the modular inverse matrix: Calculate U 1 , U 2 , …, U 16384 The modulo 256 inverse matrix of V 1 , V 2 , …, V 16384 .
[0049] Step 6: Image diffusion: Use formula (6) to calculate E 1 , E 2 , …, E 16384 .
[0050] Step 7: Generate encrypted image: In a certain way, E 1 , E 2 , …, E 16384 Combined into an image of size 512×512, the encrypted image can be obtained, such as Figure 4 shown.
[0051] Below is a further detailed description of the decryption process.
[0052] Step 1: Generate a chaotic sequence: Using the initial value 0.2531 and the control parameter 3.8914, iterate formula (1) 1000+62144 times, discard the first 1000 values, and you will get a chaotic sequence with a length of 262144. X 1 = { x 1 i}; Again using the initial value 0.1262 and the control parameter 3.7253, iterate formula (1) 1000+1048576 times, discard the first 1000 values, and obtain a chaotic sequence with a length of 1048576 Y 1 = { y 1 j}.
[0053] Step 2: Image segmentation: E Transformed into 16384 two-dimensional matrices of size 4×4 E 1 , E 2 , …, E 16384 .
[0054] Step 3: Generate a random matrix: Use formula (4) to Y 1 Integerization can generate an integer chaotic sequence with a length of 1048576 Y 2 ={ y 2 j};use Y 2 The elements in , in a certain way, construct 16384 matrices of size 4×4 and odd determinant values U 1 , U 2 , …, U 16384 .
[0055] Step 4: Image diffusion recovery: Use formula (7) to calculate B 2 1 , B 2 2 , …, B 2 16384 , combine them into an image of size 512×512 B 3 .
[0056] Step 5: Image scrambling recovery: B 3 Converted into a one-dimensional vector of length 62144 B 2 ; Using formula (2) X 1 Sort and get the index value sequenceZ ;use Z And formula (8) B 2 The elements in are scrambled to obtain the scrambled recovery vector B 1 = { b 1 i}.
[0057] Step 6: Generate decrypted image: B 1 Converted into an image of size 512×512, which is the decrypted image, such as Figure 3 shown.
Claims
1. An image encryption method based on chaos and modular inverse matrix, characterized in that: The encryption process includes the following steps: Step 1: Generate chaotic sequence: Let the original image be A, whose size is m×n, and the Logistic mapping is defined as: x d+1 = x d ×μ×(1–x d ), (1) Among them, the control parameter μ∈(3.5699,4), the iteration value x d ∈(0,1); randomly select the initial value x0 and control parameter μ1 of the Logistic map, iterate 1000+mn times, discard the first 1000 values, and obtain a chaotic sequence X with a length of mn 1 ={x 1 i }; Randomly select the initial value y0 and control parameter μ2 of the mapping again, iterate 1000+4mn times, discard the first 1000 values, and obtain a chaotic sequence Y with a length of 4mn 1 ={y 1 j }; Step 2: Scramble the original image: Convert A into a one-dimensional vector B of length mn 1 ; for X 1 To sort, [X 2 , Z] = sort (X 1 ), (2) Among them, sort(·) is the ascending sorting function, Z is the index value sequence, X 2 is the new sequence after sorting; use Z and formula (3) to calculate B 1 The elements in are shuffled. b 2 i = b 1 z(i) ,i=1, 2, …, mn, (3) Among them, b 1 i ∈B 1 , z(i)∈Z,B 2 = {b 2 i } is the scrambling vector; Step 3: Image segmentation: 2 Transformed into s two-dimensional matrices B of size k×k 2 1,B 2 2,…,B 2 s , k is a positive integer, s = mn / k 2 , if mn cannot be 2 Divisible by B 2 Perform zero padding operation; Step 4: Generate a random matrix: 1 Integerization, y 2 j = mod( floor(y 1 j ×10 14 ), 256),j=1, 2, …, 4mn, (4) Among them, mod(·) is the modulus function, floor(·) is the integer function, and y 1 j ∈Y 1 , can generate an integer chaotic sequence Y with a length of 4mn 2 ={y 2 j };Use Y 2 The elements in , in a certain way, construct s matrices U1, U2, ..., U of size k × k and with odd determinant values. s ; Step 5: Calculate the modular inverse matrix: Calculate U1, U2, ..., U s The modulo-256 inverse matrix V1, V2, …, V s ,satisfy mod(U t ×V t , 256) = 1,t=1, 2, …, s, (5) Among them, V t It is composed of integers; Step 6: Image Diffusion: Calculation, E t = mod (B 2 t ×V t , 256),t=1, 2, …, s, (6) Among them, E t is the diffusion matrix; Step 7: Generate encrypted image: In a certain way, E1, E2, …, E s Combined into an image E of size m×n, which is the encrypted image.
2. The image encryption method based on the chaos and modular inverse matrix of claim 1, characterized in that: The decryption process includes the following steps: Step 1: Generate a chaotic sequence: Use the initial value x0 of the Logistic map and the control parameter μ1, iterate formula (1) 1000+mn times, discard the first 1000 values, and obtain a chaotic sequence X with a length of mn 1 ={x 1 i }, i = 1, 2, ..., mn; again use the initial value y0 of the Logistic map and the control parameter μ2, iterate formula (1) 1000 + 4mn times, discard the first 1000 values, and obtain a chaotic sequence Y with a length of 4mn 1 ={y 1 j }, j = 1, 2, ..., 4mn; Step 2: Image segmentation: Convert the encrypted image E into s two-dimensional matrices E1, E2, …, E of size k × k s ; Step 3: Generate a random matrix: Use formula (4) to generate Y 1 Integerization can generate an integer chaotic sequence Y with a length of 4mn 2 ={y 2 j };Use Y 2 The elements in , in a certain way, construct s matrices U1, U2, ..., U of size k × k and with odd determinant values. s ; Step 4: Image diffusion recovery: Calculation, B 2 t = mod (E t ×U t , 256),t=1, 2, …, s, (7) In a certain way, B 2 1,B 2 2,…,B 2 s Combined into an image B of size m×n 3 ; Step 5: Image scrambling recovery: B 3 Transformed into a one-dimensional vector B of length mn 2 ; Using formula (2) to calculate X 1 Sort them to get the index value sequence Z; use Z and formula (8) to sort B 2 The elements in are shuffled. b 1 z(i) = b 2 i ,i=1, 2, …, mn, (8) Among them, b 2 i ∈B 2 , z(i)∈Z,B 1 = {b 1 i } is the scrambled recovery vector; Step 6: Generate decrypted image: 1 Converted into a matrix of size m×n, which is the decrypted image.
Citation Information
Patent Citations
Plaintext associated image encryption algorithm based on hyperchaos Chen system
CN108234813A
Image encryption method based on three-dimensional composite scrambling model and chaos
CN111031193A