Chaotic encryption method for color image
Patent Information
- Application Number
- CN202410849383.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
[0006]针对现有技术的不足,本发明提供了一种彩色图像的混沌加密方法,具备安全性更高、可有效避免密钥泄露风险的优点,解决了目前传统的混沌加密方法大多只关注对灰度图像的加密,而忽视了彩色图像的颜色信息,这意味着在加密后的图像中,颜色的分布可能会发生明显的变化,使得图像在视觉上产生显著的差异,这种差异可能使加密后的图像容易被破解,此外,传统的混沌加密方法通常需要用户输入一个密钥来生成混沌序列,这带来了安全风险,因为如果攻击者能够获取到用户输入的密钥,他们就可能解密出原始的图像数据的问题
[0073] Compared with the existing technology, the present invention provides a chaotic encryption method for color images, which has the following beneficial effects:
Smart Images

Figure CN118631418A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image data processing, in particular to a chaotic encryption method for color images. Background Art
[0002] In the modern network environment, the security of important data such as personal information and transaction information has become a key issue. Although the security mechanism of the network system ensures the information security of users when using computers through certain network protocols, given the complexity of the network environment, this method cannot eliminate all security risks. Images often contain a lot of sensitive information, such as personal identity information, transaction information, etc. Once these images are illegally obtained and used, they may cause serious losses to individuals and businesses. Therefore, it is particularly important to use encryption technology to protect the information in the images.
[0003] Chaotic encryption is an encryption method that uses a sequence generated by a chaotic system as an encryption transformation factor sequence. It mainly utilizes the high sensitivity of the chaotic system, that is, the chaotic system has a strong dependence on the initial conditions. This characteristic enables the chaotic system to generate a large number of random and complex sequences. In digital image encryption, the chaotic system can effectively protect and encrypt image data.
[0004] At present, most traditional chaotic encryption methods only focus on the encryption of grayscale images, but ignore the color information of color images. This means that in the encrypted image, the distribution of colors may change significantly, resulting in significant visual differences in the image. This difference may make the encrypted image easy to crack. In addition, traditional chaotic encryption methods usually require users to enter a key to generate a chaotic sequence, which brings security risks, because if attackers can obtain the key entered by the user, they may be able to decrypt the original image data. Therefore, we propose a chaotic encryption method for color images. Summary of the invention
[0005] 1. Technical issues to be solved
[0006] In view of the shortcomings of the prior art, the present invention provides a chaotic encryption method for color images, which has the advantages of higher security and can effectively avoid the risk of key leakage. It solves the problem that most traditional chaotic encryption methods currently only focus on the encryption of grayscale images and ignore the color information of color images, which means that in the encrypted image, the distribution of colors may change significantly, resulting in significant visual differences in the image, and this difference may make the encrypted image easy to crack. In addition, traditional chaotic encryption methods usually require users to input a key to generate a chaotic sequence, which brings security risks, because if attackers can obtain the key input by the user, they may decrypt the original image data.
[0007] (II) Technical solution
[0008] In order to achieve the above-mentioned purpose of higher security and effectively avoiding the risk of key leakage, the present invention provides the following technical solutions:
[0009] A chaotic encryption method for color images, the following steps:
[0010] S1, converting the color image into a grayscale image, and then converting the grayscale image into a binary image;
[0011] S2, using Logistic mapping, generates a parameter set according to the key input by the user, and generates a chaotic sequence;
[0012] S3, using the parameter set as a key in the encryption and decryption process;
[0013] S4, for each pixel position (i, j), perform an XOR operation on its gray value and the corresponding element in the chaotic sequence to obtain an encrypted pixel value, and remap the encrypted pixel value to the range of 0-255 to maintain the color representation of the image;
[0014] S5, repeating S4 of the chaotic encryption method for the color image until the encryption operation is completed at all pixel positions;
[0015] S6. For each pixel position (i, j), perform an XOR operation on the encrypted pixel value and the corresponding element in the chaotic sequence to obtain a decrypted pixel value, and remap the decrypted pixel value to the range of 0-255 to restore the original grayscale image;
[0016] S7, repeating S6 of the chaotic encryption method for the color image until the decryption operation is completed at all pixel positions;
[0017] S8. Finally, convert the grayscale image back to a color image.
[0018] Preferably, the color image is converted into a grayscale image by a weighted average method, and the grayscale image is converted into a binary image by dividing the pixel values into black and white according to a set threshold value by a threshold segmentation method.
[0019] Preferably, after performing an XOR operation on each pixel position (i, j) of the grayscale image and a corresponding element in the chaotic sequence using an AES encryption algorithm, the encrypted pixel value obtained is further encrypted.
[0020] Preferably, the steps of further encrypting the obfuscated pixel values by the AES encryption algorithm are as follows:
[0021] S41, for each pixel position (i, j), perform an XOR operation on its gray value and the corresponding element in the chaotic sequence to obtain an encrypted pixel value;
[0022] S42, using the encrypted pixel value as input of the AES encryption algorithm;
[0023] S43, using the key input by the user to generate the key stream required by the AES encryption algorithm;
[0024] S44, performing further encryption operation on the encrypted pixel value according to the key stream and the AES encryption algorithm;
[0025] S45, remapping the encrypted result into the range of 0-255 to maintain the color representation of the image;
[0026] S46, repeating S41 to S45 of the chaotic encryption method for color images until the encryption operation is completed at all pixel positions.
[0027] Preferably, through the AES decryption algorithm and the deep learning model, the encrypted pixel value of each pixel position (i, j) is XORed with the corresponding element in the chaotic sequence to obtain the decrypted pixel value.
[0028] Preferably, the specific process of the AES decryption algorithm and the deep learning model performing a decryption operation on the encrypted pixel value is as follows:
[0029] S61, obtaining an encrypted pixel value by performing an XOR operation on each pixel position (i, j) of the color image and a corresponding element in the chaotic sequence;
[0030] S62, using the encrypted pixel value as input of the AES decryption algorithm;
[0031] S63, using the key input by the user to generate the key stream required by the AES decryption algorithm;
[0032] S64, performing a decryption operation on the encrypted pixel value according to the key stream and the AES decryption algorithm to obtain a decrypted pixel value;
[0033] S65, reconstructing the image based on the decrypted pixel values using a deep learning model;
[0034] S66, mapping the reconstructed image into a range of 0-255 to maintain the color representation of the image;
[0035] S67, repeat the above steps until the decryption operation and image reconstruction are completed at all pixel positions.
[0036] Preferably, after converting the grayscale image back to a color image, it is also necessary to perform a security assessment on the encryption and decryption process. The steps of the security assessment are as follows:
[0037] S81, performing statistical analysis on the grayscale image converted from the original color image in S1 of the chaotic encryption method for color images;
[0038] S82, performing frequency domain analysis on the grayscale image: converting the grayscale image into the frequency domain by using Fourier transform, and detecting whether there are abnormal frequency components or noise by observing the spectrum diagram;
[0039] S83, performing texture analysis on the grayscale image: performing texture analysis on the grayscale image through a local binary pattern to evaluate whether the texture feature of the grayscale image has changed;
[0040] S84. In S8 of the chaotic encryption method for color images, the decrypted color image is compared with the original color image to evaluate whether its quality is affected.
[0041] Preferably, the process of converting a color image to a grayscale image is as follows:
[0042] S11. For each pixel position (i, j), obtain its RGB value;
[0043] S12, calculating the average value of RGB values;
[0044] S13, taking the average value as the grayscale value of the pixel position;
[0045] S14, repeat S11-S13 until the grayscale values of all pixel positions are calculated;
[0046] S15, remap the calculated grayscale value to the range of 0-255 to maintain the color representation of the image.
[0047] Preferably, the steps of performing AES encryption on the obfuscated pixel values are as follows:
[0048] S44.1. Generation of S-box: Initialize a 256x16 two-dimensional array as an S-box. For each possible input value i (0 to 255), calculate its corresponding output value j (0 to 15). Store the input value i and the output value j in the corresponding position of the S-box. After all possible input values are mapped, the S-box generation is completed.
[0049] S44.2. Round key expansion: Split the original key into multiple subkeys, each subkey is 4 bits long, and perform the following operations on each subkey:
[0050] Initial permutation: rearrange the subkeys into a new subkey of length 4 according to predefined rules;
[0051] Left shift operation: Shift the new subkey to the left by a fixed number of bits. The specific shift amount depends on the current round.
[0052] Compression permutation: According to predefined rules, the new subkey is rearranged into a new subkey of length 4;
[0053] Repeat the above steps until 11 subkeys are generated;
[0054] S44.3. Initial round: For each subkey, perform the following operations:
[0055] Byte replacement: Use S-box to replace bytes on the input;
[0056] Row shift: Circularly shift each row of the input matrix to the left by a different number of bits;
[0057] Column confusion: Each column of the input matrix is multiplied modulo 2 by a fixed polynomial;
[0058] Add round key: XOR the subkey with the current state;
[0059] S44.4, subsequent rounds: for each subkey, perform byte replacement, row shift, column confusion and round key addition. After multiple rounds of iterations, the MixCo l umns operation is not performed in the last round.
[0060] S44.5. Final output: After all rounds of processing, the final encryption result is obtained.
[0061] Preferably, the training steps of the deep learning model are as follows:
[0062] H1. Data preparation: Collect a large number of color images as training datasets to ensure the diversity and representativeness of the datasets;
[0063] H2. Data preprocessing: preprocess color images, including grayscale, binarization, and normalization;
[0064] H3. Build a model: Design a recurrent neural network model;
[0065] H4. Loss function selection: The mean square error loss function is used to measure the difference between the model prediction results and the true label;
[0066] H5. Optimizer selection: Update model parameters through stochastic gradient descent optimizer;
[0067] H6. Hyperparameter tuning: Hyperparameter tuning can be performed by using the grid search method;
[0068] H7, Model training: Input the preprocessed color image into the deep learning model and perform multiple rounds of iterative training;
[0069] H8. Model evaluation: During the training process, use the cross-validation method to regularly evaluate the performance indicators of the model;
[0070] H9. Model saving: When the model achieves satisfactory performance, save it as a reusable model file;
[0071] H10. Model application: Apply the trained model to decrypt color images.
[0072] (III) Beneficial effects
[0073] Compared with the prior art, the present invention provides a chaotic encryption method for color images, which has the following beneficial effects:
[0074] 1. The chaotic encryption method of the color image converts the color image into a grayscale image by the weighted average method, and divides the pixel values into black and white by the threshold segmentation method, and converts the grayscale image into a binary image. In this way, the grayscale value of each pixel position (i, j) is retained, and the color information of the original color image is maintained. This conversion method retains the color information of the color image, making the encrypted image visually similar to the original image, and decrypting the encrypted pixel values through the AES decryption algorithm and the deep learning model can effectively restore the details and colors of the original color image, which can greatly reduce the loss of information and make the decrypted image closer to the original color image, reducing the possibility of crackers attacking based on color differences. At the same time, converting the grayscale image into a binary image can further increase the complexity of encryption and improve the encryption effect.
[0075] 2. The chaotic encryption method of the color image generates a parameter set according to the key input by the user by using Logi st ic mapping, and generates a chaotic sequence. This chaotic sequence is highly sensitive and random, and can effectively protect and encrypt image data. For each pixel position (i, j), its gray value is XORed with the corresponding element in the chaotic sequence to obtain the encrypted pixel value and the decrypted pixel value. It can ensure that there is a difference between the encrypted pixel value and the pixel value of the original gray image, which increases the difficulty of cracking. By using the chaotic sequence for encryption and decryption operations, the data security of the color image can be effectively protected. Due to the unpredictability and sensitivity of the chaotic sequence, even if the attacker obtains the encrypted image data, it is difficult to crack the original color image. In addition, the use of XOR operations for encryption and decryption operations is relatively simple and efficient, and the encryption process can be completed quickly. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 It is a schematic diagram of the chaotic encryption method of color images of the present invention;
[0077] Figure 2 A schematic diagram of a process of converting a color image into a grayscale image according to the present invention;
[0078] Figure 3 A flowchart of the AES encryption algorithm of the present invention performing encryption operation on the obfuscated pixel values;
[0079] Figure 4 A flowchart of the AES decryption algorithm of the present invention performing a decryption operation on the encrypted pixel value;
[0080] Figure 5 It is a schematic diagram of the safety assessment process of the present invention. DETAILED DESCRIPTION
[0081] The following will be combined with the embodiments of the present invention and the accompanying drawings to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0082] See also Figure 1-5 ,A chaotic encryption method for color images, the following steps:
[0083] S1, converting the color image into a grayscale image, and then converting the grayscale image into a binary image;
[0084] S2, using Logistic mapping, generates a parameter set according to the key input by the user, and generates a chaotic sequence;
[0085] S3, using the parameter set as a key in the encryption and decryption process;
[0086] S4, for each pixel position (i, j), perform an XOR operation on its gray value and the corresponding element in the chaotic sequence to obtain an encrypted pixel value, and remap the encrypted pixel value to the range of 0-255 to maintain the color representation of the image;
[0087] S5, repeating S4 of the chaotic encryption method for the color image until the encryption operation is completed at all pixel positions;
[0088] S6. For each pixel position (i, j), perform an XOR operation on the encrypted pixel value and the corresponding element in the chaotic sequence to obtain a decrypted pixel value, and remap the decrypted pixel value to the range of 0-255 to restore the original grayscale image;
[0089] S7, repeating S6 of the chaotic encryption method for the color image until the decryption operation is completed at all pixel positions;
[0090] S8. Finally, convert the grayscale image back to a color image.
[0091] Specifically, the color image is converted into a grayscale image by a weighted average method, and the pixel values are divided into black and white according to a set threshold value by a threshold segmentation method, and the grayscale image is converted into a binary image.
[0092] Furthermore, the purpose of converting the grayscale image into a binary image is to extract the key information in the color image and convert it into a concise representation. This can reduce the complexity of the color image and reduce the amount of computation in the encryption process. At the same time, by converting the grayscale image into a binary image, the information at each pixel position can be compressed into one bit, further increasing the strength of the encryption. This conversion method can retain the basic characteristics of the color image while improving the security of the encryption process.
[0093] Specifically, after using the AES encryption algorithm to perform an XOR operation on each pixel position (i, j) of the grayscale image and the corresponding element in the chaotic sequence, the encrypted pixel value obtained is further encrypted.
[0094] Furthermore, by using the encrypted pixel value as the input of the AES encryption algorithm and using the key input by the user to generate the key stream required by the AES encryption algorithm, the encrypted pixel value can be further encrypted, which can further improve the security of the encryption process and make the encrypted pixel value more difficult to crack and steal. At the same time, the encrypted result is remapped to the range of 0-255 to maintain the color representation of the image, ensuring that the encrypted image still has valid color information.
[0095] Specifically, the steps of further encryption operation of the AES encryption algorithm on the obfuscated pixel values are as follows:
[0096] S41, for each pixel position (i, j), perform an XOR operation on its gray value and the corresponding element in the chaotic sequence to obtain an encrypted pixel value;
[0097] S42, using the encrypted pixel value as input of the AES encryption algorithm;
[0098] S43, using the key input by the user to generate the key stream required by the AES encryption algorithm;
[0099] S44, performing further encryption operation on the encrypted pixel value according to the key stream and the AES encryption algorithm;
[0100] S45, remapping the encrypted result into the range of 0-255 to maintain the color representation of the image;
[0101] S46, repeating S41 to S45 of the chaotic encryption method for color images until the encryption operation is completed at all pixel positions.
[0102] Furthermore, by using the hyperchaotic Qi system to generate a hyperchaotic sequence and using it as the target key of the AES encryption algorithm, the difficulty of cracking is greatly increased. In the process of intercepting the chaotic sequence, the average value of the plaintext image pixels is introduced as a parameter to adapt to the changes in the plaintext image. The target key is substituted into the AES encryption algorithm for two rounds of encryption, and the S box and round key in each round of encryption are generated by the chaotic sequence, which enhances the randomness of the key. In addition, the simulation experimental results show that the algorithm can combine the advantages of both and achieve a good encryption effect.
[0103] Specifically, the encrypted pixel value of each pixel position (i, j) is XORed with the corresponding element in the chaotic sequence through the AES decryption algorithm to obtain the decrypted pixel value.
[0104] Furthermore, the decryption process uses the key input by the user to generate the key stream required by the AES decryption algorithm, and decrypts the encrypted pixel values according to the key stream and the AES decryption algorithm. The decrypted pixel values will be remapped to the range of 0-255 to restore the original grayscale image. This ensures that the encryption and decryption processes can be carried out correctly and the original image can be accurately restored.
[0105] Specifically, the specific process of the AES decryption algorithm and the deep learning model to decrypt the encrypted pixel value is as follows:
[0106] S61, obtaining an encrypted pixel value by performing an XOR operation on each pixel position (i, j) of the color image and a corresponding element in the chaotic sequence;
[0107] S62, using the encrypted pixel value as input of the AES decryption algorithm;
[0108] S63, using the key input by the user to generate the key stream required by the AES decryption algorithm;
[0109] S64, performing a decryption operation on the encrypted pixel value according to the key stream and the AES decryption algorithm to obtain a decrypted pixel value;
[0110] S65, reconstructing the image based on the decrypted pixel values using a deep learning model;
[0111] S66, mapping the reconstructed image into a range of 0-255 to maintain the color representation of the image;
[0112] S67, repeat the above steps until the decryption operation and image reconstruction are completed at all pixel positions.
[0113] Furthermore, by using chaotic sequences and AES encryption algorithm, the complexity and security of image encryption can be increased, making the encrypted image more difficult to crack. The decryption process corresponds to the encryption process, and the original image can be accurately restored, ensuring the reversibility of encryption and decryption. During the encryption and decryption process, the color representation of the image is maintained, so that the decrypted image is consistent with the original image in visual effect. Users can input keys as needed to generate different chaotic sequences and AES key streams, increasing the flexibility and applicability of the encryption method.
[0114] Moreover, by using a deep learning model to reconstruct the decrypted pixel values, the details and colors of the original color image can be effectively restored, which can greatly reduce information loss and make the decrypted image closer to the original color image.
[0115] Specifically, in S8, after the grayscale image is converted back to a color image, the encryption and decryption process needs to be security evaluated. The steps of the security evaluation are as follows:
[0116] S81, performing statistical analysis on the grayscale image converted from the original color image in S1 of the chaotic encryption method for color images;
[0117] S82, performing frequency domain analysis on the grayscale image: converting the grayscale image into the frequency domain by using Fourier transform, and detecting whether there are abnormal frequency components or noise by observing the spectrum diagram;
[0118] S83, performing texture analysis on the grayscale image: performing texture analysis on the grayscale image through a local binary pattern to evaluate whether the texture feature of the grayscale image has changed;
[0119] S84. In S8 of the chaotic encryption method for color images, the decrypted color image is compared with the original color image to evaluate whether its quality is affected.
[0120] Furthermore, through statistical analysis, frequency domain analysis, and texture analysis, it is possible to evaluate whether abnormal frequency components or noise are introduced during the encryption process, and whether the texture features of the grayscale image have changed. At the same time, by comparing the decrypted color image with the original color image, it is possible to evaluate whether the quality of the decrypted image is affected. These security assessment steps can help verify the effectiveness and anti-attack capabilities of the encryption method, and provide improvement plans to improve the security of the encryption method.
[0121] Specifically, in S8, the process of converting a color image into a grayscale image is as follows:
[0122] S11. For each pixel position (i, j), obtain its RGB value;
[0123] S12, calculating the average value of RGB values;
[0124] S13, taking the average value as the grayscale value of the pixel position;
[0125] S14, repeat S11-S13 until the grayscale values of all pixel positions are calculated;
[0126] S15, remap the calculated grayscale value to the range of 0-255 to maintain the color representation of the image.
[0127] Furthermore, the grayscale image is converted into a binary image by setting a threshold T. Specifically, if the grayscale value of a pixel is greater than or equal to the threshold T, it is set to 1 (indicating black); otherwise, it is set to 0 (indicating white). In this way, each pixel is converted into a binary number, which can be expressed by pseudo code as follows:
[0128]
[0129]
[0130] Among them, height and width represent the height and width of the image respectively, R, G, and B are the three channels of the color image, and BW is a binary image.
[0131] Specifically, the steps for AES encryption of the chaotic pixel values are as follows:
[0132] S44.1. Generation of S-box: Initialize a 256x16 two-dimensional array as an S-box. For each possible input value i (0 to 255), calculate its corresponding output value j (0 to 15). Store the input value i and the output value j in the corresponding position of the S-box. After all possible input values are mapped, the S-box generation is completed.
[0133] S44.2. Round key expansion: Split the original key into multiple subkeys, each subkey is 4 bits long, and perform the following operations on each subkey:
[0134] Initial permutation: rearrange the subkeys into a new subkey of length 4 according to predefined rules;
[0135] Left shift operation: Shift the new subkey to the left by a fixed number of bits. The specific shift amount depends on the current round.
[0136] Compression permutation: According to predefined rules, the new subkey is rearranged into a new subkey of length 4;
[0137] Repeat the above steps until 11 subkeys are generated;
[0138] S44.3. Initial round: For each subkey, perform the following operations:
[0139] Byte replacement: Use S-box to replace bytes on the input;
[0140] Row shift: Circularly shift each row of the input matrix to the left by a different number of bits;
[0141] Column confusion: Each column of the input matrix is multiplied modulo 2 by a fixed polynomial;
[0142] Add round key: XOR the subkey with the current state;
[0143] S44.4, subsequent rounds: for each subkey, perform byte replacement, row shift, column confusion and round key addition. After multiple rounds of iterations, the MixCo l umns operation is not performed in the last round;
[0144] S44.5. Final output: After all rounds of processing, the final encryption result is obtained.
[0145] Furthermore, the above process is the key to AES encryption of the obfuscated pixel values. First, all the parameters required for the encryption process are defined through the generation of S boxes and the expansion of round keys. Then, the initial and subsequent rounds of operations implement a series of complex processing steps, including byte replacement, row shift, column confusion, and XOR operations with subkeys. After the last round does not perform the MixCo l umns operation, the final encryption result is obtained after all rounds of processing.
[0146] Specifically, the training steps of the deep learning model are as follows:
[0147] H1. Data preparation: Collect a large number of color images as training datasets to ensure the diversity and representativeness of the datasets;
[0148] H2. Data preprocessing: preprocess color images, including grayscale, binarization, and normalization;
[0149] H3. Build a model: Design a recurrent neural network model;
[0150] H4. Loss function selection: The mean square error loss function is used to measure the difference between the model prediction results and the true label;
[0151] H5. Optimizer selection: Update model parameters through stochastic gradient descent optimizer;
[0152] H6. Hyperparameter tuning: Hyperparameter tuning can be performed by using the grid search method;
[0153] H7, Model training: Input the preprocessed color image into the deep learning model and perform multiple rounds of iterative training;
[0154] H8. Model evaluation: During the training process, use the cross-validation method to regularly evaluate the performance indicators of the model;
[0155] H9. Model saving: When the model achieves satisfactory performance, save it as a reusable model file;
[0156] H10. Model application: Apply the trained model to decrypt color images.
[0157] In summary, the chaotic encryption method of color image converts the color image into a grayscale image through the weighted average method, and divides the pixel values into black and white through the threshold segmentation method, and converts the grayscale image into a binary image. In this way, the grayscale value of each pixel position (i, j) is retained, and the color information of the original color image is maintained. This conversion method retains the color information of the color image, so that the encrypted image is visually similar to the original image, and the encrypted pixel values are decrypted by the AES decryption algorithm and the deep learning model, which can effectively restore the details and colors of the original color image, greatly reduce the loss of information, and make the decrypted image closer to the original color image, reducing the possibility of crackers attacking based on color differences. At the same time, converting the grayscale image into a binary image can further increase the complexity of encryption and improve the encryption effect.
[0158] Moreover, the chaotic encryption method of the color image generates a parameter set according to the key input by the user by using Logi st ic mapping, and generates a chaotic sequence. This chaotic sequence has high sensitivity and randomness, and can effectively protect and encrypt image data. For each pixel position (i, j), its gray value is XORed with the corresponding element in the chaotic sequence to obtain the encrypted pixel value and the decrypted pixel value. It can ensure that there is a difference between the encrypted pixel value and the pixel value of the original gray image, which increases the difficulty of cracking. By using the chaotic sequence for encryption and decryption operations, the data security of the color image can be effectively protected. Due to the unpredictability and sensitivity of the chaotic sequence, even if the attacker obtains the encrypted image data, it is difficult to crack it. The original color image, in addition, the use of XOR operations for encryption and decryption operations is relatively simple and efficient, and can quickly complete the encryption process, solving the problem that most of the current traditional chaotic encryption methods only focus on the encryption of grayscale images, while ignoring the color information of color images, which means that in the encrypted image, the distribution of colors may change significantly, causing the image to have significant visual differences, and this difference may make the encrypted image easy to crack. In addition, traditional chaotic encryption methods usually require users to enter a key to generate a chaotic sequence, which brings security risks because if attackers can obtain the key entered by the user, they may be able to decrypt the original image data.
[0159] The relevant modules involved in this system are all hardware system modules or functional modules that combine computer software programs or protocols with hardware in the prior art. The computer software programs or protocols involved in the functional modules are themselves technologies that are well known to those skilled in the art and are not improvements of this system. The improvements of this system are the interaction or connection relationships between the modules, that is, improvements to the overall structure of the system to solve the corresponding technical problems to be solved by this system.
[0160] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A chaotic encryption method for color images, It is characterized by the following step: S1, converting the color image into a grayscale image, and then converting the grayscale image into a binary image; S2, using Logistic mapping, generates a parameter set and a chaotic sequence according to the key input by the user; S3, using the parameter set as a key in the encryption and decryption process; S4, for each pixel position (i, j), perform an XOR operation on its gray value and the corresponding element in the chaotic sequence to obtain an encrypted pixel value, and remap the encrypted pixel value to the range of 0-255 to maintain the color representation of the image; S5, repeating S4 of the chaotic encryption method for the color image until the encryption operation is completed at all pixel positions; S6. For each pixel position (i, j), perform an XOR operation on the encrypted pixel value and the corresponding element in the chaotic sequence to obtain a decrypted pixel value, and remap the decrypted pixel value to the range of 0-255 to restore the original grayscale image; S7, repeating S6 of the chaotic encryption method for the color image until the decryption operation is completed at all pixel positions; S8. Finally, convert the grayscale image back to a color image.
2. The chaotic encryption method for color images according to claim 1, It is characterized in that In S1, the color image is converted into a grayscale image by a weighted average method, and the pixel values are divided into black and white according to a set threshold value by a threshold segmentation method, so that the grayscale image is converted into a binary image.
3. The chaotic encryption method for color images according to claim 1, It is characterized in that In S4, after performing an XOR operation on each pixel position (i, j) of the grayscale image and the corresponding element in the chaotic sequence using the AES encryption algorithm, the encrypted pixel value obtained is further encrypted.
4. The chaotic encryption method for color images according to claim 3, It is characterized in that The steps of further encryption operation of the AES encryption algorithm on the obfuscated pixel values are as follows: S41, for each pixel position (i, j), perform an XOR operation on its gray value and the corresponding element in the chaotic sequence to obtain an encrypted pixel value; S42, using the encrypted pixel value as input of the AES encryption algorithm; S43, using the key input by the user to generate the key stream required by the AES encryption algorithm; S44, performing further encryption operation on the encrypted pixel value according to the key stream and the AES encryption algorithm; S45, remapping the encrypted result into the range of 0-255 to maintain the color representation of the image; S46, repeating S41 to S45 of the chaotic encryption method for color images until the encryption operation is completed at all pixel positions.
5. The chaotic encryption method for color images according to claim 1, It is characterized in that In S6, the encrypted pixel value of each pixel position (i, j) is XORed with the corresponding element in the chaotic sequence through the AES decryption algorithm and the deep learning model to obtain the decrypted pixel value.
6. The chaotic encryption method for color images according to claim 5, It is characterized in that The specific process of the AES decryption algorithm and the deep learning model to decrypt the encrypted pixel value is as follows: S61, obtaining an encrypted pixel value by performing an XOR operation on each pixel position (i, j) of the color image and a corresponding element in the chaotic sequence; S62, using the encrypted pixel value as input of the AES decryption algorithm; S63, using the key input by the user to generate the key stream required by the AES decryption algorithm; S64, performing a decryption operation on the encrypted pixel value according to the key stream and the AES decryption algorithm to obtain a decrypted pixel value; S65, reconstructing the image based on the decrypted pixel values using a deep learning model; S66, mapping the reconstructed image into a range of 0-255 to maintain the color representation of the image; S67, repeat the above steps until the decryption operation and image reconstruction are completed at all pixel positions.
7. The chaotic encryption method for color images according to claim 1, It is characterized in that In S8, after the grayscale image is converted back to a color image, it is necessary to perform a security assessment on the encryption and decryption process. The steps of the security assessment are as follows: S81, performing statistical analysis on the grayscale image converted from the original color image in S1 of the chaotic encryption method for color images; S82, performing frequency domain analysis on the grayscale image: converting the grayscale image into the frequency domain by using Fourier transform, and detecting whether there are abnormal frequency components or noise by observing the spectrum diagram; S83, performing texture analysis on the grayscale image: performing texture analysis on the grayscale image through a local binary pattern to evaluate whether the texture feature of the grayscale image has changed; S84. In S8 of the chaotic encryption method for color images, the decrypted color image is compared with the original color image to evaluate whether its quality is affected.
8. The chaotic encryption method for color images according to claim 1, It is characterized in that In S8, the process of converting the color image into a grayscale image is as follows: S11. For each pixel position (i, j), obtain its RGB value; S12, calculating the average value of RGB values; S13, taking the average value as the grayscale value of the pixel position; S14, repeat S11-S13 until the grayscale values of all pixel positions are calculated; S15, remap the calculated grayscale value to the range of 0-255 to maintain the color representation of the image.
9. The chaotic encryption method for color images according to claim 4, It is characterized in that In S44, the steps of performing AES encryption on the chaotic pixel values are as follows: S44.
1. Generation of S-box: Initialize a 256x16 two-dimensional array as an S-box. For each possible input value i (0 to 255), calculate its corresponding output value j (0 to 15). Store the input value i and the output value j in the corresponding position of the S-box. After all possible input values are mapped, the S-box generation is completed. S44.
2. Round key expansion: Split the original key into multiple subkeys, each subkey is 4 bits long, and perform the following operations on each subkey: Initial permutation: rearrange the subkeys into a new subkey of length 4 according to predefined rules; Left shift operation: Shift the new subkey to the left by a fixed number of bits. The specific shift amount depends on the current round. Compression permutation: According to predefined rules, the new subkey is rearranged into a new subkey of length 4; Repeat the above steps until 11 subkeys are generated; S44.
3. Initial round: For each subkey, perform the following operations: Byte replacement: Use S-box to replace bytes on the input; Row shift: Circularly shift each row of the input matrix to the left by a different number of bits; Column confusion: Each column of the input matrix is multiplied modulo 2 by a fixed polynomial; Add round key: XOR the subkey with the current state; S44.4, subsequent rounds: For each subkey, perform byte replacement, row shift, column confusion, and round key addition. After multiple rounds of iterations, the MixColumns operation is not performed in the last round; S44.
5. Final output: After all rounds of processing, the final encryption result is obtained.
10. The chaotic encryption method for color images according to claim 5, It is characterized in that The training steps of the deep learning model are as follows: H1. Data preparation: Collect a large number of color images as training datasets to ensure the diversity and representativeness of the datasets; H2. Data preprocessing: preprocess color images, including grayscale, binarization, and normalization; H3. Build a model: Design a recurrent neural network model; H4. Loss function selection: The mean square error loss function is used to measure the difference between the model prediction results and the true label; H5. Optimizer selection: Update model parameters through stochastic gradient descent optimizer; H6. Hyperparameter tuning: Hyperparameter tuning can be performed by using the grid search method; H7, Model training: Input the preprocessed color image into the deep learning model and perform multiple rounds of iterative training; H8. Model evaluation: During the training process, use the cross-validation method to regularly evaluate the performance indicators of the model; H9. Model saving: When the model achieves satisfactory performance, save it as a reusable model file; H10. Model application: Apply the trained model to decrypt color images.
Citation Information
Cited By
Encryption method and decryption method of Internet of Vehicles data
CN121462701A
An encryption method and decryption method for vehicle networking data
CN121462701B
Information security encryption method based on cloud platform
CN122027751A
