Image encryption and decryption method based on dynamic Hille cipher and Arnod scrambling algorithm
Through the combination of dynamic Hill cipher and Arnold scrambling algorithm, the problem of insufficient security of traditional Hill cipher is solved, higher image encryption security and fast decryption capability are achieved, which is suitable for safe transmission of medical images.
Patent Information
- Application Number
- CN202410985675.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-10-11
AI Technical Summary
The traditional Hill cipher has problems of weak security and lack of robustness in image encryption, which makes encrypted images susceptible to interference during transmission and cannot ensure the security and confidentiality of medical images.
An image encryption method based on dynamic Hill cipher and Arnold scrambling algorithm is used. The ciphertext matrix is generated by Arnold scrambling algorithm, and a time-varying dynamic key is used for secondary encryption. The return-to-zero neural network is used to solve the inverse of the time-varying secret key. The matrix is decrypted and the original image is restored.
It improves the confidentiality and security of image encryption, enhances the complexity and flexibility of encryption algorithms, and ensures the security and rapid decryption capabilities of medical images during transmission.
Smart Images

Figure CN118764568A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image encryption and decryption methods, and in particular to an image encryption and decryption method based on a dynamic Hill cipher and an Arnold scrambling algorithm. Background Art
[0002] Nowadays, in an era when information security faces serious threats, cryptography has become an indispensable part of the field of information security, especially in the information security of medical images. In the medical field, due to the continuous development of magnetic resonance imaging (MRI), X-ray and other scanning and imaging technologies, more than 90% of patients' medical images are processed and stored in electronic devices. However, unauthorized access to medical information through the Internet can lead to infringement of patients' rights. In order to ensure the security of information, cryptography has been widely studied and applied in various fields such as artificial intelligence, data transmission, information confrontation and medical image encryption. In addition, matrix theory is useful in cryptography, and it is often used in encryption algorithms such as Playfair cipher, Knapsack cipher, Chaos cipher, Hill cipher, etc. Generally, most encryption algorithms consist of the following five main components: plaintext, key, ciphertext, encryption and decryption. Encryption algorithms continue to develop with the advancement of technology and are widely used in image encryption.
[0003] Image encryption involves converting a normal image into a ciphertext image for transmission. Arnold scrambling algorithm and Hill cipher are two important encryption methods. Arnold scrambling algorithm permutes the coordinates of each pixel of the original image to obtain new coordinates, and then repeats the scrambling operation on these new coordinates multiple times to complete the permutation and realize image encryption. Traditional Hill cipher (THC) has always attracted the attention of experts as an important encryption method. In addition, THC is based on algebraic methods and uses a time-invariant key matrix for encryption, which leads to weak algorithm security and lack of good robustness of THC. The encrypted image information is inevitably disturbed during its transmission, which will lead to significant differences between the decrypted image and the initial image after receiving the image on the receiver side. Therefore, THC is not suitable for image encryption and transmission. In the medical field, it is becoming increasingly important to encrypt medical images efficiently and securely at the sending end and to decrypt medical images quickly and robustly at the receiving end. However, it is difficult to ensure the security and confidentiality of medical images during transmission by simply using the above-mentioned Arnold scrambling algorithm or THC method. Summary of the invention
[0004] In view of the above technical problems to be solved, the present invention provides an image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm.
[0005] In order to solve the above technical problems, the technical solution proposed by the present invention is:
[0006] An image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm, the encryption method comprising the following steps:
[0007] Step S1: Collect data of image samples and extract pixels to form a plaintext matrix to be encrypted;
[0008] Step S2: Obtain a plaintext matrix, scramble the matrix by using the Arnold scrambling algorithm to generate a first ciphertext matrix; select a time-varying dynamic key, perform secondary encryption on the first ciphertext matrix to form an encrypted ciphertext matrix, and transmit the encrypted ciphertext matrix;
[0009] The decryption method comprises the following steps:
[0010] Step S3: Obtain the ciphertext image and extract pixels to form a ciphertext matrix to be decrypted;
[0011] Step S4: obtaining the inverse matrix of the dynamic time-varying secret key through the zeroing neural network, and extracting the first ciphertext matrix that only changes the pixel position but does not change the pixel value by operating the inverse matrix with the ciphertext obtained in step S3;
[0012] Step S5: The matrix extracted from the first ciphertext image is operated through the inverse process of the Arnold scrambling algorithm, and restored to the original image sample at the receiving end.
[0013] As a further improvement of the above technical solution:
[0014] Preferably, the step S2 specifically includes the following steps:
[0015] S2-1, obtain a plaintext matrix, scramble the matrix by using the Arnold scrambling algorithm, and generate a first ciphertext matrix;
[0016] The two-dimensional Arnold scrambling algorithm with two parameters is as follows:
[0017]
[0018] Where a and b are scrambling parameters, x and y represent the original positions of the elements in the plaintext matrix of the image, x' and y' represent the positions of the elements in the plaintext matrix after scrambling, and N is the size of the matrix;
[0019] Set the original pixel position to (x, y), map it to the new coordinate (x', y') through formula (1), and scramble the pixel position in the plaintext matrix; set the number of scrambling times to n, transform the obtained new coordinate (x', y') n times through the mapping relationship, and destroy the pixel position information; set the scrambling parameters a and b to control the pixel position in the image;
[0020] The scrambled coordinates (x ′ ,y ′ ) Repeat the Arnold scrambling algorithm to obtain the pixel coordinates (x ″ ,y ″ ), repeat this operation until the preset number of scrambling times is reached to obtain the first ciphertext matrix;
[0021] S2-2, selecting a time-varying dynamic key, performing secondary encryption on the first ciphertext matrix to form an encrypted ciphertext matrix;
[0022] An n-dimensional time-varying matrix is designed as a time-varying dynamic key matrix D(t) for encryption; the scrambled first ciphertext image is obtained by the Arnold scrambling algorithm, and the matrix extracted from the scrambled first ciphertext image is multiplied by the time-varying dynamic key matrix D(t) to obtain the final ciphertext image.
[0023] Preferably, in step S2, if the grayscale image is converted into a plaintext matrix, the plaintext matrix is a matrix composed of pixels of corresponding sizes; if the color image is converted into a plaintext matrix, the color image is composed of three channels of R, G, and B, and the formed image is a matrix composed of three pixels of corresponding sizes, then all three matrices are operated.
[0024] Preferably, if the original image is a grayscale image, the matrix extracted from the scrambled first ciphertext image is regarded as M, and multiplied by the time-varying dynamic key matrix D(t), and the final ciphertext image is M * (t) = D(t)M; if the original image is a color image, the three matrices extracted from the first ciphertext image are regarded as M1, M2, and M3 respectively, and then multiplied with the time-varying dynamic key matrix respectively, and then the combination is combined in the initial manner of the three channels to obtain the final ciphertext image.
[0025] Preferably, the step S4 specifically includes the following steps:
[0026] S4-1, the inverse matrix of the dynamic time-varying secret key is obtained by the zeroing neural network technology;
[0027] Construct a fuzzy zeroing neural network model with convergence and robustness to solve the inverse matrix D of the time-varying secret key matrix of the dynamic Hill cipher -1 (t); in solving D -1(t) Then, the ciphertext matrix obtained in step S3 is operated, and the first ciphertext image is composed of the ciphertext matrix M * (t) multiplied by D -1 (t) is obtained, denoted as M = D -1 (t)M * (t) = D -1 (t)D(t)M;
[0028] S4-2, through the inverse matrix D -1 (t) operating the ciphertext obtained in step S3 to extract a first ciphertext matrix in which only the pixel positions are changed but the pixel values are not changed.
[0029] Preferably, in S4-1, the following equation is defined:
[0030] A(t)D(t)=I (2)
[0031] Where D(t) represents the known time-varying dynamic key matrix, I is the n-dimensional identity matrix, and A(t) = D -1 (t) is the inverse matrix to be solved;
[0032] Solve the equation A(t)=D -1 (t) is constructed in three steps:
[0033] Step 1: Construct the following error function E(t):
[0034] E(t)=A(t)D(t)-I (3)
[0035] By constructing an error function, the process of finding A(t) in equation (2) is transformed into the process of solving the equation E(t) = 0; if E(t) = 0, then the corresponding A(t) in equation (3) is the solution of equation (2);
[0036] Step 2: In order to make E(t) converge to 0 quickly, construct the following evolution formula:
[0037]
[0038] Among them, α>0 is a fixed convergence factor, P(·) and Represent the activation function array and the derivative of E(t) respectively;
[0039] Step 3: Construct the expression as shown:
[0040]
[0041] in, and represent the derivatives of A(t) and D(t) respectively;
[0042] The ZNN model with external noise is shown in formula (6):
[0043]
[0044] Where N(t) is the external noise and P(·) is the activation function array;
[0045] Design the fuzzy activation function NFAF as follows:
[0046]
[0047] Among them, m is the fuzzy parameter obtained by FLS, 0 <c<1,a1,a2,a3,a4> 0.
[0048] Implement the following fuzzy zeroing neural network model:
[0049]
[0050] Preferably, in step S5, the number of scrambling times n during Arnold scrambling is obtained; an inverse operation is performed on the obtained encrypted image to restore the destroyed position information to obtain the original image;
[0051] Extract the pixel matrix of the encrypted image and transform it back to the original image using the following equation:
[0052]
[0053] Assume the position of each element in the ciphertext image is The mapping relationship of formula (11) is converted into The original image is restored by performing reverse cyclic mapping through the set scrambling times n.
[0054] Compared with the prior art, the image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm provided by the present invention has the following advantages:
[0055] The image encryption and decryption method based on the dynamic Hill cipher and the Arnold scrambling algorithm of the present invention not only perfectly combines the characteristics of the traditional Hill cipher in encryption compared with the traditional Hill cipher, but also increases the complexity and flexibility of the dynamic Hill cipher algorithm by introducing a time-varying secret key and adding a scrambling algorithm. The confidentiality and security of the required encrypted image are improved through secondary encryption, so that it can be better used for image encryption, and the scope of use of the Hill cipher is widened. In terms of decryption, the present invention uses a zeroing neural network (ZNN) to provide a method for solving the inverse of a time-varying matrix, and optimizes the activation function in the method, so that it can more quickly derive the inverse of the time-varying matrix, and enables the decryption party to quickly decrypt the image encrypted by the dynamic Hill cipher. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] FIG. 1( a ) is a process diagram of THC of the present invention.
[0057] FIG1( b ) is a process diagram of DHCAST of the present invention.
[0058] Figure 2 This is the structure of the fuzzy logic system when the present invention is applied and implemented. DETAILED DESCRIPTION
[0059] The specific embodiments of the present invention are described in detail below. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0060] As shown in Figure 1 to Figure 2 As shown, the image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm of the present invention includes the following two aspects:
[0061] The image encryption comprises the following steps:
[0062] Step S1: Import the corresponding image samples through MATLAB, collect the data of the image samples, and form the plaintext matrix to be encrypted by extracting pixels.
[0063] Step S2: Obtain a plaintext matrix, scramble the matrix by using the Arnold scrambling algorithm to generate a first ciphertext matrix; select a time-varying dynamic key, perform secondary encryption on the first ciphertext matrix to form an encrypted ciphertext matrix, and transmit the encrypted ciphertext matrix.
[0064] The specific steps include:
[0065] S2-1, obtain a plaintext matrix, scramble the matrix by using the Arnold scrambling algorithm, and generate a first ciphertext matrix.
[0066] If a grayscale image is converted into a plaintext matrix, the plaintext matrix is a matrix composed of pixels of corresponding sizes. These pixels are strongly correlated, so an image can be formed. If a color image is converted into a plaintext matrix, because the color image is composed of three channels, R, G, and B, the final image is a matrix composed of three pixels of corresponding sizes. If the color image needs to be operated, all three matrices need to be operated.
[0067] The Arnold scrambling algorithm (i.e., the Arnold scrambling algorithm) scrambles the position of each pixel in the image to achieve the purpose of encryption. It is a reversible scrambling. The two-dimensional Arnold scrambling algorithm with two parameters is as follows:
[0068]
[0069] Among them, a and b are scrambling parameters, x and y represent the original positions of the elements in the plaintext matrix of the image, x' and y' represent the positions of the elements in the plaintext matrix after scrambling, and N is the size of the matrix.
[0070] When the original pixel position is (x, y), it is mapped to a new coordinate (x', y') by formula (1). This operation will disrupt the position of the pixel in the plaintext matrix.
[0071] The number of scrambling times is set to n, and the obtained new coordinates (x', y') are transformed n times through the mapping relationship. This operation will destroy the position information of the pixels and cause visual distortion and deformation of the original image.
[0072] Set the random parameters a and b to control the position of pixels in the image.
[0073] According to formula (1), the entire plaintext matrix is traversed and the position of each pixel is scrambled. This scrambling is repeated n times to disrupt the relative relationship between pixels and destroy the pixel position information.
[0074] The scrambled coordinates (x ′ ,y ′ ) Repeat the Arnold scrambling algorithm to obtain the pixel coordinates (x ″ ,y ″ ), repeat this operation until the preset number of scrambling times is reached, and the first ciphertext matrix can be obtained.
[0075] S2-2, select a time-varying dynamic key, perform secondary encryption on the first ciphertext matrix, and form an encrypted ciphertext matrix.
[0076] An n-dimensional time-varying matrix is designed as a time-varying dynamic key matrix D(t) for encryption. The time-varying dynamic key matrix D(t) is a dynamic matrix whose element values change with time t. The dynamic matrix is a reversible matrix at any time point t, that is, the determinant of the dynamic matrix is not 0.
[0077] To judge the image type, a color image usually consists of three channels: R, G, and B, which can be regarded as a three-dimensional space matrix. For example, in a 528*528*3 color image, two 528s represent the pixel information in the image, and 3 means that the image has three channels: R, G, and B, and each channel is a 528*528 matrix. Similar to a color image, a 528*528 grayscale image has only one channel, and the brightness of the grayscale image is described by the pixel values in its 528*528 channel matrix.
[0078] Generally speaking, the pixel information contained in the image is regarded as the plaintext information that needs to be encrypted. The encryption of color images can be achieved by encrypting the pixel information of the three RGB channels separately. The three RGB pixel channels of the color image are extracted as plaintext matrices P1, P2 and P3, while the grayscale image has only one channel that needs to be encrypted.
[0079] The scrambled first ciphertext image can be obtained through the Arnold scrambling algorithm. If the original image is a grayscale image, the matrix extracted from the scrambled first ciphertext image is regarded as M, and the selected time-varying dynamic key matrix D(t) is multiplied with it, and the final ciphertext image can be obtained as M * (t) = D(t) M. If the original image is a color image, the three matrices extracted from the first ciphertext image are regarded as M1, M2, and M3 respectively, and then multiplied with the selected time-varying dynamic key matrix respectively, and then combined in the original way of the three channels to obtain the final ciphertext image.
[0080] The decryption method comprises the following steps:
[0081] Step S3: Obtain the ciphertext image and extract the ciphertext matrix to be decrypted by extracting pixels.
[0082] Step S4: The inverse matrix of the dynamic time-varying secret key is obtained by the zeroing neural network technology, and the first ciphertext matrix that only changes the pixel position but does not change the pixel value is extracted by operating the inverse matrix with the ciphertext obtained in step S3.
[0083] The selection of the cryptographic key matrix D is very important for the THC encryption and decryption method. The key matrix D of THC is a time-invariant matrix. When an attacker has a part of the plaintext and the corresponding ciphertext, the key can be cracked by comparing the ciphertext with the plaintext, and the probability of the encrypted image being cracked is greatly increased, which leads to THC not being commonly used to encrypt medical images due to the lack of sufficient confidentiality. Therefore, in order to enhance the confidentiality of THC, this application proposes a new dynamic Hill cipher (DHCAST). DHCAST not only replaces the time-invariant secret key of THC with a time-varying dynamic key matrix D(t), but also performs joint encryption with the Arnold scrambling algorithm, which enhances the randomness of the password, greatly improves the complexity of the cryptographic key, and significantly improves its confidentiality.
[0084] The specific steps include:
[0085] S4-1, the zeroing neural network technology obtains the inverse matrix of the dynamic time-varying key.
[0086] The solution method of the dynamic key in the decryption process is analyzed. Since the dynamic key replaces the traditional time-invariant key, the traditional inverse method cannot be used. In order to solve this problem, a new fuzzy zeroing neural network (NFZNN) model with convergence and robustness is constructed to solve the inverse matrix (TVKIM) D of the time-varying key matrix of the proposed dynamic Hill cipher (DHCAST). -1 (t).
[0087] As mentioned above, it is possible to quickly and accurately solve D -1 (t) is crucial to the successful application of the proposed DHCAST. -1 (t), the following equation is defined:
[0088] A(t)D(t)=I (2)
[0089] Where D(t) represents the known time-varying dynamic key matrix, I is the n-dimensional identity matrix, and A(t) = D -1 (t) is the TVIKM matrix that the proposed DHCAST needs to solve.
[0090] Typically, the ZNN model is used to solve the above equation A(t)=D -1 (t) is constructed in three steps.
[0091] Step 1: By analyzing equation (2), the following error function E(t) is constructed:
[0092] E(t)=A(t)D(t)-I (3)
[0093] By constructing an error function, the process of finding A(t) in equation (2) can be transformed into the process of solving the equation E(t) = 0. By analyzing the above error function, it can be concluded that if E(t) = 0, then the corresponding A(t) in equation (3) is the solution in equation (2).
[0094] Step 2: The problem that needs to be solved is how to make E(t) converge to 0 quickly. In order to solve this problem, the following evolution formula is constructed:
[0095]
[0096] Among them, α>0 is a fixed convergence factor, P(·) and denote the activation function array and the derivative of E(t) respectively.
[0097] Step 3: TVIKM matrix A(t) = D for solving the proposed DHCAST -1The ZNN model of (t) can be constructed by deriving both sides of equation (3) at the same time. The specific expression is as follows
[0098]
[0099] in, and Represent the derivatives of A(t) and D(t) respectively.
[0100] In the process of image decryption and transmission, it is inevitable to be interfered by external factors. Therefore, the ZNN model used to decrypt images must have anti-interference ability to ensure successful decryption and transmission of images under various conditions. The ZNN model with external noise is shown in equation (6):
[0101]
[0102] Among them, N(t) is the external noise, P(·) is the activation function array, and different P(·) will lead to different decryption effects.
[0103] Before innovating P(·), it is necessary to design a fuzzy logic system (FLS) to introduce the fuzzy logic system into the active function array.
[0104] However, in many practical situations, due to noise and interference, information is often fuzzy and uncertain, and precise mathematical models may not be able to accurately describe the problem, while fuzzy theory can provide a more flexible and realistic representation. Fuzzy theory uses fuzzy sets, fuzzy logic operations and fuzzy reasoning to describe the fuzzy characteristics and laws of the problem, rather than a strict mathematical model, which makes it excellent in dealing with uncertainty, ambiguity and complexity.
[0105] Fuzzy logic systems (FLS) are widely used in the control field of nonlinear systems. The FLS structure for generating fuzzy parameters m is as follows: Figure 2 shown.
[0106] Figure 2 In the above equation, the input F(t) of FLS is a real-time variable closely related to noise, O is the real-time fuzzy output of FLS, and m is the generated fuzzy parameter. The specific process is as follows:
[0107] Step 1: Fuzzification
[0108] In fuzzy logic system, fuzzification is the process of converting input variables from exact values to fuzzy sets. Fuzzification methods usually include establishing fuzzy sets, setting membership functions, setting fuzzy rules and performing fuzzy reasoning. This application establishes a fuzzy set and uses Gaussian membership function as the membership function of the fuzzy logic system to convert the input E(t) into fuzzy input P, thereby introducing uncertainty or ambiguity in the fuzzy logic system. The specific expression of Gaussian membership function is as follows:
[0109]
[0110] Step 2: Match fuzzy rules and perform fuzzy reasoning
[0111] In this step, the established fuzzy reasoning mechanism "IF-THEN" rule is mainly relied on to infer different inputs and obtain the final reasoning results. The relationship between fuzzy input P and fuzzy output O is defined as follows:
[0112] Rule 1: if P=ZO then O=ZO
[0113] Rule 2: if P=PS then O=PS
[0114] Rule 3: if P=PM then O=PM
[0115] Rule 4: if P=PB then O=PB
[0116] Here, ZO, PS, PM, and PB represent the error values of zero error, small error, medium error, and large error, respectively. In addition, let Rule k = Rule1∪Rule2∪Rule3∪Rule4, where k=1, 2, 3, 4. Therefore, we can get the formula O=E(t)◇Rule k (k=1,2,3,4), the symbol ◇ represents fuzzy operation.
[0117] Step 3: Deblurring
[0118] The fuzzy parameter m can be obtained by the following defuzzification operation:
[0119] m=argmaxM E(t)◇R (O) (8)
[0120] in, The operations ∧ and ∨ represent the selection of the minimum and maximum values, respectively.
[0121] As described in the ZNN model (6), the activation function P(·) is an important function for the convergence of the ZNN model. Therefore, this application designs a new fuzzy activation function (NFAF) as follows:
[0122]
[0123] Among them, m is the fuzzy parameter obtained by FLS, 0 <c<1,a1,a2,a3,a4> 0.
[0124] Then, following the same steps of constructing the ZNN model formula (6), the following NFZNN model is implemented:
[0125]
[0126] After solving the inverse matrix D of the dynamic key matrix -1 (t) Then operate on the ciphertext matrix obtained at the beginning. The first ciphertext image can be obtained by the ciphertext matrix M * (t) Multiply by D -1 (t) is obtained, denoted as M = D -1 (t)M * (t) = D -1 (t)D(t)M.
[0127] S4-2, through the inverse matrix D -1 (t) operating the ciphertext obtained in step S3 to extract a first ciphertext matrix in which only the pixel positions are changed but the pixel values are not changed.
[0128] Step S5: The matrix extracted from the first ciphertext image is operated through the inverse process of the Arnold scrambling algorithm, and restored to the original image sample at the receiving end.
[0129] After the first ciphertext matrix is restored through the inverse matrix of the dynamic key, the plaintext pixel matrix P can be obtained by performing the inverse transformation of the Arnold scrambling algorithm for the number of times set in the first ciphertext matrix.
[0130] First, obtain the number of scrambling times n during the original Arnold scrambling.
[0131] The Arnold scrambling algorithm is the process of scrambling and sorting the position information of pixels, and the Arnold scrambling algorithm is the reverse of its encryption process. The original image can be obtained by performing an inverse operation on the obtained encrypted image to restore the destroyed position information. Therefore, the pixel matrix of the encrypted image is extracted and restored to the original image by transforming it through the following equation:
[0132]
[0133] Assume the position of each element in the ciphertext image is The mapping relationship of formula (11) is converted into By performing reverse cyclic mapping with the set scrambling times n, the original image can be restored.
[0134] The above implementation cases are only preferred embodiments of the present invention and are not intended to limit the present invention in any form. Although the present invention has been disclosed as above with preferred embodiments, they are not intended to limit the present invention. Therefore, any simple modification, 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 shall fall within the scope of protection of the technical solution of the present invention.
Claims
1. An image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm, characterized in that: The encryption method comprises the following steps: Step S1: Collect data of image samples and extract pixels to form a plaintext matrix to be encrypted; Step S2: Obtain a plaintext matrix, scramble the matrix by using the Arnold scrambling algorithm to generate a first ciphertext matrix; select a time-varying dynamic key, perform secondary encryption on the first ciphertext matrix to form an encrypted ciphertext matrix, and transmit the encrypted ciphertext matrix; The decryption method comprises the following steps: Step S3: Obtain the ciphertext image and extract pixels to form a ciphertext matrix to be decrypted; Step S4: obtaining the inverse matrix of the dynamic time-varying secret key through the zeroing neural network, and extracting the first ciphertext matrix that only changes the pixel position but does not change the pixel value by operating the inverse matrix with the ciphertext obtained in step S3; Step S5: The matrix extracted from the first ciphertext image is operated through the inverse process of the Arnold scrambling algorithm, and restored to the original image sample at the receiving end.
2. The image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm according to claim 1 is characterized in that: The step S2 specifically includes the following steps: S2-1, obtain a plaintext matrix, scramble the matrix by using the Arnold scrambling algorithm, and generate a first ciphertext matrix; The two-dimensional Arnold scrambling algorithm with two parameters is as follows: Where a and b are scrambling parameters, x and y represent the original positions of the elements in the plaintext matrix of the image, x' and y' represent the positions of the elements in the plaintext matrix after scrambling, and N is the size of the matrix; Set the original pixel position to (x, y), map it to the new coordinate (x', y') through formula (1), and scramble the pixel position in the plaintext matrix; set the number of scrambling times to n, transform the obtained new coordinate (x', y') n times through the mapping relationship, and destroy the pixel position information; set the scrambling parameters a and b to control the pixel position in the image; The scrambled coordinates (x ′ ,y ′ ) Repeat the Arnold scrambling algorithm to obtain the pixel coordinates (x ″ ,y ″ ), repeat this operation until the preset number of scrambling times is reached to obtain the first ciphertext matrix; S2-2, selecting a time-varying dynamic key, performing secondary encryption on the first ciphertext matrix to form an encrypted ciphertext matrix; An n-dimensional time-varying matrix is designed as a time-varying dynamic key matrix D(t) for encryption; the scrambled first ciphertext image is obtained by the Arnold scrambling algorithm, and the matrix extracted from the scrambled first ciphertext image is multiplied by the time-varying dynamic key matrix D(t) to obtain the final ciphertext image.
3. The image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm according to claim 2 is characterized in that: In step S2, if the grayscale image is converted into a plaintext matrix, the plaintext matrix is a matrix composed of pixels of corresponding sizes; if the color image is converted into a plaintext matrix, the color image is composed of three channels of R, G, and B, and the formed image is a matrix composed of three pixels of corresponding sizes, then all three matrices are operated.
4. The image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm according to claim 3 is characterized in that: If the original image is a grayscale image, the matrix extracted from the first scrambled ciphertext image is regarded as M, and multiplied by the time-varying dynamic key matrix D(t), and the final ciphertext image is M * (t) = D(t)M; if the original image is a color image, the three matrices extracted from the first ciphertext image are regarded as M1, M2, and M3 respectively, and then multiplied with the time-varying dynamic key matrix respectively, and then the combination is combined in the initial manner of the three channels to obtain the final ciphertext image.
5. The image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm according to claim 4 is characterized in that: The step S4 specifically includes the following steps: S4-1, the inverse matrix of the dynamic time-varying secret key is obtained by the zeroing neural network technology; Construct a fuzzy zeroing neural network model with convergence and robustness to solve the inverse matrix D of the time-varying secret key matrix of the dynamic Hill cipher -1 (t); in solving D -1 (t) Then, the ciphertext matrix obtained in step S3 is operated, and the first ciphertext image is composed of the ciphertext matrix M * (t) multiplied by D -1 (t) is obtained, denoted as M = D -1 (t)M * (t) = D -1 (t)D(t)M; S4-2, through the inverse matrix D -1 (t) operating the ciphertext obtained in step S3 to extract a first ciphertext matrix in which only the pixel positions are changed but the pixel values are not changed.
6. The image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm according to claim 5 is characterized in that: In S4-1, the following equation is defined: A(t)D(t)=I (2) Where D(t) represents the known time-varying dynamic key matrix, I is the n-dimensional identity matrix, and A(t) = D -1 (t) is the inverse matrix to be solved; Solve the equation A(t)=D -1 (t) is constructed in three steps: Step 1: Construct the following error function E(t): E(t)=A(t)D(t)-I (3) By constructing an error function, the process of finding A(t) in equation (2) is transformed into the process of solving the equation E(t) = 0; if E(t) = 0, then the corresponding A(t) in equation (3) is the solution of equation (2); Step 2: In order to make E(t) converge to 0 quickly, construct the following evolution formula: Among them, α>0 is a fixed convergence factor, P(·) and Represent the activation function array and the derivative of E(t) respectively; Step 3: Construct the expression as shown below: in, and represent the derivatives of A(t) and D(t) respectively; The ZNN model with external noise is shown in formula (6): Where N(t) is the external noise and P(·) is the activation function array; Design the fuzzy activation function NFAF as follows: Among them, m is the fuzzy parameter obtained by FLS, 0 <c<1,a1,a2,a3,a4> 0. Implement the following fuzzy zeroing neural network model:
7. The image encryption and decryption method based on dynamic Hill cipher and Arnold scrambling algorithm according to claim 6 is characterized in that: In the step S5, the number of scrambling times n during Arnold scrambling is obtained; an inverse operation is performed on the obtained encrypted image to restore the destroyed position information to obtain the original image; Extract the pixel matrix of the encrypted image and transform it back to the original image using the following equation: Assume the position of each element in the ciphertext image is The mapping relationship of formula (11) is converted into The original image is restored by performing reverse cyclic mapping through the set scrambling times n.
Citation Information
Cited By
Transmission method and device based on input and output system file and storage medium
CN118945157A
