Color image encryption method and system based on memristor neural network
By generating pseudo-random keys through a memristive Hopfield neural network and combining it with the Arnold scrambling method, color images are doubly encrypted, which solves the problems of insufficient security and low efficiency in existing technologies and achieves high-security and high-efficiency image encryption, which is suitable for resource-constrained environments.
Patent Information
- Application Number
- CN202510789483.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-26
AI Technical Summary
Existing image encryption technology has insufficient security, low encryption efficiency and poor environmental adaptability, making it difficult to meet high security and real-time requirements.
A memristive Hopfield neural network is adopted to connect neurons through memristors as synapses to generate a pseudo-random key matrix. The color image pixel values are doubly encrypted by combining the Arnold scrambling method and the XOR operation.
It significantly enhances the security and efficiency of the encryption system, can resist brute force cracking and chosen plaintext attacks, is suitable for real-time encryption needs in resource-constrained scenarios, and ensures the confidentiality and integrity of image transmission, storage and processing.
Smart Images

Figure CN120711129A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image encryption, and in particular relates to a color image encryption method and system based on a memristor neural network. Background Art
[0002] In the digital age, color images, as crucial information carriers, are increasingly used in sensitive fields such as medical imaging, military reconnaissance, and financial transactions. Consequently, the demand for security in their transmission and storage has surged. Traditional encryption methods such as AES and DES are unable to meet the high security and real-time requirements due to complex key management, slow encryption speeds, and vulnerability to brute force and statistical analysis attacks.
[0003] In recent years, the development of memristor technology has injected new vitality into the field of image encryption. As a disruptive nanoelectronic device, memristors have surpassed the physical limitations of traditional memory devices with their non-volatile memory, potential for three-dimensional integration, and ultra-low power consumption. More notably, memristors can achieve continuously variable resistance states through electric field manipulation. This unique analog signal processing capability makes them an ideal platform for building neuromorphic computing systems. Combining memristors with neural networks can create nonlinear systems that exhibit rich dynamical behavior, providing an innovative technical approach for image encryption.
[0004] Based on the traditional Hopfield neural network architecture, a memristor Hopfield neural network, constructed by introducing memristors to simulate synaptic connections between neurons, is a nonlinear dynamical system with the unique ability to generate chaotic attractors. This model leverages the nonlinear conductivity of memristor devices to significantly enhance the complexity and random unpredictability of chaotic dynamical behavior. Compared to classical chaotic systems, its advantages are reflected in three aspects: First, the network exhibits a richer range of nonlinear dynamic modes, including multi-scroll attractors, amplitude control, and complex chaotic state transition mechanisms; second, the continuous tunability of memristor synapses exponentially expands the system's key space dimensions, providing a more solid security foundation for encryption systems; finally, through a parameter adjustment mechanism, the network can generate a variety of chaotic sequences. Its multi-orbital characteristics and parameter sensitivity provide a richer range of options and dynamic encryption flexibility for image encryption applications. This architectural innovation not only deepens the cross-integration of neuromorphic computing and chaos theory, but also opens up new technical paths in the field of information security.
[0005] In summary, the color image encryption scheme based on a memristive Hopfield neural network deeply integrates the non-volatile storage properties of memristive devices with the associative memory capabilities of a Hopfield neural network to construct a novel chaotic encryption architecture. This system uses a hyperchaotic sequence generated by a memristive neural network as a dynamic encryption key. Combining a pixel-level diffusion algorithm with a multidimensional scrambling mechanism, it achieves a dual encryption mapping between the pixel value distribution and spatial position of a color image. This method not only improves the encryption system's resistance to brute force and chosen-plaintext attacks, but also offers low computational complexity and easy engineering implementation, making it particularly suitable for real-time encryption requirements in resource-constrained scenarios. Through the implementation of this encryption system, a dynamic protection mechanism for color images can be established, effectively preventing unauthorized individuals from accessing and interpreting encrypted image content, thereby comprehensively safeguarding the confidentiality and integrity of visual information throughout the entire transmission, storage, and processing process. Summary of the Invention
[0006] To address the technical bottlenecks of existing image encryption technologies, such as insufficient security, low encryption efficiency, and poor environmental adaptability, this paper provides a color image encryption method and system based on a memristive neural network. This method not only improves the encryption system's resistance to brute force and chosen-plaintext attacks, but also features low computational complexity and simple engineering implementation, making it particularly suitable for real-time encryption requirements in resource-constrained scenarios. This encryption system establishes a dynamic protection mechanism for color images, effectively blocking unauthorized individuals from accessing and analyzing encrypted image content, thereby comprehensively safeguarding the confidentiality and integrity of visual information throughout its transmission, storage, and processing.
[0007] To achieve the above object, the present invention provides the following solutions:
[0008] A color image encryption method based on a memristive neural network, the method comprising:
[0009] The memristor is introduced into the Hopfield neural network as a synapse between three neurons to obtain a memristive Hopfield neural network.
[0010] Generate a secret key matrix based on the memristor Hopfield neural network;
[0011] Obtain the pixel value matrix of the color image to be encrypted in the R, G, and B directions, and use the Arnold scrambling method to scramble the positions of the pixels;
[0012] The scrambled pixel value matrix is XORed with the secret key matrix to obtain the encrypted pixel value matrix in the R, G, and B directions, and then restored to the encrypted color image pixel value matrix to obtain the encrypted image.
[0013] Preferably, the method for constructing a memristive Hopfield neural network includes:
[0014]
[0015] Among them, x, y, z and v are the state variables of the network, and is the derivative of the state variable, a, b, c are network parameters, and tanh represents the hyperbolic tangent function, which is used to simulate the activation function of neurons.
[0016] Preferably, according to the memristive Hopfield neural network, the method for generating a secret key matrix includes:
[0017] Use the pseudo-random number generation formula to convert the state variables x, y, and z into three sets of pseudo-random sequences. The pseudo-random number generation formula is:
[0018] K i =[(s i +|s min |)·M]mod A;
[0019] Among them, K i Represents the i-th element of the pseudo-random sequence, s i is the i-th element of the state variable, s min represents the minimum value in the state variable, M is a positive integer, A is the maximum amplitude value in the K sequence, and mod represents the modulo operation;
[0020] The formula for determining the initial element position Lo of the secret key matrix is:
[0021] Lo=[ΣI c ]rem 256;
[0022] Among them, I c is the pixel value matrix of the color image, and "rem" represents the remainder operation;
[0023] Starting from position Lo, three sets of pseudo-random sequences with 262144 elements each are intercepted and arranged in sequence into three secret key matrices with 512 rows and 512 columns.
[0024] Preferably, the method of obtaining the pixel value matrix of the color image in the three directions of R, G, and B and scrambling the positions of the pixels using the Arnold scrambling method includes:
[0025]
[0026] Among them, (m, n) represents the original pixel value matrix, (m′, n′) represents the scrambled pixel value matrix, e, f, g and h are elements in the transformation matrix, j is the number of rows or columns in the original pixel value matrix, and the four elements in the transformation matrix need to satisfy the condition e*hf*g=1.
[0027] Preferably, the scrambled pixel value matrix is XORed with the secret key matrix to obtain an encrypted pixel value matrix in the R, G, and B directions, and then restored to the encrypted color image pixel value matrix. The method for obtaining the encrypted image includes:
[0028] M C =M R xor M K ;
[0029] Among them, M R is the scrambled pixel value matrix, M K is the secret key matrix, M C is the encrypted pixel value matrix, and xor is the exclusive OR operation.
[0030] The present invention also provides a color image encryption system based on a memristive neural network, the system is used to implement the above method, the system includes: a construction module, a generation module, a scrambling module and an encryption module;
[0031] The building block is used to introduce a memristor into a Hopfield neural network as a synapse between three neurons to obtain a memristive Hopfield neural network;
[0032] The generation module is used to generate a secret key matrix based on a memristive Hopfield neural network;
[0033] The scrambling module is used to obtain the pixel value matrix of the color image to be encrypted in the R, G, and B directions, and scramble the positions of the pixels using the Arnold scrambling method;
[0034] The encryption module is used to perform an XOR operation on the scrambled pixel value matrix and the secret key matrix to obtain an encrypted pixel value matrix in the three directions of R, G, and B, and restore it to the encrypted color image pixel value matrix to obtain an encrypted image.
[0035] Preferably, the process of constructing a memristive Hopfield neural network includes:
[0036]
[0037] Among them, x, y, z and v are the state variables of the network, and is the derivative of the state variable, a, b, c are network parameters, and tanh represents the hyperbolic tangent function, which is used to simulate the activation function of neurons.
[0038] Preferably, the generating module includes: a conversion unit and an interception unit;
[0039] The conversion unit is used to convert the state variables x, y, and z into three sets of pseudo-random sequences using a pseudo-random number generation formula. The pseudo-random number generation formula is:
[0040] K i =[(s i +|s min |)·M]mod A;
[0041] Among them, K i Represents the i-th element of the pseudo-random sequence, s i is the i-th element of the state variable, s min represents the minimum value in the state variable, M is a positive integer, A is the maximum amplitude value in the K sequence, and mod represents the modulo operation;
[0042] The formula for determining the initial element position Lo of the secret key matrix is:
[0043] Lo=[ΣI c ]rem 256;
[0044] Among them, I c is the pixel value matrix of the color image, and "rem" represents the remainder operation;
[0045] The interception unit is used to intercept three groups of pseudo-random sequences, each with 262144 elements, starting from position Lo, and arrange them in sequence into three key matrices with 512 rows and 512 columns.
[0046] Preferably, the process of obtaining the pixel value matrix of the color image in the three directions of R, G, and B and scrambling the positions of the pixels using the Arnold scrambling method includes:
[0047]
[0048] Among them, (m, n) represents the original pixel value matrix, (m′, n′) represents the scrambled pixel value matrix, e, f, g and h are elements in the transformation matrix, j is the number of rows or columns in the original pixel value matrix, and the four elements in the transformation matrix need to satisfy the condition e*hf*g=1.
[0049] Preferably, the scrambled pixel value matrix is XORed with the secret key matrix to obtain an encrypted pixel value matrix in the R, G, and B directions, and then restored to the encrypted color image pixel value matrix. The process of obtaining the encrypted image includes:
[0050] M C =M R xor M K ;
[0051] Among them, M R is the scrambled pixel value matrix, M K is the secret key matrix, M C is the encrypted pixel value matrix, and xor is the exclusive OR operation.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] This invention combines the technical advantages of memristors and Hopfield neural networks to achieve innovative improvements in color image encryption schemes. The main benefits include:
[0054] The chaotic dynamics of memristor neural networks significantly enhance the complexity and randomness of encryption keys. By optimizing the encryption process through XOR operations, computational overhead is significantly reduced, effectively improving encryption efficiency. Combining dynamic diffusion mechanisms with multi-dimensional scrambling strategies, a multi-layered security protection system is constructed, significantly enhancing the encrypted image's ability to resist common threats such as differential and statistical attacks. This technological achievement not only injects innovation into the field of image encryption but also expands the engineering application path of memristors and neuromorphic computing in information security, driving the evolution of intelligent encryption technology towards higher security levels and a wider range of applicable scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0056] Figure 1 This is a flowchart of encryption and decryption in an embodiment of the present invention;
[0057] Figure 2 This is a structural diagram of a memristor Hopfield neural network in an embodiment of the present invention;
[0058] Figure 3 Graphs of attractor phase trajectories of a memristive Hopfield neural network according to an embodiment of the present invention, where (a) is the xz phase plane, (b) is the xv phase plane, and (c) is the yv phase plane.
[0059] Figure 4 The color images in the embodiment of the present invention include: (a) a five-pointed star, (b) a UFO, and (c) a shield;
[0060] Figure 5 The encrypted images in the embodiment of the present invention include: (a) a five-pointed star, (b) a UFO, and (c) a shield;
[0061] Figure 6 Decrypted images in an embodiment of the present invention, including (a) a five-pointed star, (b) a UFO, and (c) a shield;
[0062] Figure 7 Pixel distribution diagram of a color image in an embodiment of the present invention, where (a) is a five-pointed star, (b) is a UFO, and (c) is a shield;
[0063] Figure 8 Pixel distribution diagram of an encrypted image in an embodiment of the present invention, where (a) is a five-pointed star, (b) is a UFO, and (c) is a shield;
[0064] Figure 9 1 is a histogram of a color image in an embodiment of the present invention, wherein (a) is a five-pointed star, (b) is a UFO, and (c) is a shield;
[0065] Figure 10 The histogram of the encrypted image in the embodiment of the present invention, where (a) is a five-pointed star, (b) is a UFO, and (c) is a shield;
[0066] Figure 11 Correlation diagrams of color images in an embodiment of the present invention, where (a) a five-pointed star, (b) a UFO, and (c) a shield;
[0067] Figure 12 Correlation diagrams of encrypted images in an embodiment of the present invention, where (a) a five-pointed star, (b) a UFO, and (c) a shield;
[0068] Figure 13 The encrypted images subjected to a 15% shear attack in an embodiment of the present invention include: (a) a five-pointed star, (b) a UFO, and (c) a shield.
[0069] Figure 14 This is a decrypted image that was subjected to a 15% shear attack in an embodiment of the present invention, where (a) is a five-pointed star, (b) is a UFO, and (c) is a shield;
[0070] Figure 15 The encrypted images subjected to salt and pepper noise attack with a density of 0.1 in the embodiment of the present invention include (a) a five-pointed star, (b) a UFO, and (c) a shield.
[0071] Figure 16 These are decrypted images attacked by salt and pepper noise with a density of 0.1 in an embodiment of the present invention, where (a) is a five-pointed star, (b) is a UFO, and (c) is a shield. DETAILED DESCRIPTION
[0072] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0073] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0074] Example 1
[0075] The programming software used in the present invention is Matlab R2020a.
[0076] like Figure 1 As shown, the present invention provides a color image encryption method based on a memristive Hopfield neural network, which includes three main parts: construction of a memristive Hopfield neural network, key generation, and image encryption. The complete encryption process is as follows:
[0077] Step 1: Establish a memristor Hopfield neural network: Introduce the memristor into the Hopfield neural network as the synapse between three neurons to obtain a memristor Hopfield neural network, such as Figure 2 As shown. The mathematical model of the memristor is:
[0078]
[0079] Among them, a, b and c are real constants, is the magnetic flux, is the relationship between magnetic flux and charge, The mathematical model of the Hopfield neural network with n neurons is:
[0080]
[0081] Among them, C i 、R i and v i Represent the capacitance, resistance and voltage on the cell membrane of the i-th neuron, I i is the external input current, is the derivative of the voltage on the cell membrane of the i-th neuron, n is the number of neurons, and N* is a positive integer. "tanh" represents the hyperbolic tangent function, which is used to simulate the activation function of neurons. ijIs the synaptic weight, which represents the connection strength between the i-th neuron and the j-th neuron. The synaptic weight matrix w ij for:
[0082]
[0083] Where 2·W(v) is the connection strength between the first neuron and the second neuron, and d·W(v) is the connection strength between the first neuron and the third neuron. i 、R i and v i Equal to 0, substituting formulas (1) and (3) into formula (2), we can get the state equation of the memristive Hopfield neural network:
[0084]
[0085] Among them, x, y, z and v are the state variables of the network, and is the derivative of the state variable, and a, b, c, and d are network parameters (the real constants in the previous formula (1) will become the network parameters in formula (4) after being substituted into formula (2)).
[0086] Setting the network parameters a=1, b=3, c=1, d=-10, and the network initial state x0=0.1, y0=0, z0=0, v0=0, we can get the attractor phase trajectory of the memristive Hopfield neural network as follows: Figure 3 shown.
[0087] Step 2: Generate the secret key matrix: Use the pseudo-random number generation formula to convert the state variables x, y, and z into three sets of pseudo-random sequences (the pseudo-random sequence is an array of length 1250001). The pseudo-random number generation formula is:
[0088] K i =[(s i +|s min |)·M]mod A; (5)
[0089] Among them, K i Represents the i-th element of the pseudo-random sequence, s i is the i-th element of the state variable, s min "A" represents the minimum value of the state variable, M is a positive integer, A is the maximum amplitude value in the K sequence, and "mod" represents the modulo operation. The security of the secret key depends on the randomness of the pseudorandom sequence. The pseudorandom sequence was tested using the NIST (National Institute of Standards and Technology) SP800-22 test suite. The test results are shown in Table 1 below.
[0090] Table 1
[0091]
[0092] The diffusion algorithm used in this invention is based on a key matrix. The initial element positions of different key matrices can be determined by the pixel value matrix of the color image. Different initial element positions of the key matrix result in completely different key matrices. When the pixel value matrix of the original color image undergoes a slight change, the diffusion algorithm of this invention can ensure that the pixel value matrix of the encrypted image undergoes a significant change, thereby ensuring the security of the encryption. The formula for determining the initial element position Lo of the key matrix is:
[0093] Lo=[∑I c ]rem 256; (6)
[0094] Among them, I c is the pixel value matrix of the color image, and “rem” represents the remainder operation. Starting from position Lo, three sets of pseudo-random sequences with 262144 elements each are intercepted and arranged in sequence into three secret key matrices with 512 rows and 512 columns. That is, the secret key matrices from the first element in the upper left corner to the last element in the lower right corner are K Lo , K Lo+1 , K Lo+2 ,…,K Lo+262142 , K Lo+262143 , K Lo+262144 .
[0095] Step 3: Scramble the color image: Obtain the pixel value matrix of the color image to be encrypted in the R, G, and B directions, and use the Arnold scrambling method to scramble the positions of their pixels. The rules of the Arnold scrambling method are:
[0096]
[0097] Where (m, n) represents the original pixel value matrix, (m', n') represents the scrambled pixel value matrix, e, f, g, and h are the elements in the transformation matrix, and j is the number of rows or columns in the original pixel value matrix. It should be noted that the four elements in the transformation matrix need to satisfy the condition e*hf*g=1, which ensures that Arnold scrambling is reversible.
[0098] Step 4: Encrypt the scrambled pixel value matrix: XOR the scrambled pixel value matrix with the secret key matrix to obtain the encrypted pixel value matrix in the R, G, and B directions, and then restore it to the encrypted color image pixel value matrix to obtain the encrypted image. The encryption process in one direction is:
[0099] M C =M R xor MK ; (8)
[0100] Among them, M R is the scrambled pixel value matrix, M K is the secret key matrix, M C is the encrypted pixel value matrix, and xor is the exclusive OR operation. The rule of the exclusive OR operation is that when the two inputs are different, the output is 1. When the two inputs are the same, the output is 0.
[0101] The color image decryption process based on the memristive Hopfield neural network includes the following steps:
[0102] Step 1: Decrypt the encrypted image: Obtain the pixel value matrix of the encrypted image in the R, G, and B directions, and perform an XOR operation with the secret key matrix to obtain the decrypted pixel value matrix in the R, G, and B directions, and then restore it to the decrypted color image pixel value matrix.
[0103] Step 2: Scramble and restore the encrypted image: Use the Arnold scrambling method to scramble and restore the pixel value matrix of the decrypted color image to obtain the decrypted image. It is important to note that the transformation matrix used for scrambling and restoration must be consistent with the transformation matrix used for scrambling.
[0104] Use the above encryption and decryption steps to Figure 4 The color image shown is encrypted and decrypted, and the encrypted image and the decrypted image are as follows Figure 5 and Figure 6 shown.
[0105] In order to evaluate the encryption performance of the designed encryption method, the pixel distribution graph, histogram and correlation graph of the color image and the encrypted image are plotted, as shown in Figures 7 to 12 shown.
[0106] In order to evaluate the robustness of the designed encryption method, a 15% cropping attack and a salt and pepper noise attack with a density of 0.1 are added to the encrypted image, as shown in Figure 13 and 15 Then, the attacked image is decrypted using the designed method, and the result is as follows: Figure 14 and 16 shown.
[0107] In summary, the present invention is based on a color image encryption scheme of a memristive Hopfield neural network, and constructs a new chaotic encryption architecture by deeply integrating the non-volatile storage characteristics of memristive devices with the associative memory capabilities of the Hopfield neural network. This system uses the hyperchaotic sequence generated by the memristive neural network as a dynamic encryption key, and combines the pixel-level diffusion algorithm with the multi-dimensional scrambling mechanism to achieve a dual encryption mapping of the pixel value distribution and spatial position of the color image. This method not only improves the encryption system's ability to resist brute force and chosen plaintext attacks, but also has low computational complexity and convenient engineering implementation, making it particularly suitable for real-time encryption requirements in resource-constrained scenarios. Through the implementation of this encryption system, a dynamic protection mechanism for color images can be established, effectively blocking unauthorized individuals from obtaining and parsing the encrypted image content, thereby comprehensively protecting the confidentiality and integrity of visual information in the entire process of transmission, storage and processing.
[0108] Example 2
[0109] The present invention also provides a color image encryption system based on a memristive neural network, the system being used to implement the method described in Example 1, the system comprising: a construction module, a generation module, a scrambling module, and an encryption module;
[0110] Building blocks for introducing memristors into a Hopfield neural network as synapses between three neurons, resulting in a memristive Hopfield neural network.
[0111] A generation module, used to generate a secret key matrix based on a memristor Hopfield neural network;
[0112] The scrambling module is used to obtain the pixel value matrix of the color image to be encrypted in the R, G, and B directions, and scramble the positions of the pixels using the Arnold scrambling method;
[0113] The encryption module is used to perform an XOR operation on the scrambled pixel value matrix and the secret key matrix to obtain an encrypted pixel value matrix in the three directions of R, G, and B, and restore it to the encrypted color image pixel value matrix to obtain an encrypted image.
[0114] In this embodiment, the process of constructing a memristive Hopfield neural network includes:
[0115]
[0116] Among them, x, y, z and v are the state variables of the network, and is the derivative of the state variable, a, b, c are network parameters, and tanh represents the hyperbolic tangent function, which is used to simulate the activation function of neurons.
[0117] In this embodiment, the generating module includes: a conversion unit and an interception unit;
[0118] The conversion unit is used to convert the state variables x, y, and z into three sets of pseudo-random sequences using a pseudo-random number generation formula. The pseudo-random number generation formula is:
[0119] K i =[(s i +|s min |)·M]mod A;
[0120] Among them, K i Represents the i-th element of the pseudo-random sequence, s i is the i-th element of the state variable, s min represents the minimum value in the state variable, M is a positive integer, A is the maximum amplitude value in the K sequence, and mod represents the modulo operation;
[0121] The formula for determining the initial element position Lo of the secret key matrix is:
[0122] Lo=[∑I c ]rem 256;
[0123] Among them, I c is the pixel value matrix of the color image, and "rem" represents the remainder operation;
[0124] The interception unit is used to intercept three groups of pseudo-random sequences, each with 262144 elements, starting from the position Lo, and arrange them in sequence into three secret key matrices with 512 rows and 512 columns.
[0125] In this embodiment, the process of obtaining the pixel value matrix of the color image in the R, G, and B directions and scrambling the positions of the pixels using the Arnold scrambling method includes:
[0126]
[0127] Among them, (m, n) represents the original pixel value matrix, (m′, n′) represents the scrambled pixel value matrix, e, f, g and h are elements in the transformation matrix, j is the number of rows or columns in the original pixel value matrix, and the four elements in the transformation matrix need to satisfy the condition e*hf*g=1.
[0128] In this embodiment, the scrambled pixel value matrix is XORed with the key matrix to obtain an encrypted pixel value matrix in the R, G, and B directions, and then restored to the encrypted color image pixel value matrix. The process of obtaining the encrypted image includes:
[0129] M C =M R xor M K ;
[0130] Among them, M R is the scrambled pixel value matrix, M K is the secret key matrix, M C is the encrypted pixel value matrix, and xor is the exclusive OR operation.
[0131] The contributions and innovations of the present invention are summarized as follows:
[0132] (1) A memristor is introduced into the Hopfield neural network as a neuron between three synapses, and a new memristive Hopfield neural network is obtained. Due to the unique nonlinear characteristics of the memristor, the proposed memristive Hopfield neural network can produce rich dynamic phenomena.
[0133] (2) Using a memristor Hopfield neural network to generate a key, a color image encryption algorithm was designed by combining the XOR algorithm with the Arnold scrambling method. Experimental verification shows that the designed algorithm exhibits high security and reconstruction accuracy.
[0134] The embodiments described above are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by persons skilled in the art should fall within the scope of protection defined by the claims of the present invention.
Claims
1. A color image encryption method based on memristive neural network, characterized in that: The method comprises: The memristor is introduced into the Hopfield neural network as a synapse between three neurons to obtain a memristive Hopfield neural network. Generate a secret key matrix based on the memristor Hopfield neural network; Obtain the pixel value matrix of the color image to be encrypted in the R, G, and B directions, and use the Arnold scrambling method to scramble the positions of the pixels; The scrambled pixel value matrix is XORed with the secret key matrix to obtain the encrypted pixel value matrix in the R, G, and B directions, and then restored to the encrypted color image pixel value matrix to obtain the encrypted image.
2. The method according to claim 1, characterized in that Methods for constructing memristive Hopfield neural networks include: Among them, x, y, z and v are the state variables of the network, and is the derivative of the state variable, a, b, c are network parameters, and tanh represents the hyperbolic tangent function, which is used to simulate the activation function of neurons.
3. The method according to claim 2, characterized in that According to the memristive Hopfield neural network, the method of generating the secret key matrix includes: Use the pseudo-random number generation formula to convert the state variables x, y, and z into three sets of pseudo-random sequences. The pseudo-random number generation formula is: K i =[(s i +|s min |)·M]modA; Among them, K i Represents the i-th element of the pseudo-random sequence, s i is the i-th element of the state variable, s min represents the minimum value in the state variable, M is a positive integer, A is the maximum amplitude value in the K sequence, and mod represents the modulo operation; The formula for determining the initial element position Lo of the secret key matrix is: Lo=[∑I c ]rem 256; Among them, I c is the pixel value matrix of the color image, "rem" means the remainder operation; Starting from position Lo, three sets of pseudo-random sequences with 262144 elements each are intercepted and arranged in sequence into three secret key matrices with 512 rows and 512 columns.
4. The method according to claim 3, characterized in that The method of obtaining the pixel value matrix of the color image in the R, G, and B directions and using the Arnold scrambling method to scramble the positions of the pixels includes: Among them, (m, n) represents the original pixel value matrix, (m′, n′) represents the scrambled pixel value matrix, e, f, g and h are elements in the transformation matrix, j is the number of rows or columns in the original pixel value matrix, and the four elements in the transformation matrix need to satisfy the condition e*hf*g=1.
5. The method according to claim 4, characterized in that The scrambled pixel value matrix is XORed with the secret key matrix to obtain an encrypted pixel value matrix in the R, G, and B directions, and then restored to the encrypted color image pixel value matrix. The method for obtaining the encrypted image includes: M C =M R xorM K ; Among them, M R is the scrambled pixel value matrix, M K is the secret key matrix, M C is the encrypted pixel value matrix, and xor is the exclusive OR operation.
6. A color image encryption system based on a memristive neural network, the system being used to implement the method according to any one of claims 1 to 5, characterized in that: The system includes: a construction module, a generation module, a scrambling module and an encryption module; The building block is used to introduce a memristor into a Hopfield neural network as a synapse between three neurons to obtain a memristive Hopfield neural network; The generation module is used to generate a secret key matrix based on a memristive Hopfield neural network; The scrambling module is used to obtain the pixel value matrix of the color image to be encrypted in the R, G, and B directions, and scramble the positions of the pixels using the Arnold scrambling method; The encryption module is used to perform an XOR operation on the scrambled pixel value matrix and the secret key matrix to obtain an encrypted pixel value matrix in the three directions of R, G, and B, and restore it to the encrypted color image pixel value matrix to obtain an encrypted image.
7. The system according to claim 6, characterized in that The process of building a memristive Hopfield neural network includes: Among them, x, y, z and v are the state variables of the network, and is the derivative of the state variable, a, b, c are network parameters, and tanh represents the hyperbolic tangent function, which is used to simulate the activation function of neurons.
8. The system according to claim 7, characterized in that The generation module includes: a conversion unit and an interception unit; The conversion unit is used to convert the state variables x, y, and z into three sets of pseudo-random sequences using a pseudo-random number generation formula. The pseudo-random number generation formula is: K i =[(s i +|s min |)·M]mod A; Among them, K i Represents the i-th element of the pseudo-random sequence, s i is the i-th element of the state variable, s min represents the minimum value in the state variable, M is a positive integer, A is the maximum amplitude value in the K sequence, and mod represents the modulo operation; The formula for determining the initial element position Lo of the secret key matrix is: Lo=[∑I c ]rem 256; Among them, I c is the pixel value matrix of the color image, "rem" means the remainder operation; The interception unit is used to intercept three groups of pseudo-random sequences, each with 262144 elements, starting from position Lo, and arrange them in sequence into three key matrices with 512 rows and 512 columns.
9. The system according to claim 8, characterized in that The process of obtaining the pixel value matrix of the color image in the R, G, and B directions and scrambling the pixel positions using the Arnold scrambling method includes: Among them, (m, n) represents the original pixel value matrix, (m′, n′) represents the scrambled pixel value matrix, e, f, g and h are elements in the transformation matrix, j is the number of rows or columns in the original pixel value matrix, and the four elements in the transformation matrix need to satisfy the condition e*hf*g=1.
10. The system according to claim 9, characterized in that The scrambled pixel value matrix is XORed with the secret key matrix to obtain the encrypted pixel value matrix in the R, G, and B directions, and then restored to the encrypted color image pixel value matrix. The process of obtaining the encrypted image includes: M C =M R xorM K ; Among them, M R is the scrambled pixel value matrix, M K is the secret key matrix, M C is the encrypted pixel value matrix, and xor is the exclusive OR operation.
Citation Information
Patent Citations
Image encryption algorithm based on discrete Hopfield neural network
CN113360920A
Image encryption method based on multistable memristor and four-dimensional chaotic neural network
CN116193041A