Image encryption and decryption method based on algebraic structure transformation

The image encryption method using algebraic structure transformation employs random indexing and cryptographic polynomials to scramble image pixels and encrypt grayscale values, solving the problems of low efficiency and insufficient security in existing technologies. It achieves efficient and secure image encryption and decryption, and is suitable for real-time processing and large-scale decryption of high-resolution images.

CN121151512BActive Publication Date: 2026-02-24SUZHOU CITY UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511685310.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-02-24
Estimated Expiration
2045-11-18

AI Technical Summary

Technical Problem

Existing image encryption technologies are inefficient and insecure when processing high-resolution images, making it difficult to meet real-time processing requirements. Furthermore, decryption algorithms require significant computational resources, making it difficult to improve computational efficiency and adaptability to various scenarios while ensuring security.

Method used

An image encryption method based on algebraic structure transformation is adopted. The pixels of the grayscale image are expanded into a one-dimensional sequence. By randomly scrambling the indexes and grouping them, an encryption polynomial is constructed to encrypt the pixel grayscale values. An invertible key polynomial is constructed under the modulo polynomial to generate the ciphertext sequence. The receiver recovers the original image through inverse operation.

Benefits of technology

It improves image encryption strength, destroys image spatial correlation, adapts to the real-time processing requirements of high-resolution images, achieves fully faithful image restoration, reduces computational load, and adapts to large-scale image decryption needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121151512B_ABST
    Figure CN121151512B_ABST
Patent Text Reader

Abstract

The application relates to the field of image encryption and decryption technology and discloses a method for image encryption and decryption based on algebraic structure transformation, which comprises the following steps: expanding the pixels of a gray image of a to-be-transmitted image into a one-dimensional sequence and performing random permutation to generate a random pixel sequence, dividing the random pixel sequence based on a preset grouping length, constructing a pixel polynomial, a modulus polynomial, a key polynomial and an encryption polynomial for each pixel group after the division, extracting coefficients in the encryption polynomial to form a ciphertext sequence, transmitting key-related parameters through a secret channel, transmitting the ciphertext through a public channel, reconstructing the modulus polynomial, the key polynomial and the encryption polynomial according to the key-related parameters at a receiving end, calculating an inverse element polynomial, performing decryption operation to restore the pixel polynomial and obtain a decryption sequence, and reconstructing the to-be-transmitted image. The application has double randomness of position permutation and gray value encryption, is high in operation efficiency and strong in security, and realizes lossless decryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image encryption and decryption technology, and in particular to an image encryption and decryption method based on algebraic structure transformation. Background Technology

[0002] In recent years, with the rapid development of the internet and information technology, digital images, as an important information carrier, have been widely used in industries such as manufacturing, healthcare, finance, and entertainment. However, digital images are highly vulnerable to unauthorized access, tampering, and theft during transmission and storage, posing serious security risks. Compared to traditional text information, digital images have larger data volumes, higher information redundancy, and more complex structures. Image data also exhibits high spatial correlation, making image security issues more complex. Therefore, image encryption technology has emerged and become one of the important directions in information security research.

[0003] Traditional encryption methods may face several challenges when dealing with image data encryption. For example, image data is large, and traditional encryption algorithms incur high computational costs and are inefficient when processing high-resolution images; images have significant pixel spatial correlations, making it difficult for encryption methods to effectively disrupt the statistical characteristics between pixels, thus allowing for partial cracking under certain attack modes; image encryption requires real-time processing, placing higher demands on the algorithm's rapid response.

[0004] To address the aforementioned issues, academia and industry have proposed various encryption methods tailored to image characteristics. Among these, image encryption methods based on chaotic systems have received widespread attention in recent years. Chaotic systems possess high initial value sensitivity, randomness, and unpredictability, making them highly suitable for scrambling image pixels and replacing grayscale values, thereby achieving effective image encryption. Typical methods include image scrambling algorithms based on Logistic mapping, Henon mapping, Arnold transform, and high-dimensional chaotic systems. These algorithms achieve high security and irreversibility by performing nonlinear transformations on two-dimensional or multi-dimensional pixels of the image. Furthermore, techniques such as block encryption, pixel-level encryption, and chunked encryption have also been proposed in different scenarios to balance encryption strength and computational efficiency.

[0005] In image decryption, research also emphasizes the accuracy and recovery quality of algorithms. Efficient decryption algorithms not only need to accurately recover the original image information but also achieve rapid processing with limited computing resources to meet the decryption needs of real-time transmission or large-scale image databases. Furthermore, with the development of deep learning technology, neural network-based image encryption and decryption methods have gradually emerged. These methods automatically learn image feature obfuscation and recovery strategies through model training, providing new ideas for traditional algorithms. However, deep learning neural network-based methods struggle to meet real-time requirements and have weak interpretability, failing to ensure the deterministic nature and verifiable security of the encryption logic. If there are biases in model training, image distortion is prone to occur during decryption, leading to image transmission failure.

[0006] In summary, although existing image encryption technologies have made significant progress, they still face numerous challenges. First, processing efficiency is low. Traditional encryption algorithms suffer from high computational overhead and low efficiency when processing high-resolution images due to the large volume and strong spatial correlation of digital image data, making it difficult to meet real-time processing requirements. Second, security is insufficient. Some encryption methods struggle to effectively disrupt the statistical characteristics between pixels, and may be partially cracked under common attack modes such as statistical attacks and known-plaintext attacks. Third, there are contradictions on the decryption end. Efficient decryption algorithms often fail to accurately recover the original image information or require substantial computational resources, making them unsuitable for real-time transmission or large-scale image database decryption needs. Furthermore, it is difficult to simultaneously improve computational efficiency, design highly robust algorithms, balance real-time performance with multi-scenario adaptability, and achieve efficient decryption while maintaining image quality, all while ensuring security. Summary of the Invention

[0007] Therefore, the technical problem to be solved by the present invention is to overcome the problems of low efficiency, insufficient security and inability to guarantee decryption security in the existing technology when encrypting and transmitting images.

[0008] To address the aforementioned technical problems, this invention provides an image encryption and decryption method based on algebraic structure transformation, applied to the sender, comprising:

[0009] Acquire a grayscale image of the image to be transmitted, and unfold the pixels in the grayscale image according to a preset direction to form a structure containing... A one-dimensional pixel sequence of pixels;

[0010] Based on a preset seed number, a random number generator is used to generate a number containing... A sequence of random permutation indices is used to randomly permutate a one-dimensional pixel sequence, generating a randomized pixel sequence.

[0011] Based on preset group length The randomized pixel sequence is divided into multiple pixel groups;

[0012] Based on the grayscale values ​​of all pixels in each pixel group, construct the encryption polynomial corresponding to each pixel group, including:

[0013] Construct a pixel polynomial by using the pixel grayscale value of each pixel in the pixel group as the coefficient of the independent variable of different powers;

[0014] Randomly select an integer as the highest order of the modular polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers to construct the modular polynomial;

[0015] Randomly select an integer as the highest order of the key polynomial, and randomly obtain multiple integers as coefficients of independent variables of different powers, to construct a key polynomial that is invertible under the modular polynomial; the highest order of the modular polynomial is not less than the sum of the preset group length and the highest order of the key polynomial minus 2.

[0016] The encryption polynomial is obtained by taking the modulo of the modulo polynomial based on the product of the pixel polynomial and the key polynomial.

[0017] In the encryption polynomial corresponding to each pixel group, sort them from high to low according to the power of the independent variable, and select the top... Each coefficient is used as the ciphertext for each encryption polynomial; the ciphertexts of the encryption polynomials corresponding to all pixel groups are combined sequentially to obtain the ciphertext sequence of the image to be transmitted.

[0018] The preset seed value, grayscale image size, coefficients of the key polynomial, coefficients of the modulo polynomial, and preset block length are transmitted to the receiver via a secure channel; the ciphertext sequence of the image to be transmitted is transmitted to the receiver via a public channel so that the receiver can reconstruct the image to be transmitted.

[0019] Preferably, the pixel grayscale value of each pixel in the pixel group is used as the coefficient of the independent variable of different powers to construct a pixel polynomial, expressed as:

[0020] ;

[0021] in, Represents the first pixel in the pixel group The pixel grayscale value of each pixel. , is the independent variable.

[0022] Preferably, an integer is randomly selected as the highest order of the modular polynomial, and multiple integers are randomly obtained and used as coefficients of the independent variables of different powers to construct the modular polynomial, expressed as:

[0023] ;

[0024] in, The first term randomly selected when constructing the modular polynomial. integers, , This represents the highest order of the modular polynomial.

[0025] Preferably, an integer is randomly selected as the highest order of the key polynomial, and multiple integers are randomly obtained as coefficients of independent variables of different powers, to construct an invertible key polynomial under the modular polynomial, expressed as:

[0026] ;

[0027] in, This indicates that the first key polynomial is randomly selected when constructing the key polynomial. integers, , This represents the highest order of the key polynomial.

[0028] Preferably, based on the product of the pixel polynomial and the key polynomial, the modulo of the modulo polynomial is taken to construct the encryption polynomial, which is expressed as:

[0029] ;

[0030] in, This indicates taking the modulus.

[0031] Preferably, based on a preset group length After dividing the randomized pixel sequence into multiple pixel groups, the method further includes: if the total number of pixels in the last pixel group is less than the preset group length, then zero padding is used to pad the total number of pixels in the last pixel group to the same as the preset group length.

[0032] Preferably, in the encryption polynomial corresponding to each pixel group, the polynomials are sorted from high to low according to the power of the independent variable, and the top power is selected. When using coefficients as ciphertext for each cryptographic polynomial, it also includes: selecting the first... Each coefficient is processed modulo P and then saved as encrypted text; P is the preset modulus.

[0033] This invention provides an image encryption and decryption method based on algebraic structure transformation, applied to the receiver, comprising:

[0034] The ciphertext sequence of the image to be transmitted, generated by the sender using the image encryption and decryption method based on algebraic structure transformation as described above, is obtained via a public channel.

[0035] The preset seed value, grayscale image size, coefficients of the key polynomial, coefficients of the modulo polynomial, and preset block length are obtained by the sender through a secure channel based on the image encryption and decryption method based on algebraic structure transformation as described above.

[0036] Based on a preset seed number, a random number generator is used to generate an index sequence identical to that of the sender;

[0037] Randomly select an integer as the highest order of the modular polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers to construct the modular polynomial; randomly select an integer as the highest order of the key polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers to construct the key polynomial that is invertible under the modular polynomial; obtain the inverse polynomial of the key polynomial under the modular polynomial.

[0038] Based on the ciphertext sequence and the preset block length, the coefficients of each encryption polynomial are obtained, and all encryption polynomials are restored one by one.

[0039] By multiplying each encryption polynomial by the inverse polynomial of its corresponding key polynomial and taking the modulus of its corresponding modulo polynomial, the pixel polynomial corresponding to the pixel group of each encryption polynomial can be restored.

[0040] Sort the independent variables in the pixel polynomial corresponding to each pixel group in descending order of power, and obtain the first... Each coefficient serves as the decryption sequence for each pixel group;

[0041] Obtain the decryption sequence of all pixel groups to form the decryption sequence of the image to be transmitted; perform an inverse swap operation on the decryption sequence using the index sequence to restore the one-dimensional pixel sequence;

[0042] The image to be transmitted is reconstructed based on the one-dimensional pixel sequence and the grayscale image size.

[0043] Preferably, the independent variables in the pixel polynomial corresponding to each pixel group are sorted from high to low according to their powers, and the first few are obtained. When using coefficients as the decryption sequence for each pixel group, it also includes: selecting the first... The coefficients are modulo P and then saved as a decryption sequence; P is the preset modulus.

[0044] Preferably, after obtaining the coefficients of each encryption polynomial based on the ciphertext sequence and the preset group length, the process includes taking the modulo of the sum of the maximum gray value of the grayscale image of the image to be transmitted and 1 for the encryption polynomial coefficients, and then restoring all the encryption polynomials one by one based on the moduloed coefficients.

[0045] Compared with the prior art, the above-described technical solution of the present invention has the following advantages:

[0046] The image encryption and decryption method based on algebraic structure transformation described in this invention, when the sender performs encryption, expands the grayscale image pixels of the image to be transmitted into a one-dimensional pixel sequence, generates random indices based on a random number generator driven by a preset seed value, and scrambles the one-dimensional pixel sequence to divide it into multiple pixel groups; simultaneously, the grayscale values ​​of the pixels in the pixel groups are encrypted, constructing an encryption polynomial to generate the ciphertext sequence of the image to be transmitted. This invention uses position scrambling and pixel grayscale value encryption, randomly shuffling the pixel order in terms of position through random indices, destroying the spatial correlation of the image, resisting known common attack techniques, and improving the image encryption strength; it uses pixel grayscale values ​​to construct an algebraic polynomial ring for encryption, and the key polynomial is invertible under the modulo polynomial, ensuring the uniqueness of the decryption result, so that the receiver can achieve a completely faithful image recovery; at the same time, pixel grouping by a preset group length reduces the amount of calculation per step, avoids complex iterations, greatly improves the processing speed, and is more suitable for the real-time processing requirements of high-resolution images.

[0047] The image encryption and decryption method based on algebraic structure transformation described in this invention, when the receiver performs decryption, first reconstructs the same index sequence, modular polynomial, and key polynomial as the sender based on a preset seed value, calculates the inverse polynomial of the key polynomial under the modular polynomial, then accurately recovers the pixel polynomial through inverse modular operation, and finally recovers the original one-dimensional pixel order through inverse permutation, and reconstructs the image to be transmitted based on the image size, achieving a completely faithful image recovery, improving the accuracy of encrypted image transmission, and the decryption process is symmetrical with the encryption process, requiring no additional large amount of computing resources, and adapting to large-scale image decryption needs.

[0048] This invention ensures that encryption and decryption are in the same operational domain by performing modulo P operations on the coefficients in the pixel polynomial, avoiding confusion, ensuring that all operational elements have a unique inverse, ensuring consistency in the decomposition and recombination process, further guaranteeing the reversibility of image encryption and decryption, and improving the accuracy of image transmission.

[0049] This invention moduloes the coefficients in the encryption polynomial with the sum of the maximum grayscale value of the grayscale image to be transmitted and 1, ensuring the accuracy of the grayscale value, ensuring that the grayscale value of the decrypted and recovered pixel falls within the valid value range, ensuring that the recovered pixel can be displayed normally, and ensuring consistency with the original pixel value, thus achieving a completely faithful image recovery. Attached Figure Description

[0050] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein:

[0051] Figure 1 This is a flowchart of the encryption steps at the sender in the image encryption and decryption method based on algebraic structure transformation of the present invention;

[0052] Figure 2 This is a flowchart of the decryption steps at the receiving end of the image encryption and decryption method based on algebraic structure transformation of the present invention;

[0053] Figure 3 It is a grayscale image of the image to be transmitted;

[0054] Figure 4 It is the encrypted image after the sender has encrypted the image to be transmitted;

[0055] Figure 5 It is the image to be transmitted that is decrypted and reconstructed by the receiver. Detailed Implementation

[0056] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.

[0057] Reference Figure 1 The flowchart shown illustrates the encryption steps of the image encryption and decryption method based on algebraic structure transformation of the present invention at the sender's end. The specific encryption steps at the sender's end include:

[0058] S101: Obtain the grayscale image of the image to be transmitted, and unfold the pixels in the grayscale image according to a preset direction to form a structure containing... A one-dimensional pixel sequence of pixels;

[0059] S102: Based on a preset seed number, use a random number generator to generate a number containing... A sequence of random permutation indices is used to randomly permutate a one-dimensional pixel sequence, generating a randomized pixel sequence.

[0060] S103: Based on preset group length The randomized pixel sequence is divided into multiple pixel groups;

[0061] S104: Based on the grayscale values ​​of all pixels in each pixel group, construct the encryption polynomial corresponding to each pixel group, including:

[0062] Using the grayscale value of each pixel in the pixel group as the coefficient of the independent variable of different powers, a pixel polynomial is constructed, which is expressed as: ;in, Represents the first pixel in the pixel group The pixel grayscale value of each pixel. , As the independent variable;

[0063] Randomly select an integer as the highest order of the modular polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers, constructing a modular polynomial, expressed as: ;in, The first term randomly selected when constructing the modular polynomial. integers, , This represents the highest order of the modular polynomial.

[0064] Randomly select an integer as the highest order of the key polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers, constructing an invertible key polynomial under the modular polynomial, expressed as: ;in, This indicates that the first key polynomial is randomly selected when constructing the key polynomial. integers, , The highest order of the key polynomial is indicated; the highest order of the modular polynomial is not less than the sum of the preset block length and the highest order of the key polynomial minus 2.

[0065] Based on the product of the pixel polynomial and the key polynomial, the modulo of the modulo polynomial is taken to obtain the encryption polynomial, which is expressed as: ;in, Indicates modulo;

[0066] S105: In the encryption polynomial corresponding to each pixel group, sort them from high to low according to the power of the independent variable, and select the top... Each coefficient is used as the ciphertext for each encryption polynomial; the ciphertexts of the encryption polynomials corresponding to all pixel groups are combined sequentially to obtain the ciphertext sequence of the image to be transmitted.

[0067] S106: Transmit the preset seed value, grayscale image size, coefficients of the key polynomial, coefficients of the modulo polynomial, and preset block length to the receiver via a secure channel; transmit the ciphertext sequence of the image to be transmitted to the receiver via a public channel so that the receiver can reconstruct the image to be transmitted.

[0068] The image encryption and decryption method based on algebraic structure transformation described in this invention, when the sender performs encryption, expands the grayscale image pixels of the image to be transmitted into a one-dimensional pixel sequence, generates random indices based on a random number generator driven by a preset seed value, and scrambles the one-dimensional pixel sequence to divide it into multiple pixel groups; simultaneously, the grayscale values ​​of the pixels in the pixel groups are encrypted, constructing an encryption polynomial to generate the ciphertext sequence of the image to be transmitted. This invention uses position scrambling and pixel grayscale value encryption, randomly shuffling the pixel order in terms of position through random indices, destroying the spatial correlation of the image, resisting known common attack techniques, and improving the image encryption strength; it uses pixel grayscale values ​​to construct an algebraic polynomial ring for encryption, and the key polynomial is invertible under the modulo polynomial, ensuring the uniqueness of the decryption result, so that the receiver can achieve a completely faithful image recovery; at the same time, pixel grouping by a preset group length reduces the amount of calculation per step, avoids complex iterations, greatly improves the processing speed, and is more suitable for the real-time processing requirements of high-resolution images.

[0069] Specifically, in this embodiment of the invention, based on a preset grouping length After dividing the randomized pixel sequence into multiple pixel groups, the method further includes: if the total number of pixels in the last pixel group is less than the preset group length, then zero padding is used to pad the total number of pixels in the last pixel group to the same as the preset group length.

[0070] Specifically, in this embodiment, using A random permutation index pair contains When a one-dimensional pixel sequence of pixels is randomly permuted, the pixel value at the nth position in the one-dimensional pixel sequence is replaced with the pixel value pointed to by the random permutation index at the nth position in the index sequence, forming a randomized pixel sequence. For example, if the index sequence is [3,0,4,1,2], then the 3rd pixel in the initial one-dimensional pixel sequence is placed at the 0th position of the randomized pixel sequence, the 0th pixel in the initial one-dimensional pixel sequence is placed at the 1st position of the randomized pixel sequence, and so on.

[0071] Specifically, in this embodiment of the invention, in the encryption polynomial corresponding to each pixel group, the polynomials are sorted from high to low according to the power of the independent variable, and the top power is selected. When using coefficients as ciphertext for each cryptographic polynomial, it also includes: selecting the first... The coefficients are processed modulo P and then saved as ciphertext; P is a preset modulus. This invention ensures that encryption and decryption are in the same operational domain by performing modulo P operations on the coefficients in the pixel polynomial, avoiding confusion, ensuring that all operational elements have a unique inverse, ensuring consistency in the decomposition and recombination process, further guaranteeing the reversibility of image encryption and decryption, and improving the accuracy of image transmission.

[0072] Based on the above embodiments, referring to Figure 2 The flowchart shown illustrates the decryption steps of the image encryption and decryption method based on algebraic structure transformation of the present invention at the receiving end. The specific decryption steps at the receiving end include:

[0073] S201: Obtain the ciphertext sequence of the image to be transmitted generated by the sender based on the image encryption and decryption method based on algebraic structure transformation as described above via a public channel;

[0074] S202: Obtain via a secure channel the preset seed value, grayscale image size, coefficients of the key polynomial, coefficients of the modulo polynomial, and preset block length generated by the sender based on the image encryption and decryption method based on algebraic structure transformation as described above;

[0075] S203: Based on a preset seed number, use a random number generator to generate an index sequence identical to that of the sender;

[0076] S204: Randomly select an integer as the highest order of the modular polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers, and construct the modular polynomial; randomly select an integer as the highest order of the key polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers, and construct the key polynomial that is invertible under the modular polynomial; obtain the inverse polynomial of the key polynomial under the modular polynomial.

[0077] S205: Based on the ciphertext sequence and the preset block length, obtain the coefficients of each encryption polynomial and restore all encryption polynomials one by one;

[0078] S206: By multiplying each encryption polynomial by the inverse polynomial of its corresponding key polynomial and taking the modulus of its corresponding modular polynomial, the pixel polynomial corresponding to the pixel group of each encryption polynomial is restored.

[0079] S207: Sort the independent variables in the pixel polynomial corresponding to each pixel group in descending order of power, and obtain the first... Each coefficient serves as the decryption sequence for each pixel group;

[0080] S208: Obtain the decryption sequence of all pixel groups to form the decryption sequence of the image to be transmitted; perform an inverse swap operation on the decryption sequence using the index sequence to restore the one-dimensional pixel sequence;

[0081] S209: Reconstruct the image to be transmitted based on the one-dimensional pixel sequence and grayscale image size.

[0082] The image encryption and decryption method based on algebraic structure transformation described in this invention, when the receiver performs decryption, first reconstructs the same index sequence, modular polynomial, and key polynomial as the sender based on a preset seed value, calculates the inverse polynomial of the key polynomial under the modular polynomial, then accurately recovers the pixel polynomial through inverse modular operation, and finally recovers the original one-dimensional pixel order through inverse permutation, and reconstructs the image to be transmitted based on the image size, achieving a completely faithful image recovery, improving the accuracy of encrypted image transmission, and the decryption process is symmetrical with the encryption process, requiring no additional large amount of computing resources, and adapting to large-scale image decryption needs.

[0083] Specifically, in this embodiment of the invention, the independent variables in the pixel polynomial corresponding to each pixel group are sorted from high to low according to their powers, and the first... When using coefficients as the decryption sequence for each pixel group, it also includes: selecting the first... The decryption sequence is saved after performing a modulo-P operation on the coefficients; P is a preset modulus. This invention ensures that encryption and decryption are in the same operational domain by performing a modulo-P operation on the coefficients in the pixel polynomial, avoiding confusion, ensuring that all operational elements have a unique inverse, ensuring consistency in the decomposition and recombination process, further guaranteeing the reversibility of image encryption and decryption, and improving the accuracy of image transmission.

[0084] Specifically, in this embodiment of the invention, after obtaining the coefficients of each encryption polynomial based on the ciphertext sequence and a preset group length, the process includes taking the modulo of the sum of the maximum grayscale value of the grayscale image of the image to be transmitted and 1 for the coefficients of the encryption polynomials. Based on the modulo-taken coefficients, all encryption polynomials are reconstructed one by one. This invention ensures the accuracy of grayscale values ​​by taking the modulo of the coefficients in the encryption polynomials with respect to the sum of the maximum grayscale value of the grayscale image of the image to be transmitted and 1, ensuring that the grayscale values ​​of the decrypted and recovered pixels fall within the valid value range, ensuring that the recovered pixels can be displayed normally, and simultaneously ensuring consistency with the original pixel values, thus achieving fully faithful image restoration.

[0085] This invention addresses the shortcomings of existing technologies by proposing an image encryption and decryption method based on algebraic structure transformation. The method involves randomly pairing and swapping the positions of the image to be encrypted, achieving position scrambling. Based on this, an algebraic polynomial ring method using key parameters is used to encrypt the scrambled pixel values. The encryption parameters are then transmitted through a secure channel. At the receiving end, the received key parameters and ciphertext are used to perform an inverse operation to obtain the plaintext. This method offers fast processing speed and good encryption effectiveness, and can be effectively applied to the encryption of various grayscale and color images. In this invention embodiment, the image encryption and decryption method based on algebraic structure transformation provided by this invention is used to encrypt and transmit the image to be transmitted. The specific steps include:

[0086] S301: Obtain the grayscale image of the image to be transmitted. ,

[0087] and For pixel coordinates, , , and This represents the pixel width and pixel height of a grayscale image, with a total number of pixels. Unfold the image pixels into a one-dimensional pixel sequence arranged in rows or columns, denoted as . Pixel number Given a prime number greater than the maximum grayscale value of the grayscale image. ;

[0088] In this embodiment, the image has 8 bits, a pixel grayscale value ranging from 0 to 255, and an image pixel size of [missing information]. and The total number of pixels is The image pixels are unfolded into a one-dimensional pixel sequence arranged in rows, denoted as . Pixel number Given a prime number greater than the maximum grayscale value of the grayscale image. ;

[0089] S302: Preset seed value A random number generator is used to generate an integer sequence as a random permutation index sequence, and the pixel sequence is then processed based on the values ​​of the random permutation index sequence. Perform random permutations to generate a randomized pixel sequence. ;

[0090] S303: Preset group length This involves encrypting groups of three pixels together, thus scrambling the pixel sequence. After dividing the pixel into 87381 groups, there is one pixel left that is not enough to form a new pixel group, so two zeros are added to align the groups, resulting in a total of 87382 pixel groups.

[0091] Wherein, group length It can be adaptively selected based on image size and security requirements;

[0092] S304: Construct the pixel polynomial corresponding to each pixel group, expressed as:

[0093] ;

[0094] in, The ordinal number of the pixel grayscale value in each pixel group. This represents the grayscale value of the corresponding pixel. is the independent variable in the polynomial;

[0095] S305: Construct the modulo polynomial for each pixel group, expressed as:

[0096] ;

[0097] in, for The power of is also the subscript number of the coefficient; the highest order of the polynomial is . Integers drawn from a random number sequence These are used as coefficients for different powers;

[0098] S306: Construct the key polynomial for each pixel group, expressed as:

[0099] ;

[0100] in, The power of the polynomial is , and the highest order of the polynomial is . Integers drawn from a random number sequence These serve as coefficients corresponding to different powers;

[0101] Furthermore, the key polynomial must be an invertible polynomial in the modular polynomial; otherwise, the coefficients are reselected to reconstruct the key polynomial until the key polynomial is invertible in the modular polynomial.

[0102] The highest order of both the modular polynomial and the key polynomial is a positive integer randomly selected by the sender during encryption. Based on the selected highest order, a corresponding number of random numbers are then randomly selected as the coefficients of each term of the polynomial.

[0103] in, middle The highest power is not less than the length of the input pixel group. With key polynomial The sum of the highest powers minus 2; key polynomial For in the modular polynomial The modulo polynomial is invertible; in this embodiment, the highest power of the independent variable in the modulo polynomial is 3, which is not less than the sum of the length of the input pixel group 3 and the highest power of the key polynomial 2 minus 2. Therefore, it meets the requirements to ensure that the receiver obtains a unique decryption result during decryption.

[0104] S307: Based on the pixel polynomial of the pixel group With key polynomial The product of the modulo polynomial Modulo operation is used to construct the cryptographic polynomial corresponding to the pixel group. , is represented as:

[0105] ;

[0106] in, This represents the modulo operation; for example, the gray values ​​of the 20,000th pixel group in the image are respectively ,but Further calculations are performed to obtain the encrypted polynomial;

[0107] S308: Sort the terms of the encrypted polynomial corresponding to each pixel group in descending order of the power of the independent variable, and then take the first 3 terms in descending order of the power to obtain the polynomial. The coefficients of this polynomial are used as the encrypted pixel grayscale values;

[0108] Perform the same operation on each pixel group, combine the results sequentially, and obtain the ciphertext sequence. ;

[0109] S309: Set the seed value (seed) and image dimensions. and Key polynomial coefficients, modulus polynomial coefficients, group length Transmitted to the receiver via a secure channel; the ciphertext sequence Transmitted to the recipient via a public channel;

[0110] S310: The receiver, based on the received seed value, generates the same random integer sequence as the sender using the same random number generator, reconstructs the key polynomial and the modular polynomial, and calculates the inverse of the key polynomial in the modular polynomial. ;

[0111] S311: Based on the ciphertext sequence With group length Each pixel group is then constructed with its corresponding cryptographic polynomial.

[0112] S312: Based on the product of the inverses of the encryption polynomial and the key polynomial in the modulo polynomial, the modulo of the modulo polynomial is taken to decrypt the pixel polynomial, which is then expressed as:

[0113] ;

[0114] S313: Will The terms in the algorithm are arranged in descending order of the power of the independent variable. Then, the three coefficients of the highest order are taken, and the same operation is performed on each pixel group to obtain the decryption sequence. ;

[0115] S314: Decrypt the sequence according to the random permutation index. Perform an inverse swap operation on the pixel sequence to recover the original pixel sequence. ;

[0116] S315: Based on image size and From the original pixel sequence The two-dimensional image is reconstructed from the image to be transmitted, thus completing the decryption of the image to be transmitted.

[0117] Since the decryption result may be greater than the maximum grayscale value of the image, but the modulus value is the same as the true value, modulo is used. Here, the maximum grayscale value of the image can be taken plus 1. Because this embodiment assumes the image is 8 bits, the pixel polynomial is adjusted during the decryption process. The coefficients are modulo 256.

[0118] In steps S308 and S313 of this embodiment, the coefficients obtained are all modulo p before being saved. Decryption also requires modulo p to ensure that encryption and decryption are in the same operational domain, avoiding confusion, ensuring that all operands have a unique inverse, and guaranteeing consistency in the decomposition and recombination process. Without modulo p, decryption will fail or result in an error. For example, assuming p = 101, pixel value = 89, the encryption operation C = (89 * 7) mod 101; if decryption is also modulo 101, then the inverse of 7 = 29 modulo 101, resulting in (17 * 29) mod 101 = 89, which is correct. If modulo 100 or other numbers are used, decryption will still fail. For example, the inverse of 7 = 43 modulo 100, resulting in (17 * 43) mod 100 = 31, will not yield a correct decryption result.

[0119] Reference Figure 3 The image shown is a grayscale image of the image to be transmitted; refer to... Figure 4 The image shown is the encrypted image after the sender has encrypted the image to be transmitted; refer to... Figure 5 As shown, this is the image to be transmitted decrypted and reconstructed by the receiver. The method proposed in this invention has a fast calculation speed and performs random shuffling of both position and pixel grayscale values, resulting in good confidentiality and resistance to known common attack techniques. At the same time, it can achieve fully faithful image restoration by the decryptor.

[0120] The image encryption and decryption method based on algebraic structure transformation described in this invention, when the sender performs encryption, expands the grayscale image pixels of the image to be transmitted into a one-dimensional pixel sequence, generates random indices based on a random number generator driven by a preset seed value, and scrambles the one-dimensional pixel sequence to divide it into multiple pixel groups; simultaneously, the grayscale values ​​of the pixels in the pixel groups are encrypted, constructing an encryption polynomial to generate the ciphertext sequence of the image to be transmitted. This invention uses position scrambling and pixel grayscale value encryption, randomly shuffling the pixel order in terms of position through random indices, destroying the spatial correlation of the image, resisting known common attack techniques, and improving the image encryption strength; it uses pixel grayscale values ​​to construct an algebraic polynomial ring for encryption, and the key polynomial is invertible under the modulo polynomial, ensuring the uniqueness of the decryption result, so that the receiver can achieve a completely faithful image recovery; at the same time, pixel grouping by a preset group length reduces the amount of calculation per step, avoids complex iterations, greatly improves the processing speed, and is more suitable for the real-time processing requirements of high-resolution images. The image encryption and decryption method based on algebraic structure transformation described in this invention, when the receiver performs decryption, first reconstructs the same index sequence, modular polynomial, and key polynomial as the sender based on a preset seed value, calculates the inverse polynomial of the key polynomial under the modular polynomial, then accurately recovers the pixel polynomial through inverse modular operation, and finally recovers the original one-dimensional pixel order through inverse permutation, and reconstructs the image to be transmitted based on the image size, achieving a completely faithful image recovery, improving the accuracy of encrypted image transmission, and the decryption process is symmetrical with the encryption process, requiring no additional large amount of computing resources, and adapting to large-scale image decryption needs.

[0121] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0122] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.

[0123] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0124] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0125] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1. A method for image encryption and decryption based on algebraic structure transformation, characterized in that, Applied to the sender, including: Acquire a grayscale image of the image to be transmitted, and unfold the pixels in the grayscale image according to a preset direction to form a structure containing... A one-dimensional pixel sequence of pixels; Based on a preset seed number, a random number generator is used to generate a number containing... A sequence of random permutation indices is used to randomly permutate a one-dimensional pixel sequence, generating a randomized pixel sequence. Based on preset group length The randomized pixel sequence is divided into multiple pixel groups; Based on the grayscale values ​​of all pixels in each pixel group, construct the encryption polynomial corresponding to each pixel group, including: Construct a pixel polynomial by using the pixel grayscale value of each pixel in the pixel group as the coefficient of the independent variable of different powers; Randomly select an integer as the highest order of the modular polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers to construct the modular polynomial; Randomly select an integer as the highest order of the key polynomial, and randomly obtain multiple integers as coefficients of independent variables of different powers, to construct a key polynomial that is invertible under the modular polynomial; the highest order of the modular polynomial is not less than the sum of the preset group length and the highest order of the key polynomial minus 2. The encryption polynomial is obtained by taking the modulo of the modulo polynomial based on the product of the pixel polynomial and the key polynomial. In the encryption polynomial corresponding to each pixel group, sort them from high to low according to the power of the independent variable, and select the top... Each coefficient is used as the ciphertext for each encryption polynomial; the ciphertexts of the encryption polynomials corresponding to all pixel groups are combined sequentially to obtain the ciphertext sequence of the image to be transmitted. The preset seed value, grayscale image size, coefficients of the key polynomial, coefficients of the modulo polynomial, and preset block length are transmitted to the receiver via a secure channel; the ciphertext sequence of the image to be transmitted is transmitted to the receiver via a public channel so that the receiver can reconstruct the image to be transmitted.

2. The image encryption and decryption method based on algebraic structure transformation according to claim 1, characterized in that, Using the grayscale value of each pixel in the pixel group as the coefficient of the independent variable of different powers, a pixel polynomial is constructed, which is expressed as: ; in, Represents the first pixel in the pixel group The pixel grayscale value of each pixel. , is the independent variable.

3. The image encryption and decryption method based on algebraic structure transformation according to claim 2, characterized in that, Randomly select an integer as the highest order of the modular polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers, constructing a modular polynomial, expressed as: ; in, The first term randomly selected when constructing the modular polynomial. integers, , This represents the highest order of the modular polynomial.

4. The image encryption and decryption method based on algebraic structure transformation according to claim 3, characterized in that, Randomly select an integer as the highest order of the key polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers, constructing an invertible key polynomial under the modular polynomial, expressed as: ; in, This indicates that the first key polynomial is randomly selected when constructing the key polynomial. integers, , This represents the highest order of the key polynomial.

5. The image encryption and decryption method based on algebraic structure transformation according to claim 4, characterized in that, Based on the product of the pixel polynomial and the key polynomial, and taking the modulo of the modulo polynomial, an encryption polynomial is constructed, expressed as: ; in, This indicates taking the modulus.

6. The image encryption and decryption method based on algebraic structure transformation according to claim 1, characterized in that, Based on preset group length After dividing the randomized pixel sequence into multiple pixel groups, the method further includes: if the total number of pixels in the last pixel group is less than the preset group length, then zero padding is used to pad the total number of pixels in the last pixel group to the same as the preset group length.

7. The image encryption and decryption method based on algebraic structure transformation according to claim 1, characterized in that, In the encryption polynomial corresponding to each pixel group, sort them from high to low according to the power of the independent variable, and select the top... When using coefficients as ciphertext for each cryptographic polynomial, it also includes: selecting the first... Each coefficient is processed modulo P and then saved as encrypted text; P is the preset modulus.

8. A method for image encryption and decryption based on algebraic structure transformation, characterized in that, Applied to the recipient, including: The ciphertext sequence of the image to be transmitted, generated by the sender based on the algebraic structure transformation image encryption and decryption method as described in any one of claims 1 to 7, is obtained via a public channel. The sender obtains, via a secure channel, a preset seed value, grayscale image size, coefficients of the key polynomial, coefficients of the modulo polynomial, and preset block length generated by the image encryption and decryption method based on algebraic structure transformation as described in any one of claims 1 to 7 above; Based on a preset seed number, a random number generator is used to generate an index sequence identical to that of the sender; Randomly select an integer as the highest order of the modular polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers to construct the modular polynomial; randomly select an integer as the highest order of the key polynomial, and randomly obtain multiple integers as coefficients of the independent variables of different powers to construct the key polynomial that is invertible under the modular polynomial; obtain the inverse polynomial of the key polynomial under the modular polynomial. Based on the ciphertext sequence and the preset block length, the coefficients of each encryption polynomial are obtained, and all encryption polynomials are restored one by one. By multiplying each encryption polynomial by the inverse polynomial of its corresponding key polynomial and taking the modulus of its corresponding modulo polynomial, the pixel polynomial corresponding to the pixel group of each encryption polynomial can be restored. Sort the independent variables in the pixel polynomial corresponding to each pixel group in descending order of power, and obtain the first... Each coefficient serves as the decryption sequence for each pixel group; Obtain the decryption sequence of all pixel groups to form the decryption sequence of the image to be transmitted; perform an inverse swap operation on the decryption sequence using the index sequence to restore the one-dimensional pixel sequence; The image to be transmitted is reconstructed based on the one-dimensional pixel sequence and the grayscale image size.

9. The image encryption and decryption method based on algebraic structure transformation according to claim 8, characterized in that, Sort the independent variables in the pixel polynomial corresponding to each pixel group in descending order of power, and obtain the first... When using coefficients as the decryption sequence for each pixel group, it also includes: selecting the first... The coefficients are modulo P and then saved as a decryption sequence; P is the preset modulus.

10. The image encryption and decryption method based on algebraic structure transformation according to claim 8, characterized in that, Based on the ciphertext sequence and the preset group length, after obtaining the coefficients of each encryption polynomial, the process includes taking the modulo of the sum of the maximum gray value of the grayscale image of the image to be transmitted and 1, and then reconstructing all the encryption polynomials one by one based on the moduloed coefficients.

Citation Information

Patent Citations

  • Image block encryption and decryption algorithm based on fusion of hyperchaotic system and neural network mechanism

    CN113468562A

  • Image self-decryption method based on hyperchaotic system

    CN113612596A