An image encryption and decryption method based on chaos and elliptic curve encryption algorithm

By combining the image encryption and decryption methods of chaotic and elliptic curve encryption algorithms, the dual encryption of synchronous chaotic sequences generated by light injection and the elliptic curve encryption algorithm are solved, and a high-security and efficient image encryption and decryption process is achieved.

CN115146296BActive Publication Date: 2025-08-19HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210932086.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-04
Publication Date
2025-08-19
Estimated Expiration
2042-08-04

AI Technical Summary

Technical Problem

In the existing image encryption methods, the single use of chaotic encryption has the risk of being easily cracked, while the advantages of elliptic curve encryption algorithms in asymmetric public key encryption have not been fully utilized, resulting in insufficient security of information transmission.

Method used

Combining the chaotic and elliptic curve encryption algorithm, the key is generated through the chaotic sequence, the image is blocked and chaos is messed up, and the image is chaotic and diffused. The key is transmitted using the elliptic curve encryption algorithm, and the image pixels are decrypted at the receiving end. The synchronous chaotic sequence and elliptic curve encryption algorithm generated by light injection are used to double encryption.

Benefits of technology

It improves the security of image encryption, resists exhaustive attacks, reduces the key space, enhances the statistical characteristics and security of encryption, and has a shorter key length, making the decryption process simple and efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115146296B_ABST
    Figure CN115146296B_ABST
Patent Text Reader

Abstract

The present invention discloses an image encryption and decryption method based on chaos and elliptic curve encryption algorithms. This method utilizes the characteristics of chaos and the elliptic curve public key encryption system to perform image encryption operations. The steps include: generating a key using a chaotic sequence; chaotic scrambling of image blocks; chaotic diffusion of the image; transmitting the key using an elliptic curve encryption algorithm; decrypting the key using the elliptic curve encryption algorithm; and restoring image pixels to restore the image. The chaotic sequence utilized is an optical chaotic synchronization sequence based on light injection. The chaotic sequence can be synchronized at the receiving and transmitting ends, and the chaotic sequence is used to generate a key library for image encryption. Each key library is transmitted separately through the synchronized chaotic sequence and the elliptic curve encryption algorithm, providing dual encryption characteristics and improving encryption security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information security technology, and in particular relates to an image encryption and decryption method based on chaos and elliptic curve encryption algorithms. Background Art

[0002] With the continuous advancement of communication technology, the speed of information transmission and the security and reliability of information transmission are becoming increasingly important. As an important way to carry information, images have always been the focus of attention in the field of information security due to their strong correlation. The elliptic curve encryption algorithm is an asymmetric public key encryption algorithm. Compared with traditional symmetric key encryption algorithms, the elliptic curve encryption algorithm can separate encryption and decryption keys, and the communicating parties can communicate confidentially without exchanging keys in advance. Chaotic signals have gained widespread attention in the field of image encryption due to their unique advantages of being non-periodic, noise-like, and unpredictable in the long term. However, the use of a single chaotic symmetric encryption has the risk of being easily cracked. Therefore, the combination of chaos and elliptic curve encryption algorithms will make information transmission more secure. Based on this, the present invention designs an image encryption and decryption method based on chaos and elliptic curve encryption algorithms. Summary of the Invention

[0003] In view of the above situation, the present invention provides an image encryption and decryption method based on chaos and elliptic curve encryption algorithm.

[0004] To achieve the above object, the present invention provides the following technical solutions:

[0005] An image encryption and decryption method based on chaos and elliptic curve encryption algorithm includes the following steps:

[0006] S1: Chaotic sequence generates key;

[0007] S2: image block chaotic scrambling;

[0008] S3: image chaotic diffusion;

[0009] S4: The key is transmitted using the elliptic curve encryption algorithm;

[0010] S5: Decrypt the key using the elliptic curve encryption algorithm and perform decryption;

[0011] S6: Restore the image pixels to obtain the original image.

[0012] Furthermore, in the above-mentioned image encryption and decryption method based on chaos and elliptic curve encryption algorithm, assuming that the image size is M*M, M is 256 or 512, in S1, the image pixel coordinate library is generated by the chaotic sequence: the modular operation is performed in the order of the chaotic sequence, so that the horizontal coordinate value range is [1, M / 2], the vertical coordinate value range is [1, M / 2], and it is ensured that each coordinate in the coordinate library is different.

[0013] At the same time, in the above-mentioned image encryption and decryption method based on chaos and elliptic curve encryption algorithm, in S1, an image shift library is generated by randomly extracting a chaotic sequence with a length of M / 2, and a modular operation is performed on the chaotic sequence so that the value range is [1,16].

[0014] At the same time, in the above-mentioned image encryption and decryption method based on chaos and elliptic curve encryption algorithm, in S1, the chaotic sequence is randomly extracted to generate an image XOR matrix with a size of [M / 2, M / 2] and a value range of [1,4].

[0015] Furthermore, in the above-mentioned image encryption and decryption method based on chaos and elliptic curve encryption algorithm, in S2, the image to be encrypted is divided into sub-blocks of size 2*2. If the length and width M of the image matrix cannot be divided by 2, a zero sequence is added to the image matrix until the image can be divided by 2. It is assumed that the size of the transformed image sub-block matrix is [M / 2, M / 2].

[0016] Furthermore, in the above-mentioned image encryption and decryption method based on chaos and elliptic curve encryption algorithm, in S2, according to the coordinates in the coordinate library, the sub-block of the image sub-block matrix at the coordinate is selected, assuming that the sub-block coordinates are [a, b], and the value ranges of a and b are both [1, M / 2], and the value of the position (a+b) mod (M / 2) is selected in the shift library as the number of bits of the shift.

[0017] Furthermore, in the above-mentioned image encryption and decryption method based on chaos and elliptic curve encryption algorithm, in S2, the sub-block matrix coordinate range is [1, M / 2], and the sub-block coordinates in the coordinate library are selected in sequence. Assuming that a sub-block coordinate selected in the coordinate library is [a, b], each coordinate will split the matrix from two dimensions: first, the matrix is divided into two upper and lower matrices according to the horizontal coordinate a, and circularly shifted upward and downward respectively, and the number of shifts is determined according to the value of the position (a+b)mod(M / 2) in the shift library; then the matrix is divided into two left and right matrices according to the vertical coordinate b, and circularly shifted to the left and right respectively, and the number of shifts is determined according to the value of the position (a+b)mod(M / 2) in the shift library.

[0018] Furthermore, in the above-mentioned image encryption and decryption method based on chaos and elliptic curve encryption algorithm, in S2, according to the value of the sub-block matrix coordinate corresponding to the image XOR matrix, four different XOR encryption methods are performed on the four pixel values inside the sub-block: when the value y of the coordinate corresponding to the image XOR matrix is 1, 2, 3, and 4 respectively, the encryption method is:

[0019]

[0020] Among them, D1, D2, D3, and D4 are the pixel values before encryption of the four elements in the sub-block arranged from left to right and from top to bottom, and C1, C2, C3, and C4 are the pixel values after encryption.

[0021] Furthermore, in S3, chaotic sequence 2 is used to generate a diffusion matrix B with a size of [M,M], and diffusion is performed in the following manner:

[0022]

[0023] Wherein, i represents the i-th element in each matrix, C represents the image matrix after diffusion, and P represents the image matrix before diffusion.

[0024] Furthermore, in the above-mentioned image encryption and decryption method based on chaos and elliptic curve encryption algorithm, in S4, the shift library and the image XOR matrix are encrypted with the public key of the elliptic curve encryption algorithm and then transmitted, and are decrypted with the private key at the receiving end.

[0025] Furthermore, in the above-mentioned image encryption and decryption method based on chaos and elliptic curve encryption algorithm, in S5, the synchronous chaotic sequence 2 is used at the receiving end to generate the same diffusion matrix as the receiving end and perform reverse diffusion with the received encrypted image; in S6, the same coordinate library is generated by the synchronous chaotic sequence 1, and the decrypted shift library and image XOR matrix are used to perform the opposite operation on the encrypted image to decrypt the original image.

[0026] Furthermore, in the above-mentioned image encryption and decryption method based on chaos and elliptic curve encryption algorithm, the chaotic sequences 1, 2 and chaotic synchronization sequences 1, 2 used in the technical solution of the present invention are realized by synchronized optical chaos generated by light injection, wherein chaotic sequence 1 is synchronized with chaotic synchronization sequence 1, and chaotic sequence 2 is synchronized with chaotic synchronization sequence 2.

[0027] Compared with the existing technology, the present invention has the following beneficial effects:

[0028] 1. The image encryption and decryption method based on chaos and elliptic curve encryption algorithm of the present invention uses a key that is generated by both a synchronized chaotic sequence generated by optical chaos and an elliptic curve encryption algorithm, which has good security. Cracking only one of them cannot restore the encrypted image. Through performance analysis of the encryption method, it is concluded that after encryption, the correlation between adjacent pixels of the image approaches zero, the grayscale histogram is evenly distributed, has good statistical characteristics, and has a large key space, which can effectively resist exhaustive attacks.

[0029] 2. The chaos adopted in the present invention is an optical chaos synchronization sequence based on light injection. The chaotic sequence required for encryption is obtained through analog-to-digital conversion. The dynamic equation of chaos is more complex than that of electrical chaos. The elliptic curve encryption algorithm is a public key system algorithm. The encryption and decryption functions are separated by two keys, which makes the encryption more secure. Compared with the traditional asymmetric public key encryption system, the elliptic curve encryption algorithm requires a shorter key under the condition of achieving the same level of security. At the same time, the encryption method only requires cyclic shifting, and the decryption party only needs to use the private key to decrypt the elliptic curve encryption algorithm, and combine it with the synchronized chaotic sequence to restore the image. The implementation is simple, and experimental simulations have shown that this method has high security. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The figure is a flow chart of an image encryption and decryption method according to a preferred embodiment of the present invention.

[0031] Figure 2 This is a system block diagram corresponding to an image encryption and decryption method according to a preferred embodiment of the present invention.

[0032] Figure 3 This is a schematic diagram of the image encryption effect of a preferred embodiment of the present invention.

[0033] Figure 4 Schematic diagram of a histogram of an image to be encrypted and an encrypted image according to a preferred embodiment of the present invention.

[0034] Figure 5 This is a schematic diagram of the correlation distribution between the image to be encrypted and the encrypted image according to a preferred embodiment of the present invention.

[0035] Appendix: Figure 3 In (a), (b), and (c), the left side is the image to be encrypted, and the right side is the encrypted image; Figure 4 In (a), (b), and (c), the left side is the histogram of the image to be encrypted, and the right side is the histogram of the encrypted image; Figure 5 In (a), (b), and (c), the left sides are the horizontal correlation, vertical correlation, and diagonal correlation of the image to be encrypted, respectively, and the right sides are the horizontal correlation, vertical correlation, and diagonal correlation of the encrypted image, respectively. DETAILED DESCRIPTION

[0036] In order to better illustrate the technical solution of the present invention, the encryption and decryption process will be clearly and completely described below in conjunction with a preferred embodiment and the accompanying drawings.

[0037] See also Figure 1-5 This embodiment provides an image encryption and decryption method based on chaos and elliptic curve encryption algorithm, which specifically includes the following steps:

[0038] S1: Chaotic sequence generates key;

[0039] S2: image block chaotic scrambling;

[0040] S3: image chaotic diffusion;

[0041] S4: The key is transmitted using the elliptic curve encryption algorithm;

[0042] S5: Decrypt the key using the elliptic curve encryption algorithm;

[0043] S6: Restore the image pixels to obtain the original image.

[0044] The following describes each step in detail.

[0045] Assuming that the image size is M*M, and M is 256 or 512, in S1, the image pixel coordinate library is generated by the chaotic sequence: the modular operation is performed in the order of the chaotic sequence, so that the horizontal coordinate value range is [1, M / 2], the vertical coordinate value range is [1, M / 2], and each coordinate in the coordinate library is guaranteed to be different.

[0046] At the same time, in S1, an image shift library is generated by randomly extracting chaotic sequences with a length of M / 2. Modulo operations are performed on the chaotic sequences to make the value range [1, 16]. An image XOR matrix is generated by randomly extracting chaotic sequences with a size of [M / 2, M / 2] and a value range [1, 4].

[0047] In S2, the image to be encrypted is divided into sub-blocks of size 2*2. If the length and width M of the image matrix cannot be divided by 2, a zero sequence is added to the image matrix until the image is divisible by 2. It is assumed that the size of the transformed image sub-block matrix is [M / 2, M / 2].

[0048] Furthermore, in S2, according to the coordinates in the coordinate library, the sub-block of the image sub-block matrix is selected. Assuming that the sub-block coordinates are [a, b], the value of the position (a+b) mod (M / 2) in the shift library is selected as the number of shift bits.

[0049] The sub-block matrix coordinate range is [M / 2, N / 2]. The sub-block coordinates in the coordinate library are selected in sequence. Assuming that a sub-block coordinate selected in the coordinate library is [a, b], each coordinate will split the matrix in two dimensions: first, the matrix is divided into upper and lower matrices according to the horizontal coordinate a, and circularly shifted upward and downward respectively. The number of shifts is determined by the value of the position (a+b)mod(M / 2) in the shift library; then the matrix is divided into left and right matrices according to the vertical coordinate b, and circularly shifted to the left and right respectively. The number of shifts is determined by the value of the position (a+b)mod(M / 2) in the shift library.

[0050] According to the value of the sub-block matrix coordinate corresponding to the image XOR matrix, four different XOR encryption methods are performed on the four pixel values inside the sub-block: when the value y of the coordinate corresponding to the image XOR matrix is 1, 2, 3, and 4 respectively, the encryption method is:

[0051]

[0052] Among them, D1, D2, D3, and D4 are the pixel values before encryption of the four elements in the sub-block arranged from left to right and from top to bottom, and C1, C2, C3, and C4 are the pixel values after encryption.

[0053] In S3, chaotic sequence 2 is used to generate a diffusion matrix B with a size of [M,M], which is diffused as follows:

[0054]

[0055] Wherein, i represents the i-th element in each matrix, C represents the image matrix after diffusion, and P represents the image matrix before diffusion.

[0056] In S4, the shift library and the image XOR matrix are encrypted using the elliptic curve encryption algorithm: using the elliptic curve, base point, public key and other information published by the receiver, the shift library and the image XOR matrix are embedded in the elliptic curve to obtain the encrypted sequence, which is then sent to the receiver.

[0057] In S5, the synchronous chaotic sequence 2 is used at the receiving end to generate a diffusion matrix B', where B = B', and the received encrypted image is inversely diffused in the following manner:

[0058]

[0059] Where i represents the i-th element in each matrix, C' represents the encrypted image matrix, and P' represents the image matrix after inverse diffusion.

[0060] In S6, the same coordinate library is generated by synchronized chaotic sequence 1. The receiving end uses the private key to decrypt the shift library encrypted by the elliptic curve encryption algorithm and the image XOR matrix to perform the reverse operation on the encrypted image. First, using the image XOR matrix, when the corresponding coordinate values y are 1, 2, 3, and 4 respectively, the decryption method is:

[0061]

[0062] Among them, C1, C2, C3, and C4 are the encrypted pixel values of the four elements in the sub-block arranged from left to right and from top to bottom, and D1, D2, D3, and D4 are the decrypted pixel values;

[0063] Furthermore, in S6, the image matrix is subjected to an inverse permutation using the coordinate library generated by chaotic synchronization and the shift library decrypted by the elliptic curve encryption algorithm: coordinates are selected from the coordinate library in reverse order, assuming the coordinates are [a, b], and the value range of a and b is [1, M / 2]. The image matrix is first divided into two left and right matrices according to the vertical coordinate b, and circularly shifted to the left and right respectively. The number of shifts is determined by the value of the position (a+b) mod (M / 2) in the shift library; the image matrix is then divided into two upper and lower matrices according to the horizontal coordinate a, and circularly shifted upward and downward respectively. The number of shifts is determined by the value of the position (a+b) mod (M / 2) in the shift library. After repeating the above steps of selecting coordinates and performing circular shifts in reverse order according to the coordinate library, the restored image can be obtained.

[0064] The chaotic sequence and chaotic synchronization sequence used in the technical solution of this embodiment are realized by synchronized optical chaos generated by light injection.

[0065] To better illustrate the implementation process of the elliptic curve encryption algorithm, the following describes a more specific operation process in detail:

[0066] 1. User A, as the receiver, selects the elliptic curve encryption algorithm parameters a, b, and p to determine an elliptic curve.

[0067] 2. User A, as the receiver, selects a point N on the elliptic curve as the base point, and the order of point N is T.

[0068] 3. User A, as the recipient, selects an integer d∈[1,T-1] as the private key and calculates the public key Q=dN.

[0069] 4. User A, as the receiver, publishes the curve E, public key Q, point N and its order T.

[0070] 5. User B, as the sender, receives the public key Q, point N and its order T sent by user A, and determines an integer u∈[1,T-1]

[0071] Calculate C1=uN, C2=uQ, and embed the plaintext information M into the elliptic curve using C2 to obtain the serial encryption sequence E.

[0072] 6. User B sends E, C1 to user A.

[0073] 7. User A uses private key d to calculate C2 = dC1.

[0074] 8. User A uses C2 to restore E to M.

[0075] See also Figure 3-5 In a specific example, the present invention analyzes the encryption effect of the image from the perspectives of histogram statistical characteristics, pixel correlation, pixel change rate, etc.

[0076] 1. Histogram Analysis: The statistical characteristics of an encrypted image are primarily characterized by its histogram, which, to a certain extent, reflects the distribution of the image's grayscale values. The more uniform the grayscale histogram distribution, the less correlation there is between the image's pixel values and the number of pixels, making it more difficult for an eavesdropper to recover the original image by analyzing the image's statistical characteristics. As can be seen from the figure, the grayscale histogram of the encrypted image is much more uniform than that of the image to be encrypted, making it difficult to extract effective statistical characteristics.

[0077] 2. Correlation analysis of adjacent pixels: In image encryption, there is a large amount of correlation redundancy between images. By using these correlations, the values of some pixels can be derived from the values of other pixels. Therefore, it is necessary to break the correlation between images. The correlation calculation formula is as follows:

[0078]

[0079] The correlation coefficients in the horizontal, vertical, and diagonal directions are calculated using the correlation calculation formula. This solution selects an image and simulates and compares 8,000 randomly selected pairs of pixels from the encrypted image and the image to be encrypted, obtaining a correlation distribution map of adjacent pixels in the three directions.

[0080] 3. Pixel Change Rate Analysis: To reflect the encryption status of the encrypted image, the pixel change rate (NPCR) can be used to compare the degree of pixel change between the image to be encrypted and the encrypted image. It is defined as:

[0081]

[0082] Where M and N represent the width and height of the image respectively, and D(i,j) represents the pixel value of the image at that point.

[0083] For encrypted images, a greater pixel change rate indicates a greater difference from the image being encrypted, indicating better encryption performance. The table below shows the NPCR values obtained from encryption simulations of three different images, all of which approach 100%.

[0084] Pixel change rate

[0085] Encrypted Image NPCR Lena 99.6101 Mandrill 99.6212 Living room 99.6372

[0086] Obviously, the embodiments described above are only preferred examples of the present invention. Those skilled in the art can obtain other implementation methods from these preferred embodiments without creative work.

Claims

1. An image encryption and decryption method based on chaos and elliptic curve encryption algorithm, characterized in that: The following steps are involved: S1: Chaotic sequence generates key; S2: image block chaotic scrambling; S3: image chaotic diffusion; S4: The key is transmitted using the elliptic curve encryption algorithm; S5: Decrypt the key using the elliptic curve encryption algorithm; S6: Restoring the image pixels to obtain the original image; Assume that the image size is M*M, where M is 256 or 512. In S1, the image pixel coordinate library is generated by chaotic sequence 1: modular operation is performed according to the order of chaotic sequence 1, so that the horizontal coordinate value range is [1, M / 2], the vertical coordinate value range is [1, M / 2], and each coordinate in the coordinate library is guaranteed to be different. In S1, an image shift library is generated by randomly extracting elements from chaotic sequence 1, with a length of M / 2, and a modular operation is performed on the chaotic sequence so that the value range is [1,16]. And by randomly extracting elements from chaotic sequence 1, an image XOR matrix is generated with a size of [M / 2, M / 2] and a value range of [1,4]; In S2, the image to be encrypted is divided into sub-blocks of size 2*2. If the length and width M of the image matrix are not divisible by 2, a zero sequence is added to the image matrix until the image is divisible by 2. The size of the transformed image sub-block matrix is set to [M / 2, M / 2]. In S2, according to the coordinates in the coordinate library, select the sub-block of the image sub-block matrix at that coordinate. Let the sub-block coordinates be [a, b], and the value range of a and b are both [1, M / 2]. Select the value of the position (a+b) mod (M / 2) in the shift library as the number of bits to shift. In S2, the sub-block matrix coordinate range is [1, M / 2]. The sub-block coordinates in the coordinate library are selected in sequence. Let the coordinates of a sub-block selected in the coordinate library be [a, b]. Each coordinate will split the matrix in two dimensions: first, the matrix is divided into two upper and lower matrices according to the horizontal coordinate a, and circularly shifted upward and downward respectively. The number of shifts is determined by the value of the position (a+b)mod(M / 2) in the shift library; then the matrix is divided into two left and right matrices according to the vertical coordinate b, and circularly shifted to the left and right respectively. The number of shifts is determined by the value of the position (a+b)mod(M / 2) in the shift library; In S2, four different XOR encryptions are performed on the four pixel values within the sub-block according to the values of the image XOR matrix corresponding to the sub-block matrix coordinates: when the values y of the image XOR matrix corresponding to the coordinates are 1, 2, 3, and 4 respectively, the encryption methods are as follows: Among them, D1, D2, D3, and D4 are the pixel values before encryption of the four elements in the sub-block arranged from left to right and from top to bottom, and C1, C2, C3, and C4 are the pixel values after encryption; In S3, chaotic sequence 2 is used to generate a diffusion matrix B with a size of [M,M], which is diffused as follows: Wherein, i represents the i-th element in each matrix, C represents the image matrix after diffusion, and P represents the image matrix before diffusion.

2. The image encryption and decryption method based on chaos and elliptic curve encryption algorithm according to claim 1 is characterized in that: In S4, the shift library and the image XOR matrix are encrypted with the public key of the elliptic curve encryption algorithm and then transmitted.

3. The image encryption and decryption method based on chaos and elliptic curve encryption algorithm according to claim 2 is characterized in that: In S5, the receiving end uses the synchronized chaotic sequence 2 to generate the same diffusion matrix as the receiving end, and performs reverse diffusion with the received encrypted image; In S6, the same coordinate library is generated by synchronous chaotic sequence 1, and the decrypted shift library and image XOR matrix are used to perform the opposite operation on the encrypted image to decrypt the original image.

Citation Information

Patent Citations

  • Information hiding method and system based on elliptic curve cryptography

    CN113645021A

  • Mixing chaos and block scrambling image encryption algorithm

    CN114389788A