Image encryption method based on trans-ring Josephs scrambling and two-dimensional cellular automaton
Through the image encryption method based on cross-ring Josephs chaos and two-dimensional cellular automata, the problem of excessive time cost in image encryption of traditional encryption algorithms is solved, and a safe and efficient image encryption effect is achieved.
Patent Information
- Application Number
- CN202510364824.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-06-06
AI Technical Summary
When existing traditional encryption algorithms encrypt images, the time cost is too high and it is difficult to meet the needs of real-time processing.
Image encryption method based on cross-ring Josephs mess and two-dimensional cellular automata is adopted. This method uses the cross-ring Josephs chaos algorithm to disperse pixels, and uses the two-dimensional asynchronous cellular automata diffusion mechanism to generate a ciphertext image.
It achieves a good balance between security and efficiency in the image encryption process, reduces time costs, and meets the needs of real-time processing.
Smart Images

Figure CN120111153A_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the field of information security and privacy protection, and in particular to an image encryption method based on cross-ring Josephus scrambling and two-dimensional cellular automaton. Background Art
[0002] With the rapid development of network technology, information has been remotely transmitted and shared worldwide. Information is in various forms, among which images, as the mainstream type of multimedia information, play an important role in daily communication due to their intuitiveness and rich information. However, the number of images transmitted per second in the network environment is as high as hundreds of millions. Once private information is leaked, it will pose a serious threat to individuals, countries and even the entire society. Therefore, ensuring the security of digital images during transmission has become an urgent task.
[0003] To meet the above challenges, researchers have designed a variety of encryption methods to ensure the security of information transmission. The core of encryption technology is to convert information into an unrecognizable form so that it can be safely transmitted on a public channel, and the original information cannot be restored without a key. A complete system architecture has been established in the field of cryptography, and many excellent encryption algorithms have emerged, such as DES, 3DES, IDEA, AES, etc. However, these traditional encryption algorithms are mainly used to encrypt one-dimensional text information, while digital images have the characteristics of large data volume, high redundancy, and strong correlation. If these traditional algorithms are directly applied to encrypt images, the time cost may be too high and it is difficult to meet the needs of real-time processing. Chaotic systems are widely used in the field of cryptography due to their pseudo-randomness, ergodicity, non-periodicity, and high sensitivity to initial conditions.
[0004] The present invention proposes an image encryption method based on cross-ring Josephus scrambling and two-dimensional cellular automaton, aiming to achieve a good balance between security and efficiency. Summary of the invention
[0005] The invention proposes an image encryption method based on cross-ring Josephus scrambling and two-dimensional cellular automaton.
[0006] The image encryption method of the present invention is characterized in that:
[0007] (1) The present invention designs a cross-ring Josephus scrambling algorithm, in which the elements removed each time depend on both the inter-ring step size and the intra-ring step size.
[0008] (2) The present invention designs a two-dimensional asynchronous cellular automaton diffusion mechanism and defines six different two-neighbor structures. Technical Solution
[0009] The technical solution adopted by the present invention includes the following parts:
[0010] (1) Cross-ring Josephus scrambling algorithm:
[0011] The cross-ring Josephus scrambling algorithm is an extension of the traditional Josephus problem, which aims to achieve complex element rearrangement by combining inter-ring and intra-ring movement strategies. The algorithm divides a finite sequence of n elements into N ring structures (or "rings"), denoted by E = {E 1 ,E 2 ,…,E N}. If n is divisible by N, then each ring contains the same number of elements, denoted by If it is not divisible, then the first N-1 rings each contain elements, and the last ring contains the remaining m′=n mod m elements.
[0012] In the cross-ring Josephus scrambling algorithm, an inter-ring step length sequence A=(a 1 ,a 2 ,…,a n ) to determine the next ring to be visited, and use a step sequence B = (b 1 ,b 2 ,…,b n ) to select the element to be removed in the newly visited ring. Each a i Specifies the step size from the position of the removed element in the current ring to the corresponding position in the next ring, followed by b i Specifies the step size to move from this position in the reach ring to the next element to be removed. Each time an element is removed, the subsequent a i+1 and b i+1 Make the next selection, ensuring dynamic changes in step size.
[0013] The scrambling process starts with the starting element of one of the rings, which is chosen as the first element to be removed. 1 , and by a 1 and b 1 Determine the starting position. From this position, use a 2 and b 2 Locate and remove the second element s 2 This iterative process continues until all elements in all rings are removed. The order in which the elements are removed forms the final scrambled sequence S = (s 1 ,s 2 ,…,s n ), where each s i Represents the element removed at step i.
[0014] (2) Two-dimensional asynchronous cellular automation diffusion mechanism:
[0015] A cellular automaton is a discrete dynamic system that simulates complex behaviors through the interaction of local rules on discrete cells. A two-dimensional cellular automaton is defined as a two-dimensional grid of cells, where each cell occupies a discrete position in the grid and can take one of a finite set of states. These cells update their states at discrete time steps according to a set of predefined local transition rules, which usually depend on the current state of the cell and the states of its neighbors. At time t, each cell C i,j The state is represented by The transition function F defines how to calculate the next state based on the current state of the cell and its neighbors.
[0016] In image encryption, the image is viewed as a two-dimensional grid where each pixel corresponds to a cell. The state of each cell is represented by the pixel value. In the diffusion mechanism, six different two-neighbor structures are defined, such as Figure 2 As shown. That is, when the neighborhood radius is 1, the state transition function depends on two neighbors. Asynchronous cellular automation mechanism, that is, the cell states are updated in sequence. In this mechanism, the current cell C i,j The previous neighbors have been updated to their states at time t+1, while the current cell and its subsequent neighbors still retain the states at time t.
[0017] The six two-neighbor structures correspond to six different state transition functions, which can be expressed as: a) b) c) d) e) f) in represents the state of a random image R at time t. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a flow chart of an image encryption method based on cross-ring Josephus scrambling and two-dimensional cellular automaton of the present invention, Figure 2 There are six predefined two-neighbor structures. DETAILED DESCRIPTION
[0019] (1) Generate password sequence:
[0020] Assume that the size of the plaintext image P is m×n. Calculate the 512-bit hash value H of the plaintext image. The initial state variables and control parameters of the chaotic system are used as the initial key.
[0021] The initial key is updated using the hash value H so that the updated key is associated with the plaintext image. The updating process is to perform some operations on the hash value H and the initial key.
[0022] The chaotic system is iterated z+m×n times using the updated key. The first z values are discarded and two random sequences X and Y of length m×n are generated.
[0023] Transform the sequences X and Y as follows: U=X×10 14 modm+1; V=Y×10 14 mod n+1; W=X×10 10 mod 8+1; R=Y×10 10 mod 256; Get U=(u 1 ,u 2 ,…,u m×n ), where u i ∈[1,m]; V=(v 1 ,v 2 ,…,v m×n ), where v i ∈[1,n]; W=(w 1 ,w 2 ,…,w m×n ), where w i ∈[1,8]; R=(r 1 ,r 2 ,…,r m×n ), where r i ∈[0,255]. Convert the sequences W and R into matrices of size m×n respectively.
[0024] (2) Pixel scrambling:
[0025] The plaintext image P m×n It is considered as m rings, each containing n elements.
[0026] The cross-ring Josephus scrambling algorithm is applied to all elements of the plaintext image P. Sequences U and V are used as inter-ring step sequences and intra-ring step sequences, respectively, and the scrambled sequence S is obtained.
[0027] Rearrange the scrambled sequence S into a matrix Q of size m×n.
[0028] (3) Pixel diffusion:
[0029] Insert all zero rows and columns into matrices Q, W, and R as the first row, first column, and last column, respectively.
[0030] Use matrix W to select a local diffusion rule for each pixel of matrix Q. Figure 2 As shown, six predefined two-neighbor structures are used. The corresponding diffusion rules are as follows: For i=2 and j=2,3,...,n,n+1: in For i = 3, 4, ..., m, m+1; j = 2, 3, ..., n, n+1: (a) When W′(i,j)=1, (b) When W′(i,j)=2, (c) When W′(i,j)=3, (d) When W′(i,j)=4, (e) When W′(i,j)=5, (f) When W′(i,j)=6, in
[0031] According to the above rules, the diffused matrix Q is obtained. Then, the first row, the first column and the last column of Q are removed, and the obtained matrix is the final ciphertext image C.
[0032] This encryption method is also applicable to color images. The color image is divided into three components: red (R), green (G), and blue (B). Each component is encrypted separately and then combined to form the final ciphertext image. The hash value of each component needs to be calculated independently to update the initial key of each encryption process.
[0056] The above contents are only embodiments of the present invention and are not intended to limit the present invention in any form. Although the present invention is described in detail with embodiments, they do not constitute a limitation of the present invention. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present invention using the technical contents disclosed above, or modify them into equivalent embodiments of equivalent changes without departing from the scope of the technical solution of the present invention. Therefore, any simple modifications, equivalent changes and modifications made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention should be included in the protection scope of the technical solution of the present invention.
Claims
1. An image encryption method based on cross-ring Josephus scrambling and two-dimensional cellular automaton, characterized in that: The image encryption method adopts a scrambling and diffusion framework based on a cross-ring Josephus scrambling algorithm and a two-dimensional asynchronous cellular automaton diffusion mechanism.
2. The cross-ring Josephus scrambling algorithm according to claim 1, characterized in that: The algorithm divides a finite sequence of n elements into N ring structures (or "rings"), denoted by E = {E1, E2, ..., E N }, if n is divisible by N, then each ring contains the same number of elements, denoted by If it is not divisible, then the first N-1 rings each contain elements, and the last ring contains the remaining m′=n mod m elements; the algorithm uses an inter-ring step sequence A=(a1,a2,…,a n ) to determine the next ring to be visited, and use a step sequence B = (b1, b2, ..., b n ) to select the element to be removed in the newly visited ring, each a i Specifies the step size from the position of the removed element in the current ring to the corresponding position in the next ring, followed by b i Specifies the step length from the position in the reach ring to the next element to be removed. Each time an element is removed, the subsequent a i+1 and b i+1 The next selection is made to ensure the dynamic change of the step size; the scrambling process starts from the starting element of one of the rings, which is selected as the first element to be removed s1, and the starting position is determined by a1 and b1. Starting from this position, a2 and b2 are used to locate and remove the second element s2. This iterative process continues until all elements in all rings are removed, and the order in which the elements are removed forms the final scrambled sequence S = (s1, s2, ..., s n ), where each s i Represents the element removed at step i.
3. The two-dimensional asynchronous cellular automation diffusion mechanism according to claim 1, characterized in that: The image is viewed as a two-dimensional grid, where each pixel corresponds to a cell, and the state of each cell is represented by the pixel value. The cell states in the asynchronous cellular automation mechanism are updated sequentially. The current cell C i,j The previous neighbors have been updated to their states at time t+1, while the current cell and its subsequent neighbors still retain the states at time t; in the diffusion mechanism, six different two-neighbor structures are defined. When the neighborhood radius is 1, the state transition function depends on the two neighbors. The six two-neighbor structures correspond to six different state transition functions, which can be expressed as: a) b) c) d) e) f) in represents the state of a random image R at time t.