A Color Image Encryption Method and Device
Through the improved PLS composite chaotic sequence encryption scheme, combined with Padovan recursive and sin memory terms, combined with Arnold transformation and multi-level transformation, the balance problem of existing chaotic systems in terms of security and efficiency is solved, and high security and efficient color image encryption is achieved.
Patent Information
- Application Number
- CN202510654364.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-05-21
AI Technical Summary
The existing chaotic system encryption methods are inadequate in terms of security and efficiency. Traditional encryption algorithms have high computational complexity, insufficient security for a single chaotic system, and a narrow range of parameter values for composite chaotic systems and it is difficult to balance security and efficiency.
The improved PLS composite chaotic sequence encryption scheme is adopted, combined with Padovan recursive and sin memory terms to enhance the chaotic characteristics, spatial chaos is achieved through Arnold transformation, and deep protection is performed through multi-level transformation structure, and image features are associated with internal keys to generate high random sequences, combining the dual-key mechanism and three-level encryption transformation.
It improves the security of the system, reduces the computational complexity, improves encryption efficiency, enhances the key space, resists cryptographic analysis attacks, and realizes dynamic correlation and efficient encryption of image data.
Smart Images

Figure CN120186277B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and particularly to a color image encryption method and apparatus. Background Art
[0002] With the development of information technology and the advancement of the digitalization process, the need for secure transmission and storage of image data has become increasingly prominent. Image encryption technology has experienced an evolution process from traditional encryption algorithms to chaotic system encryption. Traditional encryption algorithms are represented by AES and DES. Such algorithms are based on strict mathematical theories and achieve encryption protection by performing binary stream conversion on image data and executing multiple rounds of iterative operations.
[0003] Due to its unique characteristics such as initial value sensitivity, unpredictable orbits, and ergodicity, the chaotic system has become a research hotspot in the field of image encryption. Currently, the closest to the present invention is the single chaotic system encryption method based on the Logistic map.
[0004] In the research of composite chaotic systems, various schemes have been proposed in the prior art: The Lorenz-Logistic system combines the characteristics of chaotic attractors and simplicity but has a high computational complexity. The Henon-Baker system achieves dual protection of position-value but has a narrow parameter value range and periodicity. The Chen-Tent system realizes the coupling optimization between systems but it is difficult to balance security and efficiency. The Rossler-Arnold system enhances the image scrambling effect but has too strong parameter sensitivity. In addition, the simple Logistic map is simple to implement but lacks security, and the basic Arnold transform can achieve spatial scrambling but lacks value range protection. Although these methods have their own characteristics, there is still room for improvement in the balance between security and performance.
[0005] To address the above problems, the present invention proposes a composite chaotic sequence encryption scheme based on improved PLS (Padovan-Logistic-Sine). By introducing Padovan recurrence and sin memory terms to enhance chaotic characteristics, combining with Arnold transform to achieve spatial scrambling, and implementing deep protection through a multi-level transformation structure. This scheme effectively overcomes the limitations of existing chaotic systems while maintaining computational efficiency. Summary of the Invention
[0006] To solve the technical problems existing in the background art, the present invention proposes a color image encryption method and apparatus.
[0007] In a first aspect, a color image encryption method proposed by the present invention includes the following steps:
[0008] S1. Obtain the plaintext image to be encrypted, extract the global image features of the plaintext image, and generate the internal key of the plaintext image based on the global image features;
[0009] S2. Obtain a random external key, and sequentially and complexly map the external key and the internal key from the key space to the parameter space to obtain four sets of parameters for generating chaotic sequences, where the parameter sets include control parameters , initial values and ;
[0010] S3. Input the four sets of parameter sets into a preset PLS composite chaotic system to generate four sets of independent chaotic sequences ;
[0011] S4. Encrypt the plaintext image based on the chaotic sequence and the chaotic sequence to obtain a semi-encrypted image;
[0012] S5. Generate a transformation matrix for joint encryption based on the chaotic sequence and the chaotic sequence . Perform an Arnold transform on the semi-encrypted image based on the transformation matrix to realize the joint encryption of the position and value of the plaintext image, so as to obtain the corresponding ciphertext image.
[0013] Preferably, step S4 specifically includes:
[0014] Generate a global scrambling matrix based on the random scrambling transformation of the chaotic sequence ;
[0015] Rearrange the pixel positions of the plaintext image according to the global scrambling matrix to obtain a first encrypted image;
[0016] Use the values in the chaotic sequence as the basis for the row and column translation amounts, and perform cyclic translation operations with different step sizes on each row and each column of the first encrypted image to obtain a second encrypted image;
[0017] Output the second encrypted image as the semi-encrypted image.
[0018] Preferably, the generating of the transformation matrix for joint encryption based on the chaotic sequence and the chaotic sequence specifically includes:
[0019] Perform multiple iterative operations on the standard coefficient matrix of the three-dimensional Arnold transform through the fast power iteration method to generate multiple pre-stored transformation matrices, where the standard coefficient matrix is specifically ; Each iteration operation corresponds to generating a pre-stored transformation matrix.
[0020] Preferably, the semi-encrypted image is subjected to Arnold transformation based on the transformation matrix to realize the joint encryption of the position and value of the plaintext image, so as to obtain the corresponding ciphertext image, which specifically includes:
[0021] Based on the chaotic sequence Calculate the iteration times t corresponding to the current pixel position (i, j) according to formula (1), and then obtain the pre-stored transformation matrix corresponding to the iteration times t ;
[0022] Among them, formula (1) is specifically:
[0023] Among them, the pre-stored transformation matrix selected is applied to the pixel values of the RGB three channels of the semi-encrypted image , T is the cycle period of the fast power; the pre-stored transformation matrix After being transformed T times by the fast power method, it will return to the standard coefficient matrix ; t is the number of transformations, which is used to determine the pre-stored transformation matrix corresponding to the current pixel position (i, j) from the generated multiple pre-stored transformation matrices ;
[0024] Perform coordinate mapping and modulo operation according to formula (2) to realize spatial domain scrambling. Formula (2) is specifically:
[0025] Among them, i and j are the abscissa and ordinate of the picture pixels; are the pixel values of the RGB three channels of the semi-encrypted image; is the t-th pre-stored matrix selected through formula (1) The pixel values of the RGB channels after transforming the pixel values of the RGB of the semi-encrypted image;
[0026] Based on the chaotic sequence Perform modulo addition-XOR composite operation on the transformed RGB channel pixel values according to formula (3) to realize value domain perturbation. Formula (3) is specifically:
[0027] Among them, k is the index of the RGB channel, which is 0, 1, 2, corresponding to R, G, B; represents the pixel value of a picture at the abscissa i, ordinate j, and color channel k; is the corresponding pixel value after transformation; refers to using the chaotic sequence The sequence values for transforming the abscissa \(i\), ordinate \(j\), and color channel \(k\) are used to transform the pixel values at the same coordinate position with the same chaotic sequence. Value;
[0028] Through the combined operation of the above process, double encryption of the pixel position and value is completed to generate the final ciphertext image.
[0029] Preferably, it further includes:
[0030] S6. When decrypting the ciphertext image, obtain the external key and internal key corresponding to the ciphertext image, and repeat steps S2 and S3 to reconstruct four groups of independent chaotic sequences. ;
[0031] S7. Based on the chaotic sequence and the chaotic sequence perform an inverse Arnold transform on the ciphertext image to obtain a semi-encrypted image;
[0032] S8. Based on the chaotic sequence and the chaotic sequence perform cyclic shift inverse transform and random scrambling inverse transform operations on the semi-encrypted image in sequence to obtain the corresponding plaintext image.
[0033] Preferably, step S1 specifically includes:
[0034] Obtain the plaintext image to be encrypted, and construct an internal feature key using the global features of the plaintext image;
[0035] By extracting the statistical features, structural features, and frequency domain features of the plaintext image, the statistical features include gray distribution and color histogram, the structural features include edges and texture information, and the frequency domain feature is specifically the spectrum distribution;
[0036] Combine the statistical features, structural features, and frequency domain features into a global image feature vector in numerical form;
[0037] After normalizing the global image feature vector, convert it to an integer between 0 and 255, and then generate a 256-bit internal key through the SHA-256 hash algorithm.
[0038] Preferably, step S2 specifically includes:
[0039] Generate a 256-bit random external key through the CTR_DRBG algorithm, divide the 256-bit external key and internal key into 32 groups of 8-bit sequences respectively, and map the external key and internal key from the key space to the parameter space through multiple non-linear operations to obtain four groups of parameter sets for generating chaotic sequences. The parameter sets include control parameters Initial value and 。
[0040] Preferably, step S3 specifically includes:
[0041] Input the four groups of parameter sets into the PLS composite chaotic system in sequence. The specific mathematical model of the preset PLS composite chaotic system is:
[0042] Wherein, is the chaotic control parameter, ; is the sequence value range, ; a is the memory term influence parameter; b is the step size;
[0043] After iterating multiple times to eliminate the transient state, generate four groups of independent chaotic sequences 。
[0044] In a second aspect, a color image encryption device proposed by the present invention includes:
[0045] A feature extraction module, configured to obtain a plaintext image to be encrypted, extract global image features of the plaintext image, and generate an internal key of the plaintext image based on the global image features;
[0046] A parameter generation module, configured to obtain a random external key, and map the external key and the internal key from the key space to the parameter space in sequence to obtain four groups of parameter sets for generating chaotic sequences. The parameter sets include a control parameter , an initial value and ;
[0047] A chaotic sequence generation module, configured to input the four groups of parameter sets into a preset PLS composite chaotic system to generate four groups of independent chaotic sequences ;
[0048] A first encryption module, configured to encrypt the plaintext image based on the chaotic sequence and the chaotic sequence to obtain a semi-encrypted image;
[0049] A second encryption module, configured to generate a transformation matrix for joint encryption based on the chaotic sequence and the chaotic sequence , and perform an Arnold transformation on the semi-encrypted image based on the transformation matrix to realize the joint encryption of the position and value of the plaintext image to obtain the corresponding ciphertext image.
[0050] Preferably, it further includes:
[0051] The first decryption module is used to obtain the external key and internal key corresponding to the ciphertext image and reconstruct four independent chaotic sequences when decrypting the ciphertext image. ;
[0052] The second decryption module is used to perform an inverse Arnold transform on the ciphertext image based on the chaotic sequence and the chaotic sequence to obtain a semi-encrypted image.
[0053] The third decryption module is used to perform cyclic translation inverse transformation and random scrambling inverse transformation operations on the semi-encrypted image in sequence based on the chaotic sequence and the chaotic sequence to obtain the corresponding plaintext image.
[0054] In a third aspect, the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0055] The memory stores computer-executable instructions;
[0056] The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of the first aspects.
[0057] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the method according to any one of the first aspects.
[0058] In a fifth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the method according to any one of the first aspects.
[0059] In the present invention, the proposed color image encryption method and device associate image features through an internal key, realizing "one Figure 1 cipher", establishing a dynamic association between the encryption process and image data. By generating a highly random sequence through a PLS composite chaotic system, combining a dual-key mechanism and a three-level encryption transformation, it solves the problems of small key space, obvious periodicity, and too high computational complexity in the prior art, improves the security of the system, and reduces the computational complexity of the Arnold transform through pre-storage of a three-dimensional transformation matrix; through RGB channel decoupling, sequence block generation, and matrix partition calculation, parallel processing of multiple links is realized, and the encryption efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 is a schematic structural diagram of the working process of a color image encryption method proposed by the present invention;
[0061] Figure 2 Schematic diagram of the encryption implementation structure of a color image encryption method proposed by the present invention;
[0062] Figure 3 Schematic diagram of the decryption implementation structure of a color image encryption method proposed by the present invention;
[0063] Figure 4 Schematic diagram of the encryption and decryption of an embodiment of a color image encryption method proposed by the present invention;
[0064] Figure 5 Phase diagram of the correlation between adjacent pixels of Baboon in an embodiment of a color image encryption method proposed by the present invention;
[0065] Figure 6 Phase diagram of the correlation between adjacent pixels of Pepper in an embodiment of a color image encryption method proposed by the present invention;
[0066] Figure 7 Phase diagram of the correlation between adjacent pixels of Airplane in an embodiment of a color image encryption method proposed by the present invention;
[0067] Figure 8 Histogram comparison chart of the encrypted and decrypted images of Baboon in an embodiment of a color image encryption method proposed by the present invention;
[0068] Figure 9 Histogram comparison chart of the encrypted and decrypted images of Pepper in an embodiment of a color image encryption method proposed by the present invention;
[0069] Figure 10 Histogram comparison chart of the encrypted and decrypted images of Airplane in an embodiment of a color image encryption method proposed by the present invention;
[0070] Figure 11 Schematic diagram of the structure of the electronic device provided by the embodiment of the present application. Detailed implementation manners
[0071] Referring to Figures 1 - 11 , a color image encryption method proposed by the present invention includes the following steps:
[0072] S1. Obtain the plaintext image to be encrypted, extract the global image features of the plaintext image, and generate the internal key of the plaintext image based on the global image features.
[0073] In this embodiment, step S1 specifically includes: obtaining the plaintext image to be encrypted, and constructing an internal feature key by using the global features of the plaintext image; by extracting the statistical features, structural features and frequency-domain features of the plaintext image, the statistical features include the gray-scale distribution and color histogram, the structural features include edges and texture information, and the frequency-domain feature is specifically the spectral distribution; combining the statistical features, structural features and frequency-domain features into a global image feature vector in numerical form; after normalizing the global image feature vector, converting it into an integer between 0 and 255, and then generating a 256-bit internal key through the SHA-256 hash algorithm. This method enables the encryption process to adapt to the characteristics of different images, enhances the security and pertinence of the system, and realizes "one Figure 1 encryption".
[0074] S2. Obtain a random external key, and sequentially and complexly map the external key and the internal key from the key space to the parameter space to obtain four groups of parameter sets for generating a chaotic sequence, and the parameter sets include control parameters , initial values and .
[0075] In this embodiment, step S2 specifically includes:
[0076] Generate a 256-bit random external key through the CTR_DRBG algorithm, divide the 256-bit external key and the internal key into 32 groups of 8-bit sequences respectively, and complexly map the external key and the internal key from the key space to the parameter space through multiple non-linear operations to obtain four groups of parameter sets for generating a chaotic sequence, and the parameter sets include control parameters , initial values and .
[0077] Specifically, use CTR_DRBG (Counter Mode Deterministic Random Bit Generator) that complies with the NIST SP 800-90A standard to generate an external random key. This method first collects multiple entropy sources, including the system timestamp (accurate to nanoseconds), process information and system random entropy. Use the HKDF (HMAC-based Key Derivation Function) key derivation function to mix and expand these entropy source data to generate 48-byte seed material (32-byte key + 16-byte counter). Through the counter incrementing and periodic reseeding mechanism, ensure that the generated 256-bit random key has high entropy and unpredictability. At the same time, use SHA-256 hash for key strength verification to further ensure the quality of the key.
[0078] Further, the 256-bit external key and internal key are each divided into 32 groups of 8-bit sequences, and a complex mapping from the key space to the parameter space is realized through multiple non-linear operations. This mechanism first performs a mixing operation on every 4 bytes of the internal key, combines the external key to generate a denominator value, and finally generates the input parameters (control parameters , initial value and ) required by the PLS chaotic system through a series of non-linear transformations.
[0079] It should be noted that the multiple non-linear operations include the following operations:
[0080] The internal key mixing function is as follows: ;
[0081] Among them, are four bytes in the internal key, represents the bitwise exclusive OR operation; is the internal key mixing function; this function compresses the information of four bytes into one byte, increasing the complexity through addition and exclusive OR operations.
[0082] External key denominator calculation: ;
[0083] Among them, are two bytes in the external key. This function generates a value greater than 256 as the denominator, ensuring sufficient precision for the finally generated chaotic parameters. The modulo 16 operation limits the result range, preventing the denominator from being too large, while the exclusive OR operation increases the influence of the external key on the parameters.
[0084] In this embodiment, the 256-bit external random key and internal feature key are each divided into 32 groups of 8-bit sequences, obtaining two groups of key parameters: and ;
[0085] It should be noted that the internal and external keys are divided into 4 groups, each group having 8 bytes, corresponding to 4 chaotic sequences. Taking the first group as an example, it is as follows:
[0086] This parameterization scheme not only ensures the uniform distribution and high sensitivity of the parameters, but also fully utilizes the information entropy of the dual keys through grouped processing and multiple mixing operations, achieving the maximum utilization of the key space.
[0087] S3. Input the four groups of parameter sets into a preset PLS composite chaotic system to generate four groups of independent chaotic sequences .
[0088] In this embodiment, step S3 specifically includes: sequentially inputting four groups of parameter sets into the PLS composite chaotic system. The specific mathematical model of the preset PLS composite chaotic system is: ;
[0089] Among them, is the chaos control parameter, ; is the sequence value range, ; a is the memory term influence parameter; b is the step size; after iterating multiple times (for example, 1000 times) to eliminate transients, four groups of independent chaotic sequences .
[0090] Specifically, the present invention designs a PLS (Padovan-Logistic-Sine Map) composite chaotic system for generating four groups of independent chaotic sequences to control encryption transformations at different levels. This system realizes the generation of high-quality chaotic sequences by combining three mathematical mappings with different characteristics. The core components of the system include: the Padovan recurrence sequence of the basic framework, the Logistic-Sin memory term mapping of the core dynamic mechanism, and the Sine mapping of the output modulation. The derivation process of the mathematical model of the preset PLS composite chaotic system is as follows:
[0091] (1) Construct a sequence basis based on the Padovan recurrence relation.
[0092] The Padovan recurrence relation is a recurrence rule similar to the Fibonacci sequence, but uses the sum of the second previous term and the third previous term. It provides the long-term dependence relationship of the sequence, making the sequence evolution have rich dynamic characteristics. The formula is as follows:
[0093] Among them, is the nth number in the sequence of the Padovan recurrence relation;
[0094] (2) Introduce the chaotic characteristics of the Logistic map.
[0095] The Logistic map is one of the most classic maps in the study of chaotic systems. The traditional Logistic map shows chaotic characteristics in the range, and the value range is limited within . In the PLS model, the intermediate value obtained by Padovan recurrence is substituted into the Logistic map and a memory term based on the Sin function is introduced. By setting the memory term influence parameter a and the step size b, the formula is as follows:
[0096] Among them, is the result of the Logistic map;
[0097] (3) Perform the final modulation through the Sine map.
[0098] Finally, apply the Sine map to the result of the previous step for modulation:
[0099] Due to the modulation of the Sine map, the chaos control parameters of the final model can have a value range extended to , far exceeding the limitations of the traditional Logistic map, which greatly enhances the flexibility of the system. The Sine map realizes three important functions: one is to ensure that the output sequence is strictly restricted within ; the second is to enhance the non-linear characteristics of the sequence; the third is to smooth the sequence, reduce mutations, and improve the practicality of the sequence.
[0100] Integrate the above steps to obtain the complete model of the PLS chaotic sequence.
[0101] In this embodiment, in order to meet the requirements of different encryption levels, the original output sequence of the PLS system needs to undergo specific optimization processing and be converted into a form suitable for encryption transformation, including value range transformation, quantization, and reshaping operations.
[0102] Through the above design, although the four groups of sequences use the same PLS structure, due to the differences in parameters and initial conditions, they exhibit good independence and unpredictability, while meeting the functional requirements of different encryption levels. The statistical characteristics and security of the sequences are verified through the NIST SP800-22 randomness test suite to ensure meeting the requirements of cryptographic applications.
[0103] Specifically, through the innovative design of the PLS composite chaotic system, the quality of the chaotic sequence is significantly improved. Introduce the Padovan recurrence as the basic framework and combine it with the Logistic-Sin memory term mechanism, so that the generated chaotic sequence has better randomness (passing all 15 tests of NIST SP800-22) and a longer period ( ). At the same time, the autocorrelation coefficient of the sequence is reduced to 0.0023, and the cross-correlation coefficient is less than 0.01, effectively overcoming the periodic limitations of traditional chaotic systems and providing a high-quality pseudo-random sequence basis for the encryption system.
[0104] In this embodiment, the PLS composite chaotic system (Padovan-Logistic-Sine Map) is an improved piecewise linear chaotic map. By introducing memory terms and trigonometric function transformations, the chaotic characteristics and complexity of the system are enhanced.
[0105] Based on experimental analysis, the following parameter combinations are selected as examples: chaotic parameters ; initial value ; initial value ; memory term weight ; memory step size . The process of generating the chaotic sequence is as follows:
[0106] Step 1: Initialization; First, initialize the first two values of the sequence: ; ;
[0107] Step 2: Sequence iteration generation; For , we generate the sequence through the following iterative process:
[0108] 1. Padovan recurrence: Calculate the base value by combining the first two values: ;
[0109] 2. Logistic mapping and memory term: Apply the Logistic mapping and add the sin memory term ;
[0110] where, is the memory term, using the values of the previous k steps.
[0111] 3. Sine mapping: Use the sine function to increase the non - linear characteristics ;
[0112] Step 3: Discard the initial transient
[0113] To eliminate the influence of the initial conditions, we discard the first 1,000 points of the sequence.
[0114] Specifically, taking the first iterative step (calculating ) as an example, the calculation process is shown in detail as follows:
[0115] Initial value setting, first set the initial values: ; ;
[0116] Calculation of is as follows:
[0117] 1. Calculate Padovan recurrence: ;
[0118] Since there is no , we use for substitution: ;
[0119] 2. Apply Logistic mapping and memory term:
[0120] 3. Apply the Sine mapping:
[0121] Subsequent iterative steps Follow the same calculation rules, continuously substitute the previously calculated results into the formula to generate new sequence elements. Through a large number of iterations, the system gradually exhibits chaotic characteristics.
[0122] In this embodiment, the chaotic characteristics are analyzed as follows:
[0123] When the system exhibits chaotic characteristics:
[0124] Sensitive dependence on initial conditions: A small change in the initial value will result in a completely different sequence;
[0125] Orbit instability: The sequence has no obvious periodicity and regularity;
[0126] Positive Lyapunov exponent: Under this parameter, the Lyapunov exponent indicating that the system is in a chaotic state.
[0127] S4. Based on the chaotic sequence and the chaotic sequence encrypt the plaintext image to obtain a semi-encrypted image.
[0128] In this embodiment, step S4 specifically includes: generating a global scrambling matrix based on the random scrambling transformation of the chaotic sequence ; rearranging the pixel positions of the plaintext image according to the global scrambling matrix to obtain a first encrypted image; using the values in the chaotic sequence as the basis for the row and column translation amounts, and performing cyclic translation operations with different step sizes on each row and each column of the first encrypted image to obtain a second encrypted image; outputting the second encrypted image as the semi-encrypted image.
[0129] S5. Generate a transformation matrix for joint encryption based on the chaotic sequence and the chaotic sequence ; perform an Arnold transformation on the semi-encrypted image based on the transformation matrix to achieve joint encryption of the position and value of the plaintext image, so as to obtain the corresponding ciphertext image.
[0130] In this embodiment, generating a transformation matrix for joint encryption based on the chaotic sequence and the chaotic sequence specifically includes: using the fast power iteration method for the standard coefficient matrix of the three-dimensional Arnold transformation Perform multiple iterative operations to generate multiple pre-stored transformation matrices, where the standard coefficient matrix Specifically ; Each iterative operation corresponds to generating a pre-stored transformation matrix.
[0131] In this embodiment, based on the transformation matrix, perform an Arnold transformation on the semi-encrypted image to achieve joint encryption of the position and value of the plaintext image, so as to obtain the corresponding ciphertext image, specifically including:
[0132] Based on the chaotic sequence Calculate the iteration number t corresponding to the current pixel position (i, j) according to formula (1), and then obtain the pre-stored transformation matrix corresponding to this iteration number t ;
[0133] Among them, formula (1) is specifically:
[0134] Among them, apply the selected pre-stored transformation matrix to the RGB channel pixel values of the semi-encrypted image , T is the cycle period of the fast power; after performing T transformations on the pre-stored transformation matrix in the way of fast power, it will return to the standard coefficient matrix ; t is the number of transformations, used to determine the pre-stored transformation matrix corresponding to the current pixel position (i, j) from the generated multiple pre-stored transformation matrices ;
[0135] Perform coordinate mapping and modulo operation according to formula (2) to achieve spatial domain scrambling. Formula (2) is specifically:
[0136] Among them, i and j are the abscissa and ordinate of the picture pixels; are the RGB channel pixel values of the semi-encrypted image; is the t-th pre-stored matrix selected through formula (1) The RGB channel pixel values after transforming the RGB pixel values of the semi-encrypted image;
[0137] Based on the chaotic sequence Perform modulo addition-XOR composite operation on the transformed RGB channel pixel values according to formula (3) to achieve value domain perturbation. Formula (3) is specifically:
[0138] Among them, k is the index of the RGB channel, which is 0, 1, 2, corresponding to R, G, B; represents the pixel value of a picture at the abscissa i, ordinate j, and color channel k; is the corresponding pixel value after transformation; It refers to using a chaotic sequence to transform the sequence values of the abscissa i, ordinate j, and color channel k. For the pixel values at the same coordinate position, the same chaotic sequence is used for transformation value;
[0139] Through the combined operation of the above process, double encryption of the pixel position and value is completed, and the final encrypted image is generated.
[0140] Specifically, the present invention realizes a three-level encryption structure to form a deep defense mechanism. Such as Figure 2 shown, each level of transformation targets different characteristics of the image data and is controlled by an independent chaotic sequence to achieve multiple protections:
[0141] The first-level encryption adopts a random scrambling transformation based on the chaotic sequence, which is a global rearrangement operation for pixel positions. This transformation first uses the chaotic sequence values to establish a mapping relationship with the pixel positions to generate a global scrambling matrix; then, according to this matrix, the rearrangement of pixel positions is performed to achieve a completely scrambled effect. This transformation is independently performed for each of the RGB three channels, keeping the original color values of the pixels unchanged, but completely destroying the spatial correlation and visual characteristics of the image. Through this transformation, the correlation coefficient between any adjacent pixels in the image is reduced from more than 0.9 in the original image to close to 0.
[0142] The second-level encryption is based on the chaotic sequence to implement a cyclic translation transformation, which performs a finer-grained adjustment of pixel positions on the image processed in the first level. This transformation uses the values in the chaotic sequence as the basis for the row and column translation amounts, and performs cyclic translation operations with different step sizes for each row and each column of the image respectively. Although this row-column-based translation transformation is simple, since the translation amounts of each row and each column are independently determined by the chaotic sequence and cannot be predicted, it greatly enhances the diffusion characteristics of encryption.
[0143] The third-level encryption is one of the core innovations of the present invention. It adopts an enhanced Arnold transformation based on and the chaotic sequence to achieve joint encryption of position and value. This transformation combines double perturbations in the spatial domain and value domain to form a comprehensive protection mechanism.
[0144] Furthermore, based on by combining exclusive OR operation and modulo addition operation, non-linear perturbations are performed on each of the RGB three color channels. For the pixel at position (i, j), the channel transformation adopts the following formula: ;
[0145] Among them, represents the encrypted pixel value; represents the original pixel value; represents the value of the chaotic sequence at the (i, j) position in the k-th channel, represents the RGB channels. This transformation is independently performed on the three RGB channels, achieving high-strength value range protection while maintaining simple and reversible calculations.
[0146] Specifically, through pre-computation and three-dimensional transformation matrix storage technology, the present invention reduces the computational complexity of the Arnold transformation. In a specific implementation, a hierarchical index structure is adopted to reduce storage overhead; at the same time, through a dynamic parameter selection mechanism, the security of the transformation is ensured to be unaffected by pre-storage, achieving an optimal balance among storage space, computational efficiency, and security. A three-level encryption transformation structure is adopted, and through an organic combination of random scrambling, cyclic translation, and Arnold transformation, all-round protection is achieved in two dimensions of the spatial domain and the value domain. After strict security testing, the NPCR (Pixel Change Rate) of the encrypted image reaches 99.61% (higher than the security standard of 99.60%), and the UACI (Unified Average Change Intensity) reaches 33.46% (within the range of the theoretical optimal value of 33.33% ± 1%). The correlation between adjacent pixels is reduced from 0.9587 of the original image to 0.0031. By introducing image features, the key space of the system is expanded from the traditional to or so, effectively resisting various known cryptographic analysis attacks.
[0147] The present invention realizes multiple parallel optimizations at the algorithm structure design level. First, in terms of image data processing, a channel-level parallel architecture is adopted to decouple the transformation operations of the three RGB color channels into independent processing flows, supporting parallel computing. Second, in the chaotic sequence generation link, through a block calculation strategy, the generation task of a long sequence is supported to be divided into multiple independent sub-sequence generation tasks, and each sub-sequence is independent of each other and can be executed concurrently. Finally, in the construction process of the transformation matrix, a partition calculation method is also supported to decompose large-scale matrix operations into several small-scale independent matrix operations. This multi-level parallel optimization design enables the system to fully utilize the parallel computing power of modern processors.
[0148] In this embodiment, it further includes:
[0149] S6. When decrypting the ciphertext image, obtain the external key and internal key corresponding to the ciphertext image, and repeat steps S2 and S3 to reconstruct four groups of independent chaotic sequences ;
[0150] S7. Based on the chaotic sequence and the chaotic sequence Perform the Arnold inverse transformation on the encrypted image to obtain a semi - encrypted image;
[0151] S8. Based on the chaotic sequence and the chaotic sequence , perform cyclic shift inverse transformation and random scrambling inverse transformation operations on the semi - encrypted image in sequence to obtain the corresponding plain - text image.
[0152] Specifically, the decryption process is the reverse operation of the encryption process. As Figure 3 shown, perform three - level inverse transformations in the reverse order of encryption to achieve the precise restoration of the image. The specific steps are as follows:
[0153] (1) Key reconstruction and sequence recovery
[0154] In this stage, it is first necessary to use the same external key and image feature key as in the encryption process. Based on these two keys, reconstruct four groups of chaotic sequences through the PLS composite chaotic system .
[0155] (2) Arnold inverse transformation
[0156] As the first step of decryption (corresponding to the last step of encryption), it is necessary to remove the influence of the Arnold transformation and pixel value perturbation. Perturbation inverse transformation: For the encrypted pixel values of each channel, apply the perturbation inverse transformation. Matrix inverse transformation: Apply the matrix inverse transformation to restore the original RGB values. With the same index used during encryption, find the inverse matrix of the corresponding transformation matrix and directly look it up through pre - storage.
[0157] (3) Cyclic shift inverse transformation
[0158] The second step of decryption corresponds to the second layer of encryption and requires the reverse application of the cyclic shift transformation. Inverse vector calculation: According to the image width and height , calculate the inverse vector for the translation amount of each row and each column; Inverse transformation: Based on the index during encryption of the RGB channels, deduce the intermediate result image and the image after inverse transformation, and apply the inverse vector for cyclic shift.
[0159] (4) Random scrambling inverse transformation
[0160] The last step of decryption corresponds to the first layer of encryption and requires the application of the inverse transformation of random scrambling. Scrambling matrix inverse transformation: Use the sequence to reconstruct the inverse matrix of the global scrambling matrix, and then apply this inverse matrix to restore the pixel positions.
[0161] (5) Integrity verification
[0162] Integrity verification is the last step in the decryption process. The system calculates the eigenvalue of the decrypted image, including statistical features, structural features, frequency domain features, etc., and compares them with the features of the original image. By analyzing the feature matching degree, the accuracy of the decrypted restoration can be verified to ensure the correctness of the decryption result.
[0163] In this embodiment, Baboon, Airplane, and Pepper plaintext images with a size of 512×512 are used. As Figure 4 shown, the encryption and decryption processes of this method are applied for multiple tests, where Figure 4 shows the image processing processes of Baboon, Airplane, and Pepper plaintext images before and after encryption and decryption. The test results are as Figures 5 - 10 shown. Figure 4 a) in Figure 4 is the plaintext image; Figure 4 b) in Figure 4 is the encrypted image; Figure 4 c) in Figure 4 is the decrypted image. Figure 4 d) in Figure 4 is the encrypted image; Figure 4 e) in
[0164] From Figure 4 the results shown, it can be found that the encrypted image appears as a noise image, indicating that the algorithm achieves a good encryption effect visually and the original image cannot be directly distinguished. At the same time, the decrypted image is consistent with the plaintext image, meaning that the decryption algorithm can completely restore the plaintext image. The experimental results show that the color image encryption algorithm based on the PLS chaotic system can run normally and achieve the corresponding encryption and decryption effects.
[0165] Specifically, Figure 5 a) in Figure 5 is the adjacent pixel correlation phase diagram of the Baboon plaintext image; Figure 6 b) in Figure 6 is the adjacent pixel correlation phase diagram of the Baboon encrypted image; Figure 7 a) in Figure 7 is the adjacent pixel correlation phase diagram of the Pepper plaintext image;
[0166] The adjacent pixel correlation test results of Baboon, Airplane, and Pepper plaintext images are shown in the following table:In this embodiment, three groups of test images (with a resolution of 512×512), namely Baboon, Airplane, and Pepper, are selected for entropy value analysis, and the experimental data are shown in the following table:
[0167]
[0168] The experimental results show that the entropy values of the encrypted images all approach the theoretical limit value of 8, which is significantly improved compared with the original plaintext images. This indicates that the encryption process effectively realizes the uniformization of pixel distribution, thereby enhancing the anti-statistical analysis attack ability of the images.
[0169] In this embodiment, in order to verify the statistical characteristics of the encryption algorithm, Baboon, Airplane, and Pepper images with a resolution of 512×512 are selected for histogram analysis, as Figures 8 - 10 shown, Figure 8 a) in is the histogram of the Baboon plaintext image, Figure 8 and b) in is the histogram of the Baboon encrypted image; Figure 9 a) in is the histogram of the Pepper plaintext image, Figure 9 and b) in is the histogram of the Pepper encrypted image; Figure 10 a) in is the histogram of the Airplane plaintext image, Figure 10 and b) in is the histogram of the Airplane encrypted image; The abscissa of the histogram represents the pixel gray value (from 0 to 255), and the ordinate represents the frequency of occurrence of the pixels corresponding to the gray value. It can be seen from the analysis results that the histogram distribution of the plaintext image is uneven and there are obvious statistical characteristics; while the histogram of the encrypted image shows a uniform distribution in the entire gray value range, and the distributions of the RGB three channels are almost exactly the same, and the frequency of each gray value is close to 2000. This indicates that the encryption algorithm can effectively eliminate the statistical characteristics of the image and enhance the ability to resist statistical analysis attacks.
[0170] In this embodiment, the experiment uses three groups of standard test images with a resolution of 512×512, namely Baboon, Airplane, and Pepper, to calculate their NPCR and UACI values respectively. The experimental data are shown in detail in the following table:
[0171]
[0172] Among them, the NPCR values of the three groups of test images all fluctuate around the reference value of 99.60%, and the UACI values are stable around the theoretical threshold of 33.33%. This experimental result shows that the proposed encryption scheme exhibits significant anti-disturbance ability in resisting differential attacks and dealing with known / selected plaintext attacks, providing reliable guarantee for the secure transmission of sensitive data.
[0173] Reference Figures 1 - 11 , a color image encryption device proposed by the present invention includes:
[0174] A feature extraction module for obtaining a plaintext image to be encrypted, extracting global image features of the plaintext image, and generating an internal key of the plaintext image based on the global image features;
[0175] A parameter generation module for obtaining a random external key, and sequentially mapping the external key and the internal key from the key space to the parameter space in a complex manner to obtain four sets of parameters for generating a chaotic sequence, and the parameter set includes a control parameter , an initial value and ;
[0176] A chaotic sequence generation module for inputting the four sets of parameters into a preset PLS composite chaotic system to generate four independent chaotic sequences ;
[0177] A first encryption module for encrypting the plaintext image based on the chaotic sequence and the chaotic sequence to obtain a semi-encrypted image;
[0178] A second encryption module for generating a transformation matrix for joint encryption based on the chaotic sequence and the chaotic sequence , and performing an Arnold transform on the semi-encrypted image based on the transformation matrix to realize the joint encryption of the position and value of the plaintext image to obtain the corresponding ciphertext image.
[0179] In this embodiment, it further includes:
[0180] A first decryption module for obtaining the external key and the internal key corresponding to the ciphertext image and reconstructing the corresponding four independent chaotic sequences when decrypting the ciphertext image ;
[0181] A second decryption module for performing an inverse Arnold transform on the ciphertext image based on the chaotic sequence and the chaotic sequence to obtain a semi-encrypted image;
[0182] A third decryption module for sequentially performing a cyclic translation inverse transform and a random scrambling inverse transform operation on the semi-encrypted image based on the chaotic sequence and the chaotic sequence to obtain the corresponding plaintext image.
[0183] Figure 11 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Please refer toFigure 11 , the electronic device 20 may include: a memory 21 and a processor 22. Exemplarily, the memory 21 and the processor 22 are interconnected with each other through a bus 23. The memory 21 is used to store computer-executable instructions; the processor 22 is used to execute the computer-executable instructions stored in the memory, so as to cause the control device 20 to execute the method shown in the above method embodiment.
[0184] The electronic device provided by the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be elaborated here.
[0185] The embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, which will not be elaborated here.
[0186] The embodiment of the present application may further provide a computer program product, including a computer program. When the computer program is executed by a processor, it can implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, which will not be elaborated here.
[0187] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0188] Furthermore, it should be noted that although each step in the flowchart is displayed sequentially according to the indication of the arrow, these steps are not necessarily executed sequentially according to the indication of the arrow. Unless there is a clear description in this article, the execution of these steps has no strict sequence limitation, and these steps can be executed in other sequences. Moreover, at least a part of the steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution sequence of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0189] It should be understood that the above device embodiments are merely illustrative, and the devices of the present application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0190] In addition, without special explanation, in each embodiment of the present application, each functional unit / module can be integrated in one unit / module, or each unit / module can exist physically alone, or two or more units / modules can be integrated together. The above integrated unit / module can be implemented in the form of hardware or in the form of a software program module.
[0191] When the integrated unit / module is implemented in the form of hardware, the hardware can be a digital circuit, an analog circuit, etc. Without special explanation, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP for short), a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Without special explanation, the storage unit can be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.
[0192] When the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of this application. The aforementioned memory includes: various media such as USB flash drives, read-only memories (ROM), random access memories (RAM), external hard drives, magnetic disks, or optical discs that can store program codes.
[0193] As described above, the above are only the preferred specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution of the present invention and its inventive concept, makes equivalent substitutions or changes, and all should be covered by the protection scope of the present invention.
Claims
1. A color image encryption method, characterized in that It includes the following steps: S1. Obtain the plaintext image to be encrypted, extract the global image features of the plaintext image, and generate the internal key of the plaintext image based on the global image features; S2. Obtain a random external key, and sequentially map the external key and the internal key from the key space to the parameter space in a complex manner to obtain four sets of parameters for generating a chaotic sequence, where the parameter set includes a control parameter , an initial value and ; S3. Input the four groups of parameter sets into a preset PLS composite chaotic system to generate four groups of independent chaotic sequences ; S4. Based on the chaotic sequence and the chaotic sequence perform encryption processing on the plaintext image to obtain a semi-encrypted image; S5. Based on the chaotic sequence and the chaotic sequence generate a transformation matrix for joint encryption, and perform Arnold transformation on the semi-encrypted image based on the transformation matrix to achieve joint encryption of the position and value of the plaintext image, so as to obtain the corresponding ciphertext image.
2. The color image encryption method according to claim 1, wherein Step S4 specifically includes: Based on chaotic sequences a globally scrambled matrix is generated through random scrambling transformation; Rearrange the pixel positions of the plaintext image according to the global scrambling matrix to obtain the first encrypted image; Using the values in the chaotic sequence as the basis for the row and column translation amounts, perform cyclic translation operations with different step sizes on each row and each column of the first encrypted image respectively to obtain the second encrypted image; Output the second encrypted image as the semi-encrypted image.
3. The color image encryption method according to claim 1, wherein The said one based on chaotic sequences and chaotic sequences generate a transformation matrix for joint encryption, specifically including: The standard coefficient matrix of the 3D Arnold transform is processed by the fast power iteration method to perform multiple iterative operations to generate multiple pre-stored transformation matrices, where the standard coefficient matrix is specifically ; each iterative operation corresponds to generating a pre-stored transformation matrix.
4. The color image encryption method according to claim 3, characterized in that Based on the transformation matrix, perform the Arnold transformation on the semi-encrypted image to realize the joint encryption of the position and value of the plaintext image, so as to obtain the corresponding ciphertext image, specifically including: Based on the chaotic sequence Calculate the iteration number t corresponding to the current pixel position (i, j) according to formula (1), and then obtain the pre-stored transformation matrix corresponding to the iteration number t ; Among them, formula (1) is specifically: Among them, the selected pre-stored transformation matrices are respectively applied to the RGB three-channel pixel values of the semi-encrypted image , T is the cycle period of the fast power; the fast power method is used to perform t transformations on the pre-stored transformation matrix and will return to the standard coefficient matrix after t transformations ; t is the number of transformations, which is used to determine the pre-stored transformation matrix corresponding to the current pixel position (i, j) from the generated multiple pre-stored transformation matrices ; Perform coordinate mapping and modulo operation according to formula (2) to achieve scrambling in the spatial domain. Formula (2) is specifically as follows: where i and j are the abscissa and ordinate of the image pixels; are the RGB three-channel pixel values of the semi-encrypted image; is the t-th pre-stored matrix selected through formula (1) are the RGB channel pixel values after transforming the RGB pixel values of the semi-encrypted image; Based on the chaotic sequence Perform modulo addition-XOR compound operation on the transformed RGB channel pixel values according to formula (3) to achieve value range perturbation. Formula (3) is specifically: where k is the index of the RGB channel, which is 0, 1, 2, corresponding to R, G, B; represents the pixel value of an image at the abscissa i, ordinate j, and color channel k; is the corresponding transformed pixel value; refers to using the chaotic sequence The sequence values obtained by transforming the abscissa i, ordinate j, and color channel k. For the pixel values at the same coordinate position, the same chaotic sequence value is used; Through the above combined operations, complete the double encryption of the pixel position and value, and generate the final ciphertext image.
5. The color image encryption method according to claim 2, characterized in that, It also includes: S6. When decrypting the ciphertext image, obtain the external key and internal key corresponding to the ciphertext image, and repeat steps S2 and S3 to reconstruct four corresponding independent chaotic sequences ; S7. Based on chaotic sequences and chaotic sequences perform an inverse Arnold transform on the encrypted image to obtain a semi-encrypted image; S8. Based on chaotic sequences and chaotic sequences , perform cyclic translation inverse transformation and random scrambling inverse transformation operations on the semi-encrypted image in sequence to obtain the corresponding plaintext image.
6. The color image encryption method according to claim 1, wherein Step S1 specifically includes: Obtain the plaintext image to be encrypted, and construct the internal feature key by using the global features of the plaintext image; By extracting the statistical features, structural features and frequency domain features of the plaintext image, the statistical features include gray distribution, color histogram, the structural features include edges, texture information, and the frequency domain feature is specifically the spectrum distribution; Combine the statistical features, structural features and frequency domain features into a global image feature vector in numerical form; After normalizing the global image feature vector, convert it into an integer between 0 and 255, and then generate a 256-bit internal key through the SHA-256 hash algorithm.
7. The color image encryption method according to claim 6, wherein Step S2 specifically includes: Generate a 256-bit random external key through the CTR_DRBG algorithm, divide the 256-bit external key and the internal key into 32 groups of 8-bit sequences respectively, and complexly map the external key and the internal key from the key space to the parameter space through multiple non-linear operations to obtain four groups of parameter sets for generating chaotic sequences. The parameter sets include control parameters , initial values and .
8. The color image encryption method according to claim 1, characterized in that Step S3 specifically includes: Four sets of parameter sets are sequentially input into the PLS composite chaotic system. The specific mathematical model of the preset PLS composite chaotic system is as follows: ; Among them, is the chaos control parameter, ; is the sequence value range, ; a is the influence parameter of the memory term; b is the step size; After iterating multiple times to eliminate the transient state, four independent chaotic sequences are generated .
9. A color image encryption device, characterized in that, It includes: A feature extraction module, which is used to obtain the plaintext image to be encrypted, extract the global image features of the plaintext image, and generate the internal key of the plaintext image based on the global image features; A parameter generation module, configured to obtain a random external key, and sequentially and complexly map the external key and the internal key from a key space to a parameter space, so as to obtain four groups of parameter sets for generating a chaotic sequence, where the parameter sets include control parameters , an initial value and ; A chaotic sequence generation module, configured to input four parameter sets into a preset PLS composite chaotic system to generate four independent chaotic sequences ; The first encryption module is used to encrypt the plaintext image based on the chaotic sequence and the chaotic sequence to obtain a semi-encrypted image; The second encryption module is used to generate a transformation matrix for joint encryption based on the chaotic sequence and the chaotic sequence to perform Arnold transformation on the semi-encrypted image based on the transformation matrix, realizing the joint encryption of the position and value of the plaintext image to obtain the corresponding ciphertext image.
10. The color image encryption device according to claim 9, wherein It also includes: The first decryption module is used to obtain the external key and the internal key corresponding to the ciphertext image and reconstruct four independent chaotic sequences when decrypting the ciphertext image. ; The second decryption module is used to perform an inverse Arnold transform on the ciphertext image based on the chaotic sequence and the chaotic sequence to obtain a semi-encrypted image; The third decryption module is used to, based on the chaotic sequence and the chaotic sequence , perform cyclic translation inverse transformation and random scrambling inverse transformation operations on the semi-encrypted image in sequence to obtain the corresponding plaintext image.
11. An electronic device, characterized in that, It includes: A processor, and a memory communicatively connected to the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by the processor, they are used to implement the method according to any one of claims 1 to 8.
13. A computer program product, characterized in that, It includes a computer program, and when the computer program is executed by the processor, it implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Image encryption method, computer equipment and computer readable storage medium
CN111461952A
Multispectral image encryption method and device, equipment and medium
CN119211441A