Optical image asymmetric encryption and decryption method based on non-negative matrix factorization
By combining a two-stage encryption mechanism of dual random phase coding and non-negative matrix factorization, an asymmetric optical image encryption method is constructed, which solves the vulnerability of existing technologies to various attacks and achieves efficient and secure image encryption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TIANJIN NORMAL UNIVERSITY
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-17
AI Technical Summary
Existing optical image encryption technologies are vulnerable to known-plaintext attacks, chosen-plaintext attacks, and special attacks, making it difficult to achieve both high-efficiency encryption and security simultaneously.
By combining dual random phase coding (DRPE) and nonnegative matrix factorization (NMF), an asymmetric key is generated through a two-stage encryption mechanism. The random phase template and optical system parameters are used as auxiliary keys to encrypt the image.
It has excellent resistance to attacks such as cropping, noise, known plaintext, selected plaintext, and special attacks, achieving efficient image encryption while improving security.
Smart Images

Figure CN121397156B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image encryption, and more specifically to an asymmetric encryption and decryption method for optical images based on nonnegative matrix factorization. Background Technology
[0002] With the rapid development of digital information technology, the security of images, as an important carrier of information, during transmission and storage has become increasingly prominent. Unlike traditional data encryption, image data is characterized by large data volume, high redundancy, and strong correlation between adjacent pixels. This makes many classic algorithms suitable for text encryption inefficient or insecure in image encryption. Therefore, encryption technologies specifically designed for images have emerged. Among them, the optical information processing-based approach has attracted much attention due to its high parallelism, high speed, and design freedom. This type of technology typically uses the physical parameters of light (such as phase and amplitude) as keys, encoding and perturbing the image in the spatial, frequency, or mixed domains through analog or digital methods, thereby encrypting the original image into static noise-like ciphertext to achieve effective confidentiality.
[0003] The core design of optical image encryption systems has always revolved around the balance between security and practicality. Early optical encryption systems, represented by Double Random Phase Coding (DRPE) and its variants, laid the technological foundation for this field. However, with the development of cryptanalysis, the vulnerabilities of these systems have gradually been exposed. Research has found that linear, symmetric encryption structures can be effectively cracked by modern cryptanalysis techniques such as Known Plaintext Attacks (KPA) and Choose-Plaintext Attacks (CPA). To improve security, researchers have turned to asymmetric encryption schemes, utilizing the irreversibility of optical processes (such as phase truncation operations) to construct public-private key pairs. While this has provided some protection against traditional attacks, new "special attacks" targeting specific algorithmic mathematical principles have emerged, posing new security challenges to these asymmetric systems. Therefore, the key issue that urgently needs to be addressed in the field of optical encryption is: how to construct a new asymmetric encryption framework that can simultaneously resist both traditional KPA / CPA and novel special attacks. Summary of the Invention
[0004] To address the security challenges of existing optical encryption technologies, this invention proposes an asymmetric image encryption method based on nonnegative matrix factorization (NMF). Existing systems based on dual random phase coding (DRPE) are vulnerable to known-plaintext and chosen-plaintext attacks, while asymmetric systems based on phase truncation are also difficult to defend against special attacks.
[0005] To address these shortcomings, this invention constructs a two-stage encryption mechanism combining DRPE and NMF. The method first performs an optical transformation on the original image using dual random phase coding to generate intermediate ciphertext; then, NMF is introduced to further decompose and encode the result, outputting the final ciphertext and generating the asymmetric key required for decryption. Throughout the process, the random phase template and optical system parameters can both serve as auxiliary keys. This scheme achieves efficient image encryption while possessing the ability to resist various attacks, including cropping, noise, known plaintext, chosen plaintext, and special attacks, thus achieving a good balance between security and practicality.
[0006] To achieve the above objectives, this invention provides an asymmetric encryption method for optical images based on nonnegative matrix factorization, comprising the following steps:
[0007] S1. Based on the original image and the first random phase mask, a preliminary encryption result is generated through the first optical transformation;
[0008] S2. Based on the preliminary encryption result and the second random phase mask, generate an encryption result through a second optical transformation;
[0009] S3. Perform non-negative matrix decomposition on the encryption result to generate an image matrix and a coefficient matrix;
[0010] S4. Use the coefficient matrix as ciphertext and the image matrix as the private key to complete image encryption.
[0011] Preferably, in step S1, the method for generating the preliminary encryption result includes:
[0012] The image to be encrypted is compared with a random phase mask. The images are multiplied and modulated, then encrypted in the fractional Fourier transform domain based on DRPE technology to obtain the preliminary encryption result corresponding to image f. :
[0013] ;
[0014] in, , i represents the imaginary unit, rand represents the operation of randomly generating an image of size M*N, where M and N represent the horizontal and vertical pixel values of the image; This represents the fractional Fourier transform; α1 and β1 are the parameters of the fractional Fourier transform.
[0015] Preferably, in step S2, the method for generating the encryption result includes:
[0016] The initial encryption result The signal is modulated by multiplying it with the second random phase mask RPM2, and then the encrypted result g is obtained by fractional Fourier transform:
[0017] ;
[0018] in, α2 and β2 are the parameters of the fractional Fourier transform.
[0019] Preferably, in step S3, the method for generating the image matrix and the coefficient matrix includes: decomposing the encryption result g into an image matrix W and a coefficient matrix H through NMF decomposition.
[0020] ;
[0021] Where r represents the rank of the NMF decomposition, i.e. the number of base images.
[0022] Preferably, in step S4, the obtained coefficient matrix H is saved as the final encryption result. The image matrix W is stored as a private key. :
[0023] ;
[0024] .
[0025] This invention also provides an asymmetric decryption method for optical images based on nonnegative matrix factorization. The decryption method is used to decrypt images encrypted by the aforementioned encryption method, characterized by the following steps:
[0026] T1. Based on the ciphertext and the private key, generate a preliminary decryption result through inverse nonnegative matrix factorization;
[0027] T2. Based on the preliminary decryption result, an intermediate decryption result is generated by using the conjugate plate of the first inverse optical transformation and the second random phase mask;
[0028] T3. Based on the intermediate decryption result, the final decrypted image is generated by the second inverse optical transformation and the conjugate plate of the first random phase mask.
[0029] Preferably, the method for generating preliminary decryption results includes: firstly, through the ciphertext... and private key The preliminary decryption result G is obtained by performing inverse NMF decomposition and recovery:
[0030] ;
[0031] INMF represents inverse NMF decomposition.
[0032] Preferably, the method for generating intermediate decryption results includes: taking the preliminary decryption result G through an inverse fractional Fourier transform and then combining it with the conjugate plate of RPM2. Multiply and modulate to obtain the decrypted result. :
[0033] ;
[0034] in, The conjugate plate representing RPM2, and .
[0035] Preferably, the method for generating the final decrypted image includes:
[0036] Decryption result The conjugate plate of RPM1 after undergoing inverse fractional Fourier transform again Multiply and modulate to obtain the final decrypted result F:
[0037] ;
[0038] in, The conjugate plate representing RPM1, and .
[0039] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0040] The main benefit of this invention lies in its enhanced security. Compared to existing dual random phase coding (DRPE) algorithms and asymmetric encryption algorithms based on phase truncation, this research focuses on the encryption method's resistance to noise attacks, shearing attacks, selected plaintext and known plaintext attacks, and special attacks. To this end, we construct an encryption module based on an asymmetric optical system and propose an optical asymmetric image encryption method with nonnegative matrix factorization (NMF) as its core. Its advantages are as follows:
[0041] (1) It can resist shearing attacks and noise attacks to a certain extent;
[0042] (2) Compared with the symmetric system composed of double random phase coding, this method has better defense against chosen plaintext attacks and known plaintext attacks;
[0043] (3) Compared with widely used phase-truncation asymmetric encryption systems, this method also has resistance to specific types of special attacks;
[0044] (4) The proposed image encryption framework is scalable and can be further applied to asymmetric encryption of audio data. Attached Figure Description
[0045] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 A schematic diagram of the encryption principle provided by this invention;
[0047] Figure 2 A schematic diagram illustrating the decryption principle provided by this invention;
[0048] Figure 3 The input consists of an original grayscale image to be encrypted, the encrypted result, and the decrypted result; among which, Figure 3 In the image, (a) is the original grayscale image; (b) is the encrypted result; and (c) is the decrypted result.
[0049] Figure 4 The histogram distributions of the original and encrypted images are shown; where, Figure 4 In the image, (a) represents the histogram distribution of the original image; (b) represents the histogram distribution of the encrypted image.
[0050] Figure 5 For different key cases from Figure 3 The image decrypted in (b) of the image; where, Figure 5 In the diagram, (a) is the decryption result when the key RMP1 is incorrect; (b) is the decryption result when the key RMP2 is incorrect; (c) is the decryption result when the key α1 is incorrect; (d) is the decryption result when the key α2 is incorrect; (e) is the decryption result when the key β1 is incorrect; and (f) is the decryption result when the key β2 is incorrect.
[0051] Figure 6 This is a decrypted image under conditions of a shearing attack; where, Figure 6 (a) is an encrypted image subjected to a 1 / 16 cut attack; (b) is the result decrypted from (a); (c) is an encrypted image subjected to a 1 / 4 cut attack; (d) is the result decrypted from (a). Figure 6 The result decrypted in (c) of the document;
[0052] Figure 7 The image is decrypted under conditions of Gaussian noise attack; where, Figure 7 (a) shows the decryption result when attacked by 0.01 times Gaussian noise; (b) shows the decryption result when attacked by 0.05 times Gaussian noise; (c) shows the decryption result when attacked by 0.1 times Gaussian noise; and (d) shows the decryption result when attacked by 0.2 times Gaussian noise.
[0053] Figure 8 These are pseudo-plaintext images and decrypted images under chosen-plaintext attacks; among them, Figure 8 In the image, (a) is the pseudo-plaintext image; (b) is the decryption result obtained by using the pseudo-key.
[0054] Figure 9 This refers to the specific attack results against the encryption method designed in this invention; wherein, Figure 9 In the image, (a) is the image recovered after 100 iterations; (b) is a graph showing the correlation coefficient between the decrypted image recovered through a special attack and the original image as a function of the number of iterations. Detailed Implementation
[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0056] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0057] Example 1:
[0058] This embodiment provides an asymmetric encryption method for optical images based on nonnegative matrix factorization, the steps of which include:
[0059] S1. Based on the original image and the first random phase mask, generate a preliminary encryption result through a first optical transformation.
[0060] Assuming the image f to be encrypted is a grayscale image of size M×N pixels, the grayscale image is first modulated by multiplying it with a random phase mask RPM1. Then, encryption is performed in the fractional Fourier transform domain based on the DRPE technique to obtain the preliminary encryption result corresponding to image f. :
[0061] ;
[0062] in, , i represents the imaginary unit, rand represents the operation of randomly generating an image of size M*N, where M and N represent the horizontal and vertical pixel values of the image; This represents the fractional Fourier transform; α1 and β1 are the parameters of the fractional Fourier transform.
[0063] S2. Based on the preliminary encryption result and the second random phase mask, generate the encryption result through the second optical transformation.
[0064] The initial encryption result Modulation is performed by multiplying with the second random phase mask RPM2, and then the result g is encrypted by fractional Fourier transform:
[0065] ;
[0066] in, α2 and β2 are the parameters of the fractional Fourier transform.
[0067] S3. Perform non-negative matrix decomposition on the encryption result to generate an image matrix and a coefficient matrix.
[0068] The encrypted result g is decomposed into an image matrix W and a coefficient matrix H using NMF decomposition:
[0069] ;
[0070] Where r represents the rank of the NMF decomposition, i.e. the number of base images.
[0071] S4. Use the coefficient matrix as the ciphertext and the image matrix as the private key to complete the image encryption.
[0072] The obtained coefficient matrix H is saved as the final encryption result. The image matrix W is stored as a private key. :
[0073] ;
[0074] .
[0075] Two random phase masks, RPM1 and RPM2, are used in the encryption process. The parameters α1, β1, α2, and β2 of the fractional Fourier transform are used. The image matrix W generated during the encryption process can be used as the decryption key to decrypt the image.
[0076] The encryption process in this embodiment is as follows: Figure 1 As shown, Figure 1 In this example, OT represents optical transformation, and the fractional Fourier transform (FrFT) is used.
[0077] Example 2:
[0078] This embodiment also provides a decryption method for decrypting an image encrypted using the method of Embodiment 1. The steps include:
[0079] T1. Based on the ciphertext and private key, generate the preliminary decryption result through inverse nonnegative matrix factorization.
[0080] Decryption begins with the ciphertext. and private key Preliminary result G was obtained by inverse NMF decomposition and recovery:
[0081] .
[0082] INMF represents inverse NMF decomposition.
[0083] T2. Based on the preliminary decryption results, intermediate decryption results are generated through the conjugate of the first inverse optical transformation and the second random phase mask.
[0084] The initial decryption result G is then subjected to an inverse fractional Fourier transform and compared with the conjugate plate of RPM2. Multiply and modulate to obtain the decrypted result. :
[0085] ;
[0086] in, The conjugate plate representing RPM2, and .
[0087] T3. Based on the intermediate decryption results, the final decrypted image is generated through the conjugate of the second inverse optical transformation and the first random phase mask.
[0088] Decryption result The conjugate plate of RPM1 after undergoing inverse fractional Fourier transform again Multiply and modulate to obtain the final decrypted result F:
[0089] ;
[0090] in, The conjugate plate representing RPM1, and The decryption process in this embodiment is as follows: Figure 2 As shown in the figure Representing inverse optical transformation, the inverse fractional Fourier transform is used in this invention.
[0091] Example 3:
[0092] like Figure 3 As shown in (a), the original image to be encrypted is processed by the encryption algorithm proposed in this paper to obtain the corresponding grayscale encrypted image, as shown in Figure 1. Figure 3 (b) in the middle. From Figure 3 As shown in (b), the original image information has been fully hidden after encryption. Provided the keys are all correct and there has been no attack, the encrypted image can be completely decrypted, recovering an image that is completely identical to the original image, such as... Figure 3As shown in (c) above. The correlation coefficient between the decrypted image and the original image is calculated to be 1, indicating that the encryption system proposed in this paper can effectively achieve secure encryption and lossless restoration of images, and that the encryption and decryption of images are successful.
[0093] Figure 4 (a) in the original text is the original text. Figure 3 The histogram distribution of (a) in the data. Figure 4 (b) in the text is the encrypted version. Figure 3 The histogram distribution in (b) is shown. By comparison, it can be seen that the peak values and histogram distributions of the ciphertext and the original image are completely different. Therefore, it is impossible to obtain any useful information about the original image by analyzing the histogram distribution of the ciphertext.
[0094] Furthermore, when one key is incorrect while the others are correct, the decryption result of the color image is as follows: Figure 5 As shown in (a)-(f) of the diagram, the correlation coefficients between the decrypted image and the attacked original image are calculated to be 0.1004, 0.2009, 0.3253, 0.3264, 0.1550, and 0.1669, respectively. Therefore, the security of this encryption system can be guaranteed.
[0095] Figure 6 (a) and Figure 6 (c) shows the ciphertext images after 1 / 16 and 1 / 4 shear attacks, respectively, and the corresponding decryption results are as follows: Figure 6 (b) and Figure 6 As shown in (d) in the figure, the cut area is marked for easy identification. The decrypted image shows that although some noise interference appears in the image after the cut attack, the main information of the image can still be distinguished. The correlation coefficients between the decrypted image and the original image under the two attack scenarios are calculated to be 0.9998 and 0.9943, respectively. The above results demonstrate that the encryption method proposed in this invention has good resistance to cut attacks.
[0096] Figure 7 The image shows the decrypted images obtained after being subjected to speckle random noise interference under different noise intensity coefficients. Figure 7 (a) to Figure 7In the diagram, (d) corresponds to decryption results with noise intensity coefficients of 0.01, 0.05, 0.1, and 0.2, respectively. Based on this information, it can be concluded that as noise intensity increases, the interference to the decrypted image gradually intensifies, and the image quality decreases accordingly. Nevertheless, the main information of the original content can still be identified in each image. Further quantitative evaluation using correlation coefficients shows that the values between the decrypted image and the attacked original image are 0.9221, 0.8474, 0.8278, and 0.7833, respectively. The results indicate that even under noise interference, the encryption method proposed in this invention can effectively recover image information and possesses a certain degree of resistance to noise attacks.
[0097] Therefore, even if the encrypted image is heavily contaminated by noise or some information is missing, the present invention can still decrypt the original image that can be identified, verifying the feasibility of the system and meeting various needs in practical applications.
[0098] Figure 8 To select the results of the plaintext attack test. Assume the attacker already knows the ciphertext and the entire encryption process. The attacker encrypts pseudo-plaintext (pseudo-plaintext is...). Figure 8 (a) Obtains a fake key. The attacker then uses the fake key to decrypt the ciphertext (the ciphertext is...). Figure 3 (b) in the image above), the decrypted image is as follows: Figure 8 As shown in (b) of the image. It can be seen from the attack that the decrypted image does not contain the original image that was attacked (the original image is...). Figure 3 The decrypted image contains no information in (a) of the image. By calculation, the correlation coefficient between the decrypted image and the original image under attack is 0.0010, proving that the encryption method can resist chosen-plaintext attacks.
[0099] Figure 9 The results of a specific attack test against the encryption method presented in this study are shown. In this test, the number of attack iterations was set to 100. Figure 9 Image (a) is the image recovered after a special attack. Figure 9 Figure (b) shows the curve of the correlation coefficient between the restored image and the original image as a function of the number of iterations.
[0100] The results show that even after 100 iterations of the attack, the recovered image still cannot identify any information related to the original image. Meanwhile... Figure 9 Figure (b) shows that the correlation coefficient gradually converges and stabilizes at around 0.0031 as the iterations proceed, indicating that there is almost no statistical correlation between the restored image and the original image. The stabilization of the coefficient also suggests that further increasing the number of iterations does not improve the restoration effect. These results consistently demonstrate that the encryption method proposed in this invention has good resistance to special attacks based on iterative restoration.
[0101] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0102] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. An asymmetric encryption method for optical images based on nonnegative matrix factorization, characterized in that the steps are as follows: include: S1. Based on the original image and the first random phase mask, a preliminary encryption result is generated through the first optical transformation; S2. Based on the preliminary encryption result and the second random phase mask, generate an encryption result through a second optical transformation; S3. Perform non-negative matrix decomposition on the encryption result to generate an image matrix and a coefficient matrix; S4. Use the coefficient matrix as ciphertext and the image matrix as the private key to complete image encryption.
2. The optical image asymmetric encryption method based on nonnegative matrix factorization according to claim 1, characterized in that, In step S1, the method for generating the preliminary encryption result includes: The image to be encrypted is compared with a random phase mask. The images are modulated by multiplication and then encrypted in the fractional Fourier transform domain based on DRPE technology to obtain the final image. f Corresponding preliminary encryption results : ; in, , i Represents the imaginary unit. rand M represents random generation Image operations of size N, M , N Represents the horizontal and vertical pixel values of an image; Represents the fractional Fourier transform; α 1 and β1 represents the parameters of the fractional Fourier transform.
3. The optical image asymmetric encryption method based on nonnegative matrix factorization according to claim 2, characterized in that, In step S2, the method for generating the encryption result includes: The initial encryption result With the second random phase mask RPM2 The product is modulated by multiplication, and then the encrypted result is obtained through fractional Fourier transform. g : ; in, , α 2 and β 2 represents the parameters of the fractional Fourier transform.
4. The optical image asymmetric encryption method based on nonnegative matrix factorization according to claim 3, characterized in that, In step S3, the method for generating the image matrix and coefficient matrix includes: encrypting the result through NMF decomposition. g Decomposed into an image matrix W and a coefficient matrix H: ; in, r This represents the rank of the NMF decomposition, i.e., the number of base images.
5. The optical image asymmetric encryption method based on nonnegative matrix factorization according to claim 4, characterized in that, In S4, the obtained coefficient matrix H Save as final encrypted result Image matrix W Save as private key : ; 。 6. An asymmetric decryption method for optical images based on nonnegative matrix factorization, the decryption method being used to decrypt images encrypted by the encryption method according to any one of claims 1-5, characterized in that the steps... include: T1. Based on the ciphertext and the private key, generate a preliminary decryption result through inverse nonnegative matrix factorization; T2. Based on the preliminary decryption result, an intermediate decryption result is generated by using the conjugate plate of the first inverse optical transformation and the second random phase mask; The first inverse optical transformation is the inverse transformation of the second optical transformation; T3. Based on the intermediate decryption result, the final decrypted image is generated by the second inverse optical transformation and the conjugate plate of the first random phase mask; the second inverse optical transformation is the inverse transformation of the first optical transformation.
7. The decryption method according to claim 6, characterized in that, Methods for generating preliminary decryption results include: first, through the ciphertext... and private key Preliminary decryption results were obtained by performing inverse NMF decomposition and recovery. G : ; INMF represents inverse NMF decomposition.
8. The decryption method according to claim 7, characterized in that, Methods for generating intermediate decryption results include: taking the initial decryption result... G After inverse fractional Fourier transform and RPM2 conjugate plate Multiply and modulate to obtain the decrypted result. : ; in, represent RPM2 The conjugate plate, and , α 2 and β 2 represents the parameters of the fractional Fourier transform.
9. The decryption method according to claim 8, characterized in that, Methods for generating the final decrypted image include: Decryption result After undergoing the inverse fractional Fourier transform again, and... RPM1 conjugate plate Multiply and modulate to obtain the final decrypted result. F : ; in, The conjugate plate representing RPM1, and , α1 and β1 represents the parameters of the fractional Fourier transform.
Citation Information
Patent Citations
Image compression sensing and image encrypting method based on sparse matrix control
CN104463765A
Image encryption method based on fractional Fourier transform and double random phase encoding
CN106485643A