Image encryption method and device, program product and medium
By combining a chaotic mapping system and Arnold transform with a deoxyribose encryption algorithm, the control parameters and scrambling diffusion rules for image encryption are dynamically determined, solving the problem of the single encryption mode of traditional RNA algorithms and achieving higher-security image encryption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-03-27
AI Technical Summary
Traditional RNA algorithm encryption modes are relatively simple, and the fixed encoding and decoding rules and calculation patterns make image encryption insecure and easy to crack.
A chaotic sequence is generated using a chaotic mapping system. Image data is then processed using the Arnold transform and deoxyribose encryption algorithm. The chaotic sequence determines the control parameters of the Arnold transform and the scrambling rules and diffusion algorithm of the RNA encryption algorithm.
It improves the security and unpredictability of image encryption, enhances the ability to resist various attacks, and is suitable for encrypted image transmission.
Smart Images

Figure CN121750797A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an image encryption method, apparatus, program product, and medium. Background Technology
[0002] Images, as a crucial carrier of information on the network, require encryption protection, which is a key aspect of cybersecurity and a necessary means to safeguard user information security. Currently, the industry has proposed image encryption schemes based on genetic algorithms such as ribonucleic acid (RNA) and deoxyribonucleic acid (DNA). Among these, RNA computation, which can increase information density, improve parallelism, and reduce energy consumption, has become a research hotspot in recent years.
[0003] However, traditional RNA algorithms have relatively simple encryption patterns. The fixed encoding / decoding rules and computational patterns make the results of base calculations easily predictable, increasing the risk of ciphertext being cracked. Although researchers have made significant progress in the security of RNA algorithms, existing algorithms still suffer from the drawback of fixed patterns. Therefore, the security of their image encryption needs further improvement.
[0004] Therefore, those skilled in the art urgently need an image encryption method to provide a more secure image encryption solution. Summary of the Invention
[0005] The purpose of this invention is to provide an image encryption method, apparatus, program product, and medium, so as to provide an image encryption scheme with higher security.
[0006] To solve the above-mentioned technical problems, the present invention provides an image encryption method, comprising:
[0007] Plaintext image data is processed using a chaotic mapping system to obtain a chaotic sequence;
[0008] The plaintext image data is subjected to an Arnold transform to obtain intermediate image data; wherein the control parameters of the Arnold transform are determined by the chaotic sequence.
[0009] The intermediate image data is encrypted using a deoxyribose encryption algorithm to obtain ciphertext image data; wherein the scrambling rules and diffusion algorithm of the deoxyribose encryption algorithm are determined by the chaotic sequence.
[0010] In an optional embodiment, the process of processing the plaintext image data through a chaotic mapping system to obtain a chaotic sequence includes:
[0011] The plaintext image data is processed using a secure hash algorithm to obtain a hash value;
[0012] The perturbation of the chaotic mapping system is determined based on the hash value;
[0013] The given initial conditions are adjusted based on the perturbation to obtain the initial conditions of the chaotic system;
[0014] The chaotic mapping system is iterated based on the initial conditions of the chaotic system to obtain the chaotic sequence.
[0015] In one optional embodiment, determining the perturbation of the chaotic mapping system based on the hash value includes:
[0016] The hash value is divided into an even number of bit blocks based on a preset number of bits.
[0017] Perform an XOR operation on each pair of the aforementioned bit blocks to obtain the key stream;
[0018] The perturbation of the chaotic mapping system is generated through the key stream.
[0019] In one optional embodiment, the hash value is 64 bits; the preset bit length is 8 bits; and the number of bit blocks is 64.
[0020] The step of performing an XOR operation on each pair of the aforementioned bit blocks to obtain the key stream includes:
[0021] The key stream is determined using the first formula;
[0022] The first formula is:
[0023] ;
[0024] H(i) represents the i-th bit of the key stream; h(2i) and h(2i-1) represent the 2i-th and 2i-1-th bit blocks, respectively; i∈[1,32];
[0025] The perturbation used to generate the chaotic mapping system through the key stream includes:
[0026] The perturbation of the chaotic mapping system is determined by the second formula;
[0027] The second formula is:
[0028] ;
[0029] k1, k2, k3, and k4 are the perturbations of the chaotic mapping system.
[0030] In an optional embodiment, adjusting the given initial conditions based on the perturbation to obtain the initial conditions of the chaotic system includes:
[0031] The initial conditions of the chaotic system are determined according to the third formula;
[0032] The third formula is as follows:
[0033] ;
[0034] x0, y0, z0 represent the given initial conditions, and x0', y0', z0' represent the initial conditions of the chaotic system.
[0035] In an optional embodiment, iterating the chaotic mapping system according to the initial conditions of the chaotic system to obtain the chaotic sequence includes:
[0036] The chaotic mapping system is iterated based on the initial conditions of the chaotic system to obtain a pseudo-random sequence;
[0037] The corresponding chaotic integer sequence determined based on the pseudo-random sequence is used as the chaotic sequence.
[0038] In one optional embodiment, the size of the plaintext image data is M×N;
[0039] The step of iterating the chaotic mapping system according to the initial conditions of the chaotic system to obtain a pseudo-random sequence includes:
[0040] The chaotic mapping system is iterated n+M+N times, and the results of the first n iterations are discarded to obtain the pseudo-random sequence; where n is any positive integer.
[0041] In one optional embodiment, the chaotic mapping system is a three-dimensional Lorenz chaotic mapping system;
[0042] The state equation of the three-dimensional Lorenz chaotic mapping system is:
[0043] ;
[0044] Where a=10, b=8 / 3, c=28; x, y, z are input values. , , This is the output quantity.
[0045] In one optional embodiment, performing an Arnold transform on the plaintext image data to obtain intermediate image data includes:
[0046] The plaintext image data is subjected to Arnold transform to obtain scrambled image data;
[0047] An Arnold transform is performed on the integer part of the scrambled image data to obtain diffused image data, and the diffused image data is used as the intermediate image data.
[0048] The control parameters for the two Arnold transformations are determined by the chaotic sequence.
[0049] In one optional embodiment, performing an Arnold transform on the plaintext image data to obtain scrambled image data includes:
[0050] The plaintext image data is subjected to Arnold transformation using the fourth formula;
[0051] The fourth formula is:
[0052] ;
[0053] i A j A k A Let i, j, and k represent the red, green, and blue data corresponding to a pixel after scrambling; let i, j, and k represent the red, green, and blue data corresponding to a pixel before scrambling; let N represent the sum of the width and height of the plaintext image data; and let A represent the Arnold transform matrix, which is:
[0054] ;
[0055] S A S B S C S D S E S F These represent the control parameters of the Arnold transform.
[0056] In one optional embodiment, performing an Arnold transform on the integer portion of the scrambled image data to obtain diffused image data includes:
[0057] The integer part of the scrambled image data is transformed using the fifth formula;
[0058] The fifth formula is as follows:
[0059] ;
[0060] Vi(i,j,k) and Vi(i A ,j A ,k A) represents the scrambling value of the previous round; Vi(i´,j´,k´) represents the diffusion value of the previous round; AVi(i,j,k), AVi(i A ,j A ,k A AVi(i´,j´,k´) represents the value after this round of diffusion; M represents the upper limit of the value range of the integer part of the scrambled image data.
[0061] In an optional embodiment, the control parameters for the two Arnold transformations are determined by the chaotic sequence, including:
[0062] The control parameters for the two Arnold transformations are determined using the sixth formula;
[0063] The sixth formula is as follows:
[0064] ;
[0065] a, b, and c are the parameters of the chaotic mapping system; x, y, and z are the chaotic sequences.
[0066] In one optional embodiment, encrypting the intermediate image data using a deoxyribose encryption algorithm to obtain ciphertext image data includes:
[0067] The intermediate image data and the chaotic sequence are converted into binary arrays, and the binary arrays are converted into deoxyribose sequences according to the encoding rules.
[0068] The deoxyribose sequence is scrambled based on the chaotic sequence.
[0069] The scrambled deoxyribose sequence is diffused based on the chaotic sequence to obtain the encrypted image data.
[0070] In an optional embodiment, the scrambling operation of the deoxyribose sequence based on the chaotic sequence includes:
[0071] The chaotic sequence is sorted and the original position of each chaotic value in the sequence is recorded to obtain the sorting index;
[0072] The bases of the deoxyribose sequence are rearranged according to the sorting index.
[0073] In an optional embodiment, the diffusion operation on the scrambled deoxyribose sequence based on the chaotic sequence includes:
[0074] Perform a modulo-2 operation on the chaotic sequence;
[0075] If the result is odd, then the diffusion operation is performed according to the addition rule;
[0076] If the result is even, then a diffusion operation is performed using the subtraction rule.
[0077] In an optional embodiment, it further includes:
[0078] The encrypted image data is decrypted using a reverse deoxyribose encryption algorithm to obtain the intermediate image data;
[0079] The intermediate image data is subjected to an inverse Arnold transform to obtain the plaintext image data.
[0080] To address the aforementioned technical problems, the present invention also provides an image encryption device, comprising:
[0081] The chaotic mapping module is used to process plaintext image data through a chaotic mapping system to obtain chaotic sequences;
[0082] The first encryption module is used to perform an Arnold transform on the plaintext image data to obtain intermediate image data; wherein the control parameters of the Arnold transform are determined by the chaotic sequence.
[0083] The second encryption module is used to encrypt the intermediate image data using a deoxyribose encryption algorithm to obtain ciphertext image data; wherein the scrambling rules and diffusion algorithm of the deoxyribose encryption algorithm are determined by the chaotic sequence.
[0084] To address the aforementioned technical problems, the present invention also provides a computer program product, comprising a computer program / instructions, wherein the computer program / instructions, when executed by a processor, implement the steps of the image encryption method described above.
[0085] To address the aforementioned technical problems, the present invention also provides an image encryption device, comprising:
[0086] Memory, used to store computer programs;
[0087] A processor for executing the computer program to implement the image encryption method as described above.
[0088] To address the aforementioned technical problems, the present invention also provides a non-volatile storage medium storing a computer program, which, when executed by a processor, implements the steps of the image encryption method described above.
[0089] This invention provides an image encryption method that combines Arnold transform (also known as cat face transform, an image scrambling technique based on ergodic theory) and ribonucleic acid (RNA) encryption algorithms to encrypt images. Furthermore, during the image encryption process, chaotic sequences are used to determine the control parameters of the Arnold transform and the scrambling rules and diffusion algorithm of the RNA encryption algorithm, increasing the unpredictability of the algorithm and thus improving the encryption effect. The chaotic system generates key streams quickly and is sensitive to initial conditions, making it suitable for generating high-complexity keys at low cost. The RNA encryption algorithm can quickly search for optimal encryption parameters through biomimetic optimization, reducing computational redundancy. The proposed image encryption scheme has high complexity, a large key space, and good security, resisting various attacks, and has considerable application prospects and value for encrypted image transmission.
[0090] The image encryption device and non-volatile storage medium provided by this invention correspond to the above-described method and have the same effect. Attached Figure Description
[0091] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0092] Figure 1 A flowchart of an image encryption method provided in an embodiment of the present invention;
[0093] Figure 2 A schematic diagram of a classic Lorenz chaotic mapping system provided in an embodiment of the present invention;
[0094] Figure 3 A flowchart illustrating an image encryption scheme provided in an embodiment of the present invention;
[0095] Figure 4 A flowchart of an image decryption scheme provided in an embodiment of the present invention;
[0096] Figure 5 A structural diagram of an image encryption device provided in an embodiment of the present invention;
[0097] Figure 6 This is a structural diagram of another image encryption device provided in an embodiment of the present invention. Detailed Implementation
[0098] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0099] The core of this invention is to provide an image encryption method, device, program product, and medium.
[0100] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0101] In the field of image encryption, traditional RNA algorithms have relatively simple encryption modes. Their fixed encoding and decoding rules and calculation patterns make the calculation results between bases easily predictable, increasing the risk of ciphertext being cracked and resulting in insufficient security.
[0102] To address the above problems, this invention provides an image encryption method, such as... Figure 1 As shown, it includes:
[0103] S1: The plaintext image data is processed through a chaotic mapping system to obtain a chaotic sequence.
[0104] S2: Perform Arnold transform on the plaintext image data to obtain intermediate image data.
[0105] The control parameters of the Arnold transform (also known as the cat face transform, which is an image scrambling technique based on ergodic theory) are determined by the chaotic sequence.
[0106] S3: Encrypt the intermediate image data using a deoxyribose encryption algorithm to obtain ciphertext image data.
[0107] The scrambling rules and diffusion algorithm of the deoxyribose encryption algorithm are determined by a chaotic sequence.
[0108] For step S1, this embodiment is not limited to the type of chaotic mapping system used. Classical Logistic mapping, Chebyshev mapping, etc., can be used. In an optional embodiment, the plaintext image data specifically refers to the red, green, and blue (RGB) data of the image, i.e., three-dimensional data. In this case, a three-dimensional Lorenz chaotic mapping system can be used as the chaotic mapping system in step S1. The state equation of the three-dimensional Lorenz chaotic mapping system is as follows:
[0109] (1);
[0110] In the formula, a, b, and c are the parameters of the chaotic mapping system. When a=10, b=8 / 3, and c=28, the Lorenz system exhibits a chaotic state, such as... Figure 2 As shown. x, y, and z are the input values. , , This is the output quantity.
[0111] Subsequently, the plaintext image data can be processed using the aforementioned three-dimensional Lorenz chaotic mapping system to generate the corresponding chaotic sequence. However, to improve security, this invention also provides a further embodiment. Step S1 specifically includes:
[0112] S11: Process the plaintext image data using a secure hash algorithm to obtain a hash value.
[0113] S12: Determine the perturbation of the chaotic mapping system based on the hash value.
[0114] S13: Adjust the given initial conditions based on the perturbation to obtain the initial conditions of the chaotic system.
[0115] S14: Iterate the chaotic mapping system according to the initial conditions of the chaotic system to obtain the chaotic sequence.
[0116] It should be noted that the Secure Hash Algorithm (SHA) is a family of algorithms, including SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512. This invention does not limit the use of any particular SHA algorithm; users can freely choose based on actual needs.
[0117] For example, in one optional embodiment, using SHA-256 to implement step S11 above can generate a 64-bit hexadecimal hash value h. However, directly using the 64-bit hexadecimal hash value h for subsequent chaotic sequence generation leads to excessively high computational complexity, which is detrimental to improving image encryption efficiency and consumes excessive computing resources. Furthermore, the present invention also provides another optional embodiment based on the above embodiment. Step S12 specifically includes:
[0118] S121: Split the hash value into an even number of bit blocks based on a preset number of bits.
[0119] S122: Perform an XOR operation on each pair of bit blocks in each group to obtain the key stream.
[0120] S123: Generate perturbations in a chaotic mapping system using a key stream.
[0121] Regarding step S121, it should be noted that this embodiment does not limit the specific number of preset bit lengths and group bits. However, the preset bit lengths and the number of group bits are corresponding. For ease of calculation, the preset bit lengths and the number of group bits are preferably powers of 2 (the exponent is not 0). In an optional embodiment, if the preset bit lengths are 8, then the 64-bit hexadecimal hash value h can be divided into 64 group bits.
[0122] Step S122 can be expressed by the following formula:
[0123] (2);
[0124] In the formula, H(i) represents the i-th bit of the key stream; h(2i) and h(2i-1) represent the 2i-th bit block and the 2i-1-th bit block, respectively, i∈[1,32].
[0125] Furthermore, step S123 can be expressed by the following formula:
[0126] (3);
[0127] In the formula, k1, k2, k3, and k4 are the perturbations of the chaotic mapping system.
[0128] As can be seen from the above, the scheme provided in this embodiment can determine the perturbation of the chaotic mapping system through the hash value h. This allows the chaotic sequence generated by the chaotic mapping system to be influenced by plaintext image data, improving its random adaptive capability. However, compared to directly calculating the perturbation using the complex hash value h, this embodiment achieves a simpler chaotic mapping iterative column calculation by splitting it into bit blocks. This improves computational efficiency while reducing the demand for computing power.
[0129] Furthermore, based on the disturbance determined in step S12 above, step S13 can be specifically expressed by the following formula:
[0130] (4);
[0131] In the formula, x0, y0, and z0 represent the given initial conditions, and x0', y0', and z0' represent the initial conditions of the chaotic system.
[0132] After adjusting the initial conditions of the chaotic mapping system using the perturbation determined by the hash value h of the plaintext image data, it can be ensured that the chaotic sequence generated by the chaotic mapping system is affected by the plaintext image data. However, it should be noted that this embodiment does not limit the number of iterations performed on the chaotic mapping system. Furthermore, after iteration, the pseudo-random sequence generated by the chaotic mapping system can be directly used as the chaotic sequence. However, to further simplify the calculation, this invention also provides an optional embodiment. Step S14 above further includes:
[0133] S141: Iterate the chaotic mapping system according to the initial conditions of the chaotic system to obtain a pseudo-random sequence.
[0134] S142: The corresponding chaotic integer sequence determined based on the pseudo-random sequence is taken as the chaotic sequence.
[0135] Taking the keystream obtained from the 64-bit hash value and 8-bit grouping block as an example, assuming that the integer part of the pseudo-random sequence is adjusted to the range of [0, 255], then step S142 can be expressed by the following formula:
[0136] (5);
[0137] In the formula, mod is the remainder function, and the remainder is 256 based on the target value range of [0, 255]. This is a rounding down operation; x, y, z are the pseudo-random sequences before adjustment; X, Y, Z are the integer sequences after adjustment.
[0138] Through the processing described in this embodiment, the complex pseudo-random sequence after iteration can be adjusted into a simpler integer sequence with a controllable value range. Using this integer sequence as the chaotic sequence for subsequent image encryption can further reduce computational complexity, improve encryption efficiency, and reduce the demand for computing power.
[0139] Furthermore, the present invention also provides another optional embodiment, wherein step S141 above is:
[0140] The chaotic mapping system is iterated n+M+N times, and the results of the first n iterations are discarded to obtain a pseudo-random sequence; where n is any positive integer and the size of the plaintext image data is M×N.
[0141] The purpose of discarding the results of the first n iterations in this embodiment is to increase the sensitivity of the final chaotic sequence to the initial value, that is, to increase the influence of plaintext image data on the chaotic sequence, thereby improving the security of subsequent image encryption processing.
[0142] After obtaining the chaotic sequence generated from the plaintext image data in step S1, step S2 is the step of encrypting the plaintext image data using the Arnold transform. The control parameters in the Arnold transform are specifically determined by the chaotic sequence. Specifically, the Arnold transform mainly achieves image encryption by scrambling the positions of pixels in the plaintext image data. Based on this, this embodiment also provides an optional implementation scheme for the specific implementation of the Arnold transform in step S2. Step S2 specifically includes:
[0143] S21: Perform Arnold transform on the plaintext image data to obtain scrambled image data.
[0144] S22: Perform an Arnold transform on the integer part of the scrambled image data to obtain diffused image data, and use the diffused image data as intermediate image data.
[0145] The control parameters for the two Arnold transformations are determined by the chaotic sequence.
[0146] It should be noted that the Arnold transform uses a simple matrix to transform the coordinate positions in an image, scrambling the image by increasing the number of iterations. Each Arnold transform on an image is equivalent to scrambling it once. After a certain number of iterations, the Arnold transform will restore the original image; this number of iterations is called the Arnold transform period. This allows for the periodic restoration of the image, enabling image scrambling, encryption, and decryption. However, it should be noted that this embodiment does not limit the number of Arnold transform iterations; it can be determined according to actual needs.
[0147] Specifically, the three-dimensional discrete Arnold transform can be described by the following equation:
[0148] (6);
[0149] In the formula, i A j A k A Let i, j, and k represent the red, green, and blue data corresponding to a pixel after scrambling; let i, j, and k represent the red, green, and blue data corresponding to a pixel before scrambling; let N represent the sum of the width and height of the plaintext image data; and let A represent the Arnold transform matrix, which is:
[0150] (7);
[0151] In the formula, S A S B S C S D S E S F The control parameters of the Arnold transform are determined by the chaotic sequence.
[0152] It is easy to understand that the only difference between the two Arnold transformations performed in steps S21 and S22 of this embodiment is the object being transformed. The first Arnold transformation performed in step S21 is for the original plaintext image data, which can be called the scrambling stage, and can be implemented by the above formula (6). The second Arnold transformation performed in step S22 is for the scrambled image data after the first Arnold transformation in step S21, and is the integer part of the scrambled image data, which can be called the diffusion stage. The diffusion stage is also implemented by Arnold transformation, and can be described by the following formula:
[0153] (8);
[0154] In the formula, Vi(i,j,k) and Vi(i A ,j A ,k A ) represents the scrambling value of the previous round; Vi(i´,j´,k´) represents the diffusion value of the previous round; AVi(i,j,k), AVi(i A ,j A ,k A AVi(i´,j´,k´) represents the value after this round of diffusion; M represents the upper limit of the value range of the integer part of the scrambled image data.
[0155] It is also important to note that, as emphasized above, the control parameters in both Arnold transformations of this method are determined based on chaotic sequences. That is, the control parameters S in the Arnold transformation matrix A are... A ~ S F Determined by the chaotic sequence. For a specific control parameter determination scheme, this embodiment provides an optional implementation scheme, which determines the control parameters in the two Arnold transformations using the following formula:
[0156] (8);
[0157] In the formula, x, y, and z are the chaotic sequences. In one embodiment as described above, the chaotic sequences can be processed and transformed into integer sequences within a certain range. Examples of chaotic integer sequences X, Y, and Z are given in the above embodiment.
[0158] As described above, the Arnold transform scheme provided in this embodiment performs two Arnold transforms on plaintext image data. The first Arnold transform scrambles the pixel coordinates of the plaintext image data. The second Arnold transform applies a diffusion process to the integer portion of the scrambled image data, thereby achieving enhanced image encryption. Furthermore, both the scrambling and diffusion processes implemented by the Arnold transform are based on dynamically determined control parameters using chaotic sequences, further ensuring the security of the image encryption.
[0159] Furthermore, after obtaining intermediate image data through Arnold encryption in step S2, this method further encrypts the intermediate image data using an RNA encryption algorithm in step S3. Specifically, since RNA encryption is a common image encryption method, this embodiment will not elaborate further. However, it should be noted that in step S3 of this method, when encrypting image data using the RNA encryption algorithm, the image data being encrypted is the intermediate image data after Arnold encryption, and the scrambling rules and diffusion algorithm are determined by a chaotic sequence during the scrambling and diffusion encryption process of the RNA encryption algorithm.
[0160] To better illustrate step S3 of this method, this embodiment proposes an optional solution for the specific implementation of step S3. Step S3 specifically includes:
[0161] S31: Convert intermediate image data and chaotic sequences into binary arrays, and convert the binary arrays into deoxyribose sequences using encoding rules.
[0162] S32: Scramble deoxyribose sequences based on chaotic sequences.
[0163] S33: Diffusion operation is performed on the scrambled deoxyribose sequence based on the chaotic sequence to obtain encrypted image data.
[0164] Step S31 involves converting the intermediate image data and the chaotic sequence into a single binary array, which is then converted into an RNA sequence using RNA coding rules. As described in the previous embodiment, the chaotic sequence can be converted from a pseudo-random sequence into a chaotic integer sequence within the range of 0 to 255. That is, each value in the chaotic sequence can be converted into a single octal number, which can then be further converted into three binary numbers, corresponding to the three-dimensional intermediate image data, i.e., RGB data. Therefore, converting the intermediate image data and the chaotic sequence into a single binary array can be achieved by converting the values in the chaotic sequence into 3-bit binary numbers, which are then concatenated into the binary data corresponding to the R, G, and B values in the intermediate image data.
[0165] Furthermore, the RNA coding rules are detailed in Table 1 below:
[0166] Table 1 RNA coding rules
[0167]
[0168] In Table 1, A represents adenine, G represents guanine, U represents uracil, and C represents cytosine. The converted RNA sequence consists of these four bases.
[0169] Next comes the scrambling stage, corresponding to step S32. The scrambling of RNA can be achieved through chaotic sequences, which can generate a specific permutation order, thereby rearranging the bases in the RNA sequence to achieve scrambling. Specifically, this embodiment provides an optional solution. Step S32 specifically includes:
[0170] S321: Sort the chaotic sequence and record the original position of each chaotic value in the sequence after sorting to obtain the sort index.
[0171] S322: Rearrange the bases of the deoxyribose sequence according to the sort index.
[0172] To more clearly illustrate the scrambling scheme provided in this embodiment, an example is given below. Assume a chaotic sequence contains three values. After reordering, the first value is moved to the third position, the second value to the first position, and the third value to the second position. The resulting sorting index is [3,1,2]. When rearranging the bases in an RNA sequence using this sorting index, the first base is moved to the third position, the second base to the first position, and the third base to the second position, thus completing the reordering of the bases in the RNA sequence.
[0173] Therefore, the solution provided in this embodiment can combine chaotic sequences to rearrange the bases in the RNA sequence during RNA scrambling. This solves the problems of current RNA encryption modes being singular, easily predicted, and cracked, further improving the security of image data encryption.
[0174] After the RNA sequence is scrambled in step S32, step S33 performs diffusion processing on the rearranged RNA sequence. Currently, four diffusion rules can be used: addition, subtraction, multiplication, and division. The diffusion rules for addition and subtraction are shown in Table 2 below:
[0175] Table 2 RNA Diffusion Rules
[0176]
[0177] It should be noted that, since the additive and subtractive diffusion rules are well-known to those skilled in the art in current RNA encryption, this embodiment will only use addition as an example for illustration:
[0178] (9);
[0179] In the formula, P represents the encrypted sequence after diffusion; X is the chaotic RNA sequence; and M and N are the dimensions of the plaintext image data.
[0180] Furthermore, whether to apply an additive or subtractive diffusion rule to different bases in the RNA sequence is determined by their corresponding values in the chaotic sequence. The diffusion rule for the RNA sequence can be dynamically determined based on the chaotic sequence by establishing a defined correspondence between specific values in the chaotic sequence and the additive and subtractive diffusion rules.
[0181] In view of this, this embodiment provides an optional specific implementation scheme. Step S33 specifically includes:
[0182] S331: Perform modulo-2 operation on the chaotic sequence.
[0183] S332: If the result is odd, then perform a diffusion operation using the addition rule.
[0184] S333: If the result is even, then perform a diffusion operation using the subtraction rule.
[0185] Therefore, this embodiment provides a scheme for determining RNA sequence diffusion rules based on chaotic sequences. By performing a modulo-2 operation on the chaotic sequence, the result of the modulo-2 operation (odd or even) uniquely corresponds to either an additive or subtractive diffusion rule. This allows for the dynamic determination of whether an RNA sequence adopts an additive or subtractive diffusion rule based on the chaotic sequence. Therefore, when applying the scheme provided in this embodiment to the RNA encryption diffusion step, the diffusion rule can be ensured to be dynamically determined by the chaotic sequence, improving the unpredictability of the RNA diffusion stage and thus enhancing the security of image encryption.
[0186] Furthermore, based on the above embodiments, the overall process of the image encryption method provided by the present invention is as follows: Figure 3 As shown:
[0187] 1. Preprocess the original image to extract grayscale image data of the three components R, G, and B, resulting in three plaintext image sequences {R}, {G}, and {B}, which will be used as plaintext image data to be encrypted.
[0188] 2. For plaintext image data {R}, {G}, {B}, the corresponding security key is generated by the SHA algorithm (i.e. the key stream of the above formula (2)), and then the corresponding chaotic sequence is generated by the chaotic sequence.
[0189] 3. Based on the chaotic sequence obtained above, control parameters are dynamically determined, and the plaintext image data is scrambled and encrypted using the Arnold transform. This involves the first encryption of the plaintext image data to obtain intermediate image data.
[0190] 4. Based on the chaotic sequence obtained above, the scrambling and diffusion rules are dynamically determined. The intermediate image data encrypted in step 3 is then encoded, scrambled, and diffused using the RNA algorithm. This is essentially a second encryption of the intermediate image data, yielding the encrypted sequence, i.e., the ciphertext image data.
[0191] 5. Reassemble the encrypted sequence obtained above into grayscale image data of the R, G, and B components of the ciphertext image.
[0192] 6. Merge the R, G, and B components of the ciphertext image to obtain the final encrypted image.
[0193] In summary, the image encryption method provided by this invention is based on a chaotic system for image encryption. It utilizes the Arnold transform and, based on RNA dynamic encoding / decoding rules and dynamic scrambling and diffusion operations, encrypts pixel data. Throughout the encryption process, the chaotic sequence determines the control parameters of the Arnold transform, the scrambling of the RNA, and the diffusion rules, employing both the Arnold transform and the RNA algorithm for dual encryption protection of the image. This invention improves the security of image encryption algorithms and is suitable for the transmission protection of various images. The proposed image encryption algorithm is highly complex, has a large key space, and offers strong security, resisting various attacks. It has considerable application prospects and value for encrypted image transmission.
[0194] On the other hand, as can be seen from the above embodiments, the present invention provides an image encryption algorithm, which mainly uses the Arnold transform and RNA encryption algorithm. Both the Arnold transform and RNA encryption algorithm belong to symmetric image encryption systems, and the ciphertext can be decrypted using the reverse process of encryption to recover the original image. Therefore, based on this, the present invention also provides a decryption method for images encrypted using the above method, the method further including:
[0195] S41: Decrypt the encrypted image data using the reverse deoxyribose encryption algorithm to obtain the intermediate image data.
[0196] S42: Perform an inverse Arnold transform on the intermediate image data to obtain plaintext image data.
[0197] The image decryption process provided in this embodiment corresponds to the image encryption process provided in the above embodiments, and is the reverse process of the encryption process. Therefore, based on the above... Figure 3 The image encryption process shown in this embodiment is as follows: Figure 4 As shown, it includes:
[0198] 1. Preprocess the encrypted image to extract grayscale image data of the R, G, and B components, resulting in three ciphertext image sequences {R}, {G}, and {B}, which serve as the ciphertext image data to be decrypted.
[0199] 2. Based on the encrypted image data {R}, {G}, and {B}, extract the chaotic sequence from them through the inverse operation of the chaotic system.
[0200] 3. Based on chaotic sequences, reverse RNA diffusion, scrambling, and decoding operations are performed on the encrypted image data to obtain intermediate image data before RNA encryption.
[0201] 4. Based on the chaotic sequence, reverse Arnold diffusion and scrambling operations are performed on the intermediate image data to obtain the plaintext image sequence before Arnold encryption.
[0202] 5. Reassemble the plaintext image sequence obtained above into grayscale image data of the R, G, and B components of the plaintext image.
[0203] 6. Merge the R, G, and B components of the plaintext image to obtain the final plaintext image.
[0204] Therefore, the image encryption method provided by this invention not only solves the problems of traditional RNA algorithm encryption modes being singular, having fixed encoding and decoding rules, and having easily predictable calculation patterns, but also supports reverse decryption of ciphertext images, making it suitable for the transmission protection of various images. Furthermore, the image encryption algorithm proposed in this invention has high complexity, a large key space, and good security, resisting various attacks, and has considerable application prospects and value for encrypted image transmission.
[0205] In addition to the image encryption method embodiment provided in the above embodiments, the present invention also provides an embodiment corresponding to a computer program product. A computer program product includes a computer program / instructions, which, when executed by a processor, can implement the steps of the image encryption method as described in any of the above embodiments.
[0206] Since the embodiments of the computer program product section correspond to the embodiments of the method section, please refer to the description of the embodiments of the method section for the embodiments of the computer program product section, which will not be repeated here. The computer program product provided in this embodiment includes a computer program / instructions. When the computer program / instructions are executed by a processor, the steps of the image encryption method described in any of the above embodiments can be implemented. Therefore, the technical effects brought about by the above image encryption method can also be achieved. Specifically, images can be encrypted based on a chaotic system. Pixel data is encrypted using Arnold transform and based on RNA dynamic encoding / decoding rules and dynamic scrambling and diffusion operations. Throughout the encryption process, the chaotic sequence determines the control parameters of the Arnold transform, the scrambling of the RNA, and the diffusion rules. The Arnold transform and the RNA algorithm are used for dual encryption protection of the image. Therefore, this embodiment can improve the security of the image encryption algorithm and is suitable for the transmission protection of various images. The image encryption implemented by this embodiment has high complexity, a large key space, and good security, and can resist various attacks. It has considerable application prospects and value for encrypted image transmission.
[0207] In the above embodiments, an image encryption method has been described in detail. The present invention also provides an embodiment corresponding to an image encryption device. It should be noted that the present invention describes the device embodiment from two perspectives: one based on functional modules, and the other based on hardware.
[0208] From the perspective of functional modules, such as Figure 5 As shown, this embodiment provides an image encryption device, including:
[0209] The chaotic mapping module 11 is used to process plaintext image data through a chaotic mapping system to obtain a chaotic sequence.
[0210] The first encryption module 12 is used to perform Arnold transformation on plaintext image data to obtain intermediate image data; wherein the control parameters of the Arnold transformation are determined by a chaotic sequence.
[0211] The second encryption module 13 is used to encrypt the intermediate image data using a deoxyribose encryption algorithm to obtain ciphertext image data; wherein the scrambling rules and diffusion algorithm of the deoxyribose encryption algorithm are determined by a chaotic sequence.
[0212] Since the embodiments of the device and the method correspond to each other, please refer to the description of the embodiments of the method for the device embodiments, which will not be repeated here. The image encryption device provided in this embodiment can obtain a chaotic sequence affected by plaintext image data through a chaotic mapping module. Then, a first encryption module performs an Arnold transform on the plaintext image data based on the chaotic sequence to achieve the first dynamic Arnold encryption. Afterwards, a second encryption module performs dynamic RNA encryption on the intermediate image data after Arnold encryption based on the chaotic sequence to obtain the final ciphertext image data. Throughout the encryption process, the chaotic sequence determines the control parameters of the Arnold transform, the scrambling of the RNA, and the diffusion rules, using both the Arnold transform and the RNA algorithm for dual encryption protection of the image. Therefore, this embodiment can improve the security of image encryption algorithms and is suitable for the transmission protection of various images. The image encryption implemented by this embodiment has high complexity, a large key space, and good security, and can resist various attacks, showing considerable application prospects and value for encrypted image transmission.
[0213] Figure 6 A structural diagram of an image encryption device provided in another embodiment of the present invention is shown below. Figure 6 As shown, an image encryption device includes: a memory 20 for storing computer programs;
[0214] The processor 21 is used to implement the steps of an image encryption method as described in the above embodiment when executing a computer program.
[0215] The image encryption device provided in this embodiment may include, but is not limited to, mobile terminals, personal computers, workstations, etc.
[0216] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array. The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0217] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of an image encryption method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, an image encryption method.
[0218] In some embodiments, an image encryption device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0219] Those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on an image encryption device and may include more or fewer components than illustrated.
[0220] This invention provides an image encryption device, including a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: an image encryption method. Since the image encryption device provided in this embodiment can implement the steps of the image encryption method described in any of the above embodiments, it can also achieve the technical effects brought about by the above image encryption method. Specifically, it can encrypt images based on a chaotic system. It uses Arnold transform and, based on RNA dynamic encoding / decoding rules and dynamic scrambling and diffusion operations, encrypts pixel data. Throughout the encryption process, the chaotic sequence determines the control parameters of the Arnold transform, the scrambling of the RNA, and the diffusion rules. The Arnold transform and the RNA algorithm are used for dual encryption protection of the image. Therefore, this embodiment can improve the security of image encryption algorithms and is suitable for the transmission protection of various images. The image encryption implemented by this embodiment has high complexity, a large key space, and good security, and can resist various attacks, showing considerable application prospects and value for encrypted image transmission.
[0221] Finally, the present invention also provides an embodiment corresponding to a non-volatile storage medium. A computer program is stored on the non-volatile storage medium, and when executed by a processor, the computer program implements the steps described in the above method embodiments.
[0222] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0223] This embodiment provides a non-volatile storage medium storing a computer program / instruction. When the computer program / instruction is executed by a processor, it can implement the steps of the image encryption method described in any of the above embodiments. Therefore, it can also achieve the technical effects brought about by the above image encryption method. Specifically, it can encrypt images based on a chaotic system. It utilizes the Arnold transform and, based on RNA dynamic encoding / decoding rules and dynamic scrambling and diffusion operations, encrypts pixel data. Throughout the encryption process, the chaotic sequence determines the control parameters of the Arnold transform, the scrambling of the RNA, and the diffusion rules. The Arnold transform and the RNA algorithm are used for dual encryption protection of the image. Therefore, this embodiment can improve the security of image encryption algorithms and is suitable for the transmission protection of various images. The image encryption implemented by this embodiment has high complexity, a large key space, and good security, and can resist various attacks. It has considerable application prospects and value for encrypted image transmission.
[0224] The foregoing has provided a detailed description of the image encryption method, apparatus, program product, and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the present invention.
[0225] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. An image encryption method, characterized in that, include: Plaintext image data is processed using a chaotic mapping system to obtain a chaotic sequence; The plaintext image data is subjected to an Arnold transform to obtain intermediate image data; wherein the control parameters of the Arnold transform are determined by the chaotic sequence. The intermediate image data is encrypted using a deoxyribose encryption algorithm to obtain ciphertext image data; wherein the scrambling rules and diffusion algorithm of the deoxyribose encryption algorithm are determined by the chaotic sequence.
2. The image encryption method according to claim 1, characterized in that, The process of processing plaintext image data through a chaotic mapping system to obtain a chaotic sequence includes: The plaintext image data is processed using a secure hash algorithm to obtain a hash value; The perturbation of the chaotic mapping system is determined based on the hash value; The given initial conditions are adjusted based on the perturbation to obtain the initial conditions of the chaotic system; The chaotic mapping system is iterated based on the initial conditions of the chaotic system to obtain the chaotic sequence.
3. The image encryption method according to claim 2, characterized in that, The step of determining the perturbation of the chaotic mapping system based on the hash value includes: The hash value is divided into an even number of bit blocks based on a preset number of bits. Perform an XOR operation on each pair of the aforementioned bit blocks to obtain the key stream; The perturbation of the chaotic mapping system is generated through the key stream.
4. The image encryption method according to claim 3, characterized in that, The hash value is 64 bits; the preset bit length is 8 bits; the number of bit blocks is 64. The step of performing an XOR operation on each pair of the aforementioned bit blocks to obtain the key stream includes: The key stream is determined using the first formula; The first formula is: ; H(i) represents the i-th bit of the key stream; h(2i) and h(2i-1) represent the 2i-th and 2i-1-th bit blocks, respectively; i∈[1,32]; The perturbation used to generate the chaotic mapping system through the key stream includes: The perturbation of the chaotic mapping system is determined by the second formula; The second formula is: ; k1, k2, k3, and k4 are the perturbations of the chaotic mapping system.
5. The image encryption method according to claim 4, characterized in that, The adjustment of the given initial conditions based on the disturbance to obtain the initial conditions of the chaotic system includes: The initial conditions of the chaotic system are determined according to the third formula; The third formula is as follows: ; x0, y0, z0 represent the given initial conditions, and x0', y0', z0' represent the initial conditions of the chaotic system.
6. The image encryption method according to claim 2, characterized in that, The step of iterating the chaotic mapping system according to the initial conditions of the chaotic system to obtain the chaotic sequence includes: The chaotic mapping system is iterated based on the initial conditions of the chaotic system to obtain a pseudo-random sequence; The corresponding chaotic integer sequence determined based on the pseudo-random sequence is used as the chaotic sequence.
7. The image encryption method according to claim 6, characterized in that, The size of the plaintext image data is M×N; The step of iterating the chaotic mapping system according to the initial conditions of the chaotic system to obtain a pseudo-random sequence includes: The chaotic mapping system is iterated n+M+N times, and the results of the first n iterations are discarded to obtain the pseudo-random sequence; where n is any positive integer.
8. The image encryption method according to claim 1, characterized in that, The chaotic mapping system is a three-dimensional Lorenz chaotic mapping system; The state equation of the three-dimensional Lorenz chaotic mapping system is: ; Where a=10, b=8 / 3, c=28; x, y, z are input values. , , This is the output quantity.
9. The image encryption method according to claim 1, characterized in that, The step of performing an Arnold transform on the plaintext image data to obtain intermediate image data includes: The plaintext image data is subjected to Arnold transform to obtain scrambled image data; An Arnold transform is performed on the integer part of the scrambled image data to obtain diffused image data, and the diffused image data is used as the intermediate image data. The control parameters for the two Arnold transformations are determined by the chaotic sequence.
10. The image encryption method according to claim 9, characterized in that, The step of performing an Arnold transform on the plaintext image data to obtain scrambled image data includes: The plaintext image data is subjected to Arnold transformation using the fourth formula; The fourth formula is: ; i A j A k A Let i, j, and k represent the red, green, and blue data corresponding to a pixel after scrambling; let i, j, and k represent the red, green, and blue data corresponding to a pixel before scrambling; let N represent the sum of the width and height of the plaintext image data; and let A represent the Arnold transform matrix, which is: ; S A S B S C S D S E S F These represent the control parameters of the Arnold transform.
11. The image encryption method according to claim 10, characterized in that, The step of performing an Arnold transform on the integer portion of the scrambled image data to obtain diffused image data includes: The integer part of the scrambled image data is transformed using the fifth formula; The fifth formula is as follows: ; Vi(i,j,k) and Vi(i A ,j A ,k A ) represents the scrambling value of the previous round; Vi(i´,j´,k´) represents the diffusion value of the previous round; AVi(i,j,k), AVi(i A ,j A ,k A AVi(i´,j´,k´) represents the value after this round of diffusion; M represents the upper limit of the value range of the integer part of the scrambled image data.
12. The image encryption method according to claim 11, characterized in that, The control parameters for the two Arnold transformations, determined by the chaotic sequence, include: The control parameters for the two Arnold transformations are determined using the sixth formula; The sixth formula is as follows: ; a, b, and c are the parameters of the chaotic mapping system; x, y, and z are the chaotic sequences.
13. The image encryption method according to claim 1, characterized in that, The step of encrypting the intermediate image data using a deoxyribose encryption algorithm to obtain ciphertext image data includes: The intermediate image data and the chaotic sequence are converted into binary arrays, and the binary arrays are converted into deoxyribose sequences according to the encoding rules. The deoxyribose sequence is scrambled based on the chaotic sequence. The scrambled deoxyribose sequence is diffused based on the chaotic sequence to obtain the encrypted image data.
14. The image encryption method according to claim 13, characterized in that, The scrambling operation of the deoxyribose sequence based on the chaotic sequence includes: The chaotic sequence is sorted and the original position of each chaotic value in the sequence is recorded to obtain the sorting index; The bases of the deoxyribose sequence are rearranged according to the sorting index.
15. The image encryption method according to claim 13, characterized in that, The diffusion operation on the scrambled deoxyribose sequence based on the chaotic sequence includes: Perform a modulo-2 operation on the chaotic sequence; If the result is odd, then the diffusion operation is performed according to the addition rule; If the result is even, then a diffusion operation is performed using the subtraction rule.
16. The image encryption method according to any one of claims 1 to 15, characterized in that, Also includes: The encrypted image data is decrypted using a reverse deoxyribose encryption algorithm to obtain the intermediate image data; The intermediate image data is subjected to an inverse Arnold transform to obtain the plaintext image data.
17. An image encryption device, characterized in that, include: The chaotic mapping module is used to process plaintext image data through a chaotic mapping system to obtain chaotic sequences; The first encryption module is used to perform an Arnold transform on the plaintext image data to obtain intermediate image data; wherein the control parameters of the Arnold transform are determined by the chaotic sequence. The second encryption module is used to encrypt the intermediate image data using a deoxyribose encryption algorithm to obtain ciphertext image data; wherein the scrambling rules and diffusion algorithm of the deoxyribose encryption algorithm are determined by the chaotic sequence.
18. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the image encryption method as described in any one of claims 1 to 16.
19. An image encryption device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the image encryption method as described in any one of claims 1 to 16 when executing the computer program.
20. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a computer program, which, when executed by a processor, implements the steps of the image encryption method as described in any one of claims 1 to 16.