Image encryption and decryption method based on chaotic mapping
By using a composite chaotic system of logistic and tent mapping in underwater optical wireless communication combined with underwater environmental parameters to generate adaptive keys, and implementing forward error correction through Hamming code encoding, the security and reliability issues of UOWC are solved, and the environmental uniqueness of encrypted communication and the reliability of transmission are achieved.
Patent Information
- Application Number
- CN202510951989.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-09-05
AI Technical Summary
Existing underwater optical wireless communications (UOWC) have deficiencies in security and reliability, including insufficient complexity and security of the encryption system, lack of environmental context awareness and lack of channel error robustness, which leads to easy key reuse and unreliable data transmission.
A composite chaotic system based on logistic mapping and tent mapping is used to generate adaptive keys in combination with underwater environmental parameters. Forward error correction is implemented through Hamming code encoding to generate encrypted images and correct transmission errors during decryption.
It significantly enhances the security and context awareness of keys, improves the complexity and anti-cracking ability of encryption methods, ensures the reliability and integrity of data transmission, and enhances the robustness of communication systems.
Smart Images

Figure CN120602597A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a data feature-based security access technology in underwater self-organizing network wireless optical communication, and in particular to an image encryption and decryption method based on chaos mapping. Background Art
[0002] With the increase in human activities in underwater environments, such as marine safety and scientific research, there is an urgent need for safe, reliable, high-speed, and long-distance underwater wireless communications. The most widely used traditional underwater acoustic communication has problems such as low bandwidth, severe multipath fading, and long delay, while radio frequency communication suffers from severe attenuation in seawater and has a limited transmission distance. Underwater optical wireless communication (UOWC) has the characteristics of high bandwidth, low latency, and low power consumption. It can enhance the capacity and connectivity of underwater wireless networks based on acoustic and radio frequency communications, and is an attractive and competitive solution. However, due to the open nature of underwater channels and the gradual diffusion of beams during long-distance propagation, the transmission links of UOWC are vulnerable to malicious attacks. The security of UOWC has become an inevitable issue in practical applications, especially in underwater multi-user applications. In their paper "Security weaknesses of underwater wireless optical communication," Kong et al. first revealed the security vulnerabilities of UOWC. They numerically studied the security weaknesses of UOWC using Monte Carlo simulations and experimentally demonstrated a 2.5-Gbps OFDM-based UOWC system with potential eavesdropping capabilities, confirming that UOWC could be subject to serious security threats due to scattering effects. Furthermore, in their paper "Tapping underwater wireless optical communication in pure water and natural Dead-Sea ultra-high-salinity water by diffraction grating," D. Shaboy et al. demonstrated that message communications in a UOWC system could be eavesdropped without the sender or receiver's awareness by using diffraction gratings, and estimated the distance at which messages could be eavesdropped.
[0003] In recent years, chaotic encryption schemes have attracted attention and have become a possible solution for the confidentiality of transmitted data. In the paper "An Image Encryption Algorithm Using Logistic Map with Plaintext-Related Parameter Values", Oravec et al. proposed an image encryption algorithm based on logistic mapping and plaintext-related parameters. The parameter values of the logistic mapping are modified according to the pixel intensity of the plaintext image, thereby enhancing the security and complexity of the encryption. In the paper "Image Encryption and Decryption Based on Chaotic Algorithm", Hu et al. proposed the application of a two-stage logistic mapping algorithm in image encryption and decryption, and concluded through information entropy analysis that the algorithm is more secure than the original image. However, when existing general chaotic encryption schemes are directly applied to the harsh and dynamic underwater optical communication scenarios, their inherent limitations become apparent, mainly in the following aspects:
[0004] (1) Insufficient complexity and security of encryption systems: Existing schemes mostly use traditional single chaotic maps (such as logistic maps), which have relatively simple dynamic behaviors and limited chaotic intervals. When facing targeted cryptanalysis attacks, there is a risk of being predicted or cracked.
[0005] (2) Lack of contextual awareness of the environment: General encryption schemes ignore the special physical environment of underwater. They fail to utilize the unique and dynamically changing physical parameters underwater (such as temperature, pressure, brightness, etc.) to enhance the contextual awareness and spatiotemporal uniqueness of the key, resulting in the key being reused at different times and in different environments, leaving security risks.
[0006] (3) Lack of robustness against channel errors: The UOWC channel itself is susceptible to water disturbances, which can lead to transmission errors. Existing chaotic encryption schemes typically focus only on the encryption algorithm itself and fail to integrate any error correction mechanisms. Once a single bit error occurs in the encrypted data during transmission, the decryption process often results in large-scale data corruption due to the avalanche effect, making it impossible to guarantee the complete restoration of the information. Summary of the Invention
[0007] The purpose of this invention is to propose an image encryption and decryption method for underwater self-organizing network optical communication based on chaotic mapping to solve the above technical problems. The method includes the following steps:
[0008] (1) Encryption method:
[0009] Step (1), generating an adaptive key according to environmental parameters;
[0010] This step uses the shared initial key and real-time environmental physical parameters to generate a one-time adaptive key bound to the environmental state. It includes the following sub-steps:
[0011] Step (1.1), obtain input parameters;
[0012] Get the initial key K pre-shared by both parties initial (For example, a 128-bit or 256-bit random number), and environmental parameters collected in real time by underwater sensors, mainly including temperature T and pressure P.
[0013] Step (1.2), generate adaptive key K adaptive ;
[0014] Use a standard cryptographic hash function (preferably SHA-256) to convert the initial key K initial With temperature T and pressure P as input, a hash operation is performed to generate the final adaptive key K adaptive , its mathematical expression is: K adaptive =Hash(K initial ,T,P). The K generated in this way adaptive It is directly used as the key for initializing the subsequent chaotic system.
[0015] Step (2), using logistic mapping and tent mapping to generate a chaotic mapping sequence, includes the following sub-steps:
[0016] Step (2.1), initialize the logistic map and tent map;
[0017] Logistic map x n+1 =μ1x n (1-x n ), where x n and x n+1 represents the state of the logistic map at the nth and n+1th iterations, μ1 represents the control parameter;
[0018] Tent Mapping n+1 =μ2*min(y n ,1-y n ), where y n and y n+1 represents the state of the tent map at the nth and n+1th iterations, μ2 also represents the control parameter;
[0019] Using the adaptive key K adaptive As the initial value of the logistic mapping and tent mapping.
[0020] Step (2.2), iteratively generate chaotic mapping sequence;
[0021] Perform no less than 100 iterations of the logistic map and tent map to eliminate transient effects, and obtain the iterative sequence x i ,y i ; In each iteration, use z i =(x i +y i ) mod 1, we get the chaotic sequence z i , where mod represents the modulo operation.
[0022] Step (3), scrambling the image pixel positions according to the chaotic sequence;
[0023] This step uses the randomness of the chaotic sequence to disrupt the pixel spatial positions of the original image, including the following sub-steps:
[0024] Step (3.1), generate position mapping index;
[0025] For the chaotic sequence z generated in step (2.2) i Sort in ascending order; during the sorting process, record the original position index of each element before sorting, thereby obtaining a position mapping sequence Order(i); for example, if the smallest element in the original sequence z is in the lth position, then Order(1)=l.
[0026] Step (3.2), perform pixel position scrambling;
[0027] According to the position mapping sequence Order(i) generated in step (3.1), the original image I origin The pixels of the scrambled image are rearranged to generate the scrambled image Mim. The pixel value of the scrambled image at position i is equal to the pixel value of the original image at position Order(i). The mathematical relationship can be expressed as: Mim(i) = I origin (Order(i)),i=1,2,…,M*N。
[0028] Step (4), performing a diffusion operation on the scrambled image pixel value Mim(i) obtained in step (3) to generate an encrypted image E;
[0029] This step aims to change the statistical characteristics of the image through pixel-by-pixel encryption operations, which includes the following sub-steps:
[0030] Step (4.1), quantize the chaotic sequence;
[0031] The floating point chaotic sequence z generated in step (2.2) i Quantized into an 8-bit unsigned integer sequence Q_z(i) by the following formula: Q_z(i) = floor(z i*256), where floor() is the rounding down function.
[0032] Step (4.2), perform diffusion operation;
[0033] Perform an exclusive OR operation (XOR) on the scrambled pixel value Mim(i) obtained in step (3) and the quantized chaotic sequence value Q_z(i) to obtain the final encrypted image pixel value E(i), which is calculated as follows: in Represents a bitwise exclusive OR operation.
[0034] Step (5), performing Hamming code encoding on the encrypted image to generate the final codeword C, includes the following sub-steps:
[0035] Step (5.1), data preparation and parameter determination;
[0036] First, convert the 8-bit encrypted pixel value E(i) into its binary representation B(i) to obtain 8 data bits (k=8). Second, according to the Hamming code inequality 2 r ≥k+r+1(i.e. 2 r ≥8+r+1), determine the minimum number of parity check bits r required. Solving for r = 4. Therefore, the total length of the codeword C is n = k + r = 12 bits.
[0037] Step (5.2), codeword structure assembly;
[0038] Construct a framework for a 12-bit codeword C. According to the rules of Hamming code, place the four parity bits P1, P2, P3, and P4 at indices that are powers of 2, i.e., positions 1, 2, 4, and 8. Fill the remaining positions in codeword C with the eight data bits in sequence.
[0039] Step (5.3), calculate the value of the parity bit;
[0040] After the codeword frame is assembled, calculate each check bit P k The specific value of is obtained by XORing all the data bits in the codeword C that meet a specific condition. The condition is that in the binary representation of the position index j of the data bit, the kth bit from the right must be 1. The calculation process can be described as: in Indicates exclusive OR operation, C j Represents the value (0 or 1) of the data bit at the jth position in the entire codeword C. bit(j,k)=1 means that in the binary representation of the data bit position index j, the kth bit from the right must be 1.
[0041] Calculate all P kAfter the value of is obtained, it is filled into the position reserved in step (5.2) to form the final, complete 12-bit codeword C.
[0042] This process is repeated for all pixels of the encrypted image E, and the resulting multiple codewords C are concatenated to form the final data stream to be sent.
[0043] The encryption method process ends.
[0044] (2) Decryption method:
[0045] The decryption method is the inverse process of the encryption method, which aims to recover the original image I from the received codeword R, which may contain errors. origin This method requires the receiver to have the same initial key K as the sender. initial , and can obtain the same underwater environmental parameters (temperature T, pressure P) as during encryption. The steps are as follows:
[0046] Step (6), performing Hamming decoding and error correction on the received codeword to restore the encrypted image pixel E(i);
[0047] Since errors may occur during codeword transmission in underwater channels, the received codeword R=(R1, R2…, R n ) may be related to the original codeword C=(C1,C2…,C n ) are different. This step is intended to detect and correct these errors. It includes the following sub-steps:
[0048] Step (6.1), calculate symptoms (Syndrome);
[0049] For each parity bit position k, where k = 1, 2, 3, ..., calculate its corresponding syndrome bit The calculation of the syndrome bits is the same as that of the check bits during encryption, but applied to the received codeword R: in, Represents exclusive OR operation, R j is the value of the received codeword R at position j, and bit(j,k)=1 is the value of the kth bit in the binary representation of position index j.
[0050] Step (6.2), positioning error;
[0051] All calculated symptoms The numbers are combined in sequence (…s3s2s1) to form a binary number. If the value of this number is 0, it indicates that there is no error in the transmission. If the value is non-zero, its decimal value indicates the codeword position where the single-bit error occurred.
[0052] Step (6.3), correct the error and extract the encrypted data;
[0053] The bit values at the error position are flipped (0 to 1, 1 to 0). After correcting the error, all parity bits are removed from the codeword and the remaining data bits are reassembled to obtain the error-free binary representation of the encrypted image pixel B(i). Finally, B(i) is converted to decimal to obtain the encrypted image pixel E(i).
[0054] Step (7), regenerate the chaotic encryption sequence and scrambling mapping table;
[0055] In order to perform decryption, the chaotic sequence and scrambled position mapping table that are exactly the same as those used for encryption must be regenerated. This includes the following sub-steps:
[0056] Step (7.1), regenerate the adaptive key K adaptive ;
[0057] To decrypt, the receiver must generate the same adaptive key that the sender used to encrypt. initial , and use local sensors to obtain underwater environmental parameters (temperature T, pressure P) similar to those of the encryption channel, and calculate through the hash function exactly the same as step (1) of the encryption method to generate the adaptive key K adaptive .
[0058] Step (7.2), generate chaotic sequence z i and the position mapping sequence Order(i);
[0059] Use K adaptive As the initial condition, the same chaotic sequence z is iteratively generated by the composite system of logical Tees map and tent map as in step (2) of the encryption method. i At the same time, i Sort in ascending order, record the original index, and generate the same position mapping sequence Order(i) as that during encryption.
[0060] Step (8), perform inverse diffusion operation to obtain scrambled image pixels Mim(i);
[0061] This step is the inverse operation of step (4) of the encryption method, which aims to eliminate the masking of pixel values by the chaotic sequence. It includes the following sub-steps:
[0062] Step (8.1), quantize the chaotic sequence;
[0063] The chaotic sequence z regenerated in step (7.2) i Perform the same quantization operation as step (4.1) of the encryption method to obtain an 8-bit unsigned integer sequence Q_z(i): Q_z(i) = floor(z i *256);
[0064] Step (8.2), perform reverse diffusion;
[0065] Perform an XOR operation on the encrypted image pixel E(i) obtained in step (6) and the quantized chaotic sequence value Q_z(i) to restore the pixel value Mim(i) of the scrambled image; the calculation formula is:
[0066] Step (9): perform the inverse scrambling operation to restore the original image I origin ;
[0067] This step is the inverse operation of step (3) of the encryption method, and aims to restore the scrambled pixels to their original spatial positions.
[0068] Using the position mapping sequence Order(i) generated in step (7.2) and the scrambled image pixels Mim(i) obtained in step (8), the pixel values are placed back to their original positions through the following relationship to reconstruct the original image I origin :For i=1,2,…,M*N, execute I origin (Order(i))=Mim(i). This operation means placing the i-th pixel of the Mim image into the I origin The Order(i)th position of .
[0069] Step (10), output the original image I origin .
[0070] The decryption method process ends.
[0071] Beneficial effects of the present invention:
[0072] Compared with the prior art, the beneficial effects of the present invention are embodied in:
[0073] 1) Significantly Enhanced Key Security and Contextual Awareness: This invention utilizes dynamic underwater physical environmental parameters (such as temperature and pressure) as core elements for key generation. This ties key generation to specific time, location, and environmental conditions, achieving a "one-scene, one-key, one-time" encryption effect. This makes it difficult for attackers to infer keys for other scenarios based on a given ciphertext, ensuring that encrypted communications are both environmentally unique and spatiotemporally dynamic.
[0074] 2) Improved inherent complexity and cracking resistance of the encryption method: This invention utilizes a composite chaotic system composed of a logistic map and a tent map. Compared to the single chaotic map commonly used in the prior art, this composite system exhibits superior chaotic properties, such as a wider chaotic interval. This complexity makes the chaotic sequence more difficult to predict, thereby enhancing the encryption method's resistance to cryptanalysis attacks such as statistical analysis.
[0075] 3) Ensures data transmission reliability and integrity over poor channels: This invention adds redundancy protection to transmitted data by cascading forward error correction codes, such as Hamming codes, after encryption. The receiving end can use this code to proactively detect and correct transmission errors within a certain range, thereby recovering the accurate encrypted image. This ensures that the original information can be fully and reliably decrypted even in the presence of signal attenuation or poor channel quality, significantly improving the robustness of the entire communication system. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 This is an architectural diagram of the image encryption and decryption method based on chaotic mapping proposed in the present invention;
[0077] Figure 2 This is a flow chart of the image encryption method based on chaotic mapping proposed by the present invention;
[0078] Figure 3 This is a flow chart of the image decryption method based on chaotic mapping proposed by the present invention;
[0079] Figure 4 This is the result diagram of the core method process verification in the simulation experiment of the present invention, where (a) is the original image, (b) is the encrypted image, (c) is the decryption (including transmission errors and no error correction), and (d) is the decryption (after Hamming code error correction).
[0080] Figure 5 are histograms of pixel values of the original image and the encrypted image in the simulation experiment of the present invention, where (a) is the histogram of the original image and (b) is the histogram of the encrypted image;
[0081] Figure 6 This is an analysis diagram of the correlation between adjacent pixels of the original image and the encrypted image in the simulation experiment of the present invention, where (a) is the original image and (b) is the encrypted image;
[0082] in, Figure 1 The solid arrows in the figure represent the encryption process, and the dotted arrows represent the decryption process. DETAILED DESCRIPTION
[0083] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are intended to explain the present invention, rather than to limit the scope of protection of the present invention.
[0084] System architecture and goals
[0085] Reference Figure 1, the present invention proposes an image encryption and decryption method based on chaotic mapping, which is applied to the underwater self-organizing network wireless optical communication (UOWC) scenario. The basic architecture of the system includes multiple underwater communication nodes (such as submersibles, sensor base stations, etc.), which can perform optical communication underwater and are equipped with sensors to collect environmental physical parameters (such as temperature and pressure) at their locations. The goal of the present invention is to encrypt and channel encode the image when a node (sender) needs to securely transmit image data to another node (receiver) to resist eavesdropping and transmission errors; the receiver can then perform corresponding decryption and error correction to restore the original image.
[0086] Specific embodiment of the encryption process
[0087] Reference Figure 2 , a complete image encryption process may include the following steps:
[0088] Step 1: Generate environment-adaptive key K adaptive .
[0089] The sender first obtains two core inputs: an initial key K pre-shared with the receiver initial , and underwater environmental parameters collected in real time by local sensors, mainly including temperature T and pressure P. Subsequently, a standard cryptographic hash function (preferably SHA-256) is used to operate on these three to generate an adaptive key K that is strongly related to the current physical environment. adaptive The process can be expressed as K adaptive =Hash(K initial ,T,P).
[0090] Step 2: Generate chaotic sequence z i .
[0091] Use the K generated in the previous step adaptive As the initial condition, a chaotic system composed of logistic mapping and tent mapping is initialized. By iterating the composite system, a chaotic sequence z with excellent randomness and complexity is generated. i To eliminate transient effects, the results of the first several iterations (e.g., 100) are discarded.
[0092] Step 3: Permutation of image pixel positions.
[0093] In order to disrupt the structural information of the image, this step is to origin The pixel positions of the chaotic sequence z are scrambled. iSort in ascending order and record the position index of each element in the original sequence after sorting, thus obtaining a position mapping sequence Order(i). Then, rearrange the pixels according to the mapping sequence to generate the scrambled image Mim, the relationship of which is Mim(i)=I origin (Order(i)),i=1,2,…,M*N。
[0094] Step 4: Image pixel value diffusion (Diffusion).
[0095] In order to change the statistical characteristics of the image, this step confuses the scrambled pixel values. First, the floating point chaotic sequence z i Quantized into an 8-bit integer sequence Q_z(i). Then, the pixel Mim(i) of the scrambled image is subjected to bit-by-bit XOR operation with Q_z(i) to obtain the encrypted image E, which is represented by
[0096]
[0097] Step 5: Hamming code channel coding.
[0098] Considering the potential for bit errors in underwater optical channels, this step performs forward error correction encoding on the encrypted image E. Each pixel value in E is converted to binary, and a Hamming code method is applied to calculate and append parity bits, ultimately generating a codeword C with error correction capabilities. Finally, the sending node transmits codeword C through its optical communication module.
[0099] Specific embodiment of the decryption process
[0100] Reference Figure 3 After receiving the data, the receiving node performs the operations that are completely opposite to the encryption process:
[0101] Step 1: Hamming code decoding and error correction.
[0102] The receiver receives a codeword R that may contain errors. First, it calculates the codeword's syndrome. If the syndrome is all zero, it indicates no errors; if it is non-zero, its value indicates the location of a single bit error. The receiver corrects the error by flipping the error bit and then removes all parity bits, thereby recovering the error-free encrypted image E.
[0103] Step 2: Regenerate the key and chaos sequence.
[0104] The receiver uses the same K shared with the sender initial , and collect local environmental parameters T and P, perform the same operation as the first step of the encryption process, and regenerate K adaptiveThen, the same operation as the second step of the encryption process is performed to generate a completely consistent chaotic sequence z i and position mapping sequence Order(i).
[0105] Step 3: Reverse diffusion.
[0106] Perform an XOR operation on the pixel value of the encrypted image E and the locally regenerated chaotic sequence Q_z(i) that has undergone the same quantization process. Thus the scrambled image Mim(i) is restored.
[0107] Step 4: Reverse the scrambling.
[0108] Using the position mapping sequence Order(i), the disrupted pixel Mim(i) is restored to its original position I origin (Order(i))=Mim(i), and finally reconstruct the original image I origin .
[0109] Experimental verification and effect analysis
[0110] In order to further verify the effectiveness and safety of the method described in the present invention, a series of simulation experiments were conducted. The experiment used a 256x256 pixel standard grayscale image as the original image I origin .
[0111] 1. Method flow and error correction capability verification (refer to Figure 4 )
[0112] Figure 4 The visual effect of the method of the present invention in the complete encryption-transmission-decryption process is demonstrated.
[0113] son Figure 4 (a) in the figure is the original image, which has clear visual structure and content.
[0114] son Figure 4 (b) is the encrypted image E obtained after being processed by the encryption method of the present invention. As can be seen from the figure, any structural information of the original image has been completely hidden, and the image appears as a noise-like form without any regularity, proving the effectiveness of the encryption method.
[0115] To simulate the transmission error of the UOWC channel, the present invention randomly flips a bit in the codeword C after Hamming encoding the encrypted image E to generate a damaged codeword R.
[0116] son Figure 4Panel (c) shows the result of decrypting encrypted data damaged by transmission errors without using Hamming code error correction. Small bit errors are amplified after decryption, resulting in pixel errors or color blocks in the image, demonstrating that data integrity cannot be guaranteed without error correction.
[0117] son Figure 4 Figure (d) shows the final decryption result of the present invention. The received corrupted codeword R first passes through the Hamming decoding module, which successfully detects and corrects the single-bit error, recovering the correct encrypted image E. The complete decryption process then proceeds. The resulting image is visually almost indistinguishable from the original, demonstrating that the integrated Hamming code mechanism of the present invention can effectively combat channel noise, ensuring the reliability and robustness of communication.
[0118] 2. Statistical safety analysis (refer to Figure 5 )
[0119] Figure 5 The statistical characteristics of the images before and after encryption are compared through pixel value histograms to evaluate the method's ability to resist statistical attacks.
[0120] son Figure 5 (a) in the figure is the histogram of the original image. The figure shows obvious peaks and valleys, and the distribution of pixel values is extremely uneven, which exposes the statistical laws of the original data and is a potential security vulnerability.
[0121] son Figure 5 (b) shows the histogram of the encrypted image using our method. Compared to the original image, the histogram distribution of the encrypted image becomes flat and uniform. This indicates that in the encrypted image, every pixel value from 0 to 255 appears with almost equal frequency. This uniform distribution prevents attackers from obtaining any valid information about the plaintext or key by analyzing the statistical patterns of pixel values, demonstrating the security of our method.
[0122] 3. Spatial correlation safety analysis (refer to Figure 6 )
[0123] Figure 6 The ability of the method to break the spatial structure of the original data is evaluated by analyzing the correlation of adjacent pixel values.
[0124] son Figure 6 (a) shows the numerical distribution of horizontally adjacent pixel pairs (P(row,col),P(row,col+1)) in the original image. As can be seen, almost all points are tightly clustered near the diagonal, exhibiting a strong linear correlation. This reflects the inherent characteristic of natural images where adjacent regions have highly consistent content.
[0125] son Figure 6 Panel (b) shows the distribution of corresponding pairs of adjacent pixels in the encrypted image. All points in the figure are evenly and randomly scattered across the entire two-dimensional plane, completely eliminating the original diagonal clustering trend. This demonstrates that the scrambling and diffusion process of our invention successfully breaks the spatial correlation between pixels, making it impossible for attackers to exploit local correlations between pixels to predict or recover image content, further demonstrating the high security of our method.
[0126] The above experiments have verified that the image encryption and decryption method proposed in the present invention has excellent performance in effectively hiding image information, resisting statistical and spatial analysis attacks, and ensuring the integrity of data transmission under harsh channels.
[0127] In summary:
[0128] The present invention effectively solves the dual challenges of security and reliability faced by underwater wireless optical communication (UOWC) through a multi-layer security and reliability design.
[0129] The key lies in using dynamic underwater physical environment parameters (such as temperature and pressure) as the core elements for key generation, binding the key to a specific time, location, and environmental state, achieving the encryption effect of "one key per scene, one key per time." This gives the encrypted communication environment uniqueness and spatiotemporal dynamics, making it difficult for an attacker to infer the key for other scenarios even if they intercept a ciphertext.
[0130] Based on this, the present invention uses a composite chaotic system composed of a logistic map and a tent map to generate encryption sequences. Compared to traditional single chaotic maps, this composite system exhibits a wider chaotic range and more complex chaotic properties, further enhancing the method's ability to resist cryptographic attacks such as statistical analysis.
[0131] Finally, to address the realities of poor UOWC channels and the proneness of data errors, the present invention cascades forward error correction (Hamming code) after encryption. This design ensures that the original information can be fully and reliably recovered even in the presence of signal attenuation or poor channel quality, significantly improving the robustness of the entire communication system.
[0132] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the foregoing embodiments. The foregoing embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.
Claims
1. An image encryption and decryption method based on chaotic mapping for underwater self-organizing network optical communication, characterized in that: The following steps are involved: (1) Encryption method: Step (1), generating an adaptive key according to environmental parameters; Using the shared initial key and real-time environmental physical parameters, a one-time adaptive key bound to the environmental state is generated, which includes the following sub-steps: Step (2) uses logistic mapping and tent mapping to generate a chaotic mapping sequence. Step (3), scrambling the image pixel positions according to the chaotic sequence; Step (4), performing a diffusion operation on the scrambled image pixel values obtained in step (3) to generate an encrypted image E; Step (5), encode the encrypted image into Hamming code to generate the final codeword C; (2) Decryption method: The decryption method is the inverse process of the encryption method, which aims to recover the original image I from the received codeword R, which may contain errors. origin ; This method requires the receiver to have the same initial key K as the sender initial , and can obtain the same underwater environmental parameters as those during encryption: temperature T, pressure P; The steps are as follows: Step (6), performing Hamming decoding and error correction on the received codeword to restore the encrypted image pixel E(i); Step (7), regenerate the chaotic encryption sequence and scrambling mapping table; Step (8), perform inverse diffusion operation to obtain scrambled image pixels Mim(i); Step (9): perform the inverse scrambling operation to restore the original image I origin ; Step (10), output the original image I origin .
2. The image encryption and decryption method based on chaotic mapping according to claim 1, characterized in that: The step (1) is specifically as follows: Step (1.1), obtain input parameters; Get the initial key K pre-shared by both parties initial , and environmental parameters collected in real time by underwater sensors, mainly including temperature T and pressure P; Step (1.2), generate adaptive key K adaptive ; Use a standard cryptographic hash function to convert the initial key K initial With temperature T and pressure P as input, a hash operation is performed to generate the final adaptive key K adaptive , its mathematical expression is: K adaptive =Hash(K initial ,T,P); K generated in this way adaptive It is directly used as the key for initializing the subsequent chaotic system.
3. The image encryption and decryption method based on chaotic mapping according to claim 1, characterized in that: The step (2) is specifically as follows: Step (2.1), initialize the logistic map and tent map; Logistic map x n+1 =μ1x n (1-x n ), where x n and x n+1 represents the state of the logistic map at the nth and n+1th iterations, μ1 represents the control parameter; Tent Mapping n+1 =μ2*min(y n ,1-y n ), where y n and y n+1 represents the state of the tent map at the nth and n+1th iterations, μ2 also represents the control parameter; Using the adaptive key K adaptive As the initial value of the logistic map and the tent map; Step (2.2), iteratively generate chaotic mapping sequence; Perform no less than 100 iterations of the logistic map and tent map to eliminate transient effects and obtain the iterative sequence x i ,y i ; In each iteration, use z i =(x i +y i ) mod 1, we get the chaotic sequence z i , where mod represents the modulo operation.
4. The image encryption and decryption method based on chaotic mapping according to claim 1, characterized in that: The step (3) utilizes the randomness of the chaotic sequence to disrupt the pixel spatial positions of the original image, and includes the following sub-steps: Step (3.1), generate position mapping index; For the chaotic sequence z generated in step (2.2) i Sort in ascending order; during the sorting process, record the original position index of each element before sorting, thereby obtaining a position mapping sequence Order(i); step (3.2), perform pixel position scrambling; According to the position mapping sequence Order(i) generated in step (3.1), the original image I origin The pixels of the scrambled image are rearranged to generate the scrambled image Mim; the pixel value of the scrambled image at position i is equal to the pixel value of the original image at position Order(i), and the mathematical relationship can be expressed as: Mim(i)=I origin (Order(i)),i=1,2,…,M*N。 5. The image encryption and decryption method based on chaotic mapping according to claim 1, characterized in that: The step (4) aims to change the statistical characteristics of the image through pixel-by-pixel encryption operations, and includes the following sub-steps: Step (4.1), quantize the chaotic sequence; The floating point chaotic sequence z generated in step (2.2) i Quantized into an 8-bit unsigned integer sequence Q_z(i) by the following formula: Q_z(i) = floor(z i *256), where floor() is the rounding down function; Step (4.2), perform diffusion operation; The scrambled pixel value Mim(i) obtained in step (3) is XORed with the quantized chaotic sequence value Q_z(i) to obtain the final encrypted image pixel value E(i). The calculation formula is: E(i) = in Represents a bitwise exclusive OR operation.
6. The image encryption and decryption method based on chaotic mapping according to claim 1, characterized in that: The step (5) is specifically as follows: Step (5.1), data preparation and parameter determination; First, convert the 8-bit encrypted pixel value E(i) into its binary representation B(i) to obtain 8 data bits, k = 8; second, according to the Hamming code inequality 2 r ≥k+r+1, that is, 2 r ≥8+r+1, determine the minimum number of parity check bits r required; the solution is r=4; Therefore, the total length of the final generated codeword C is n=k+r=12 bits; Step (5.2), codeword structure assembly; Construct a framework for a 12-bit codeword C. According to the rules of Hamming code, place the four parity bits P1, P2, P3, and P4 at indices that are powers of 2, i.e., positions 1, 2, 4, and 8. Fill the remaining positions in codeword C with the eight data bits in sequence. Step (5.3), calculate the value of the parity bit; After the codeword frame is assembled, calculate each check bit P k The specific value of is obtained by performing an XOR operation on all data bits in the codeword C that meet a specific condition; the condition is that in the binary representation of the position index j of the data bit, the kth bit from the right must be 1; The calculation process can be described as: Where ⊕ represents the exclusive OR operation, C j Represents the value of the data bit at position j in the entire codeword C. Bit(j,k) = 1 means that in the binary representation of the data bit position index j, the kth bit from the right must be 1; Calculate all P k After the value of is obtained, it is filled into the position reserved in step (5.2), thus forming the final, complete 12-bit codeword C; This process is repeated for all pixels of the encrypted image E, and the resulting multiple codewords C are concatenated to form the final data stream to be sent.
7. The image encryption and decryption method based on chaotic mapping according to claim 1 is characterized in that: The step (6) is specifically as follows: Since errors may occur during codeword transmission in underwater channels, the received codeword R=(R1, R2…, R n ) may be related to the original codeword C=(C1,C2…,C n ) are different; this step is intended to detect and correct these errors; The following sub-steps are included: Step (6.1), calculate symptoms; For each parity bit position k, where k = 1, 2, 3, ..., calculate its corresponding syndrome bit The calculation of the syndrome bits is the same as that of the check bits during encryption, but applied to the received codeword R: Among them, ⊕ represents the exclusive OR operation, R j is the value of the received codeword R at position j, bit(j,k)=1 is the value of the kth bit in the binary representation of position index j; Step (6.2), positioning error; All calculated symptoms Combined into a binary number in sequence; if the value of this number is 0, it means that there is no error in the transmission; if the value is non-zero, its decimal value indicates the code word position where the single-bit error occurred; Step (6.3), correct the error and extract the encrypted data; The bit values at the error position are flipped: 0 becomes 1, and 1 becomes 0. After correcting the error, all parity bits are removed from the codeword and the remaining data bits are reassembled to obtain the error-free binary representation of the encrypted image pixel B(i). Finally, B(i) is converted to decimal to obtain the encrypted image pixel E(i).
8. The image encryption and decryption method based on chaotic mapping according to claim 1, characterized in that: The step (7) is specifically as follows: in order to perform decryption, the chaotic sequence and scrambling position mapping table that are exactly the same as those used in encryption must be regenerated; it includes the following sub-steps: Step (7.1), regenerate the adaptive key K adaptive ; To decrypt, the receiver must generate the exact same adaptive key that the sender used to encrypt; Use the initial key K pre-shared by both parties initial , and use local sensors to obtain underwater environmental parameters similar to those of the encryption channel: temperature T, pressure P, and calculate through the hash function exactly the same as step (1) of the encryption method to generate the adaptive key K adaptive ; Step (7.2), generate chaotic sequence z i and the position mapping sequence Order(i); Use K adaptive As the initial condition, the same chaotic sequence z is iteratively generated by the composite system of logical Tees map and tent map as in step (2) of the encryption method. i At the same time, i Sort in ascending order, record the original index, and generate the same position mapping sequence Order(i) as that during encryption.
9. The image encryption and decryption method based on chaotic mapping according to claim 1, characterized in that: Said step (8) is the inverse operation of step (4) of the encryption method, and is intended to eliminate the masking of pixel values by the chaotic sequence; The following sub-steps are included: Step (8.1), quantize the chaotic sequence; The chaotic sequence z regenerated in step (7.2) i Perform the same quantization operation as step (4.1) of the encryption method to obtain an 8-bit unsigned integer sequence Q_z(i): Q_z(i) = floor(z i *256); Step (8.2), perform reverse diffusion; Perform an XOR operation on the encrypted image pixel E(i) obtained in step (6) of the encryption method and the quantized chaotic sequence value Q_z(i) to restore the pixel value Mim(i) of the scrambled image; The calculation formula is:
10. The image encryption and decryption method based on chaotic mapping according to claim 1, characterized in that: Said step (9) is the inverse operation of step (3) of the encryption method, and is intended to restore the disrupted pixels to their original spatial positions; Using the position mapping sequence Order(i) generated in step (7.2) and the scrambled image pixels Mim(i) obtained in step (8), the pixel values are placed back to their original positions through the following relationship to reconstruct the original image I origin :For i=1,2,…,M*N, execute I origin (Order(i))=Mim(i); This operation means placing the i-th pixel of the Mim image to I origin The Order(i)th position of .