## 4 Encryption Process
### Chunking Disorder Process  
Upon receiving the number of iterations m, a set of chaotic swapping algorithms is generated within the system, which consists of the following four parts.  
In adjacent parity exchange, the first and second blocks of the chunked data are exchanged, the third and fourth blocks are exchanged, and the penultimate block is exchanged with the last block. The head and tail engage in a pattern of decreasing exchange; that is, after chunking, the head and tail of the data block exchange positions until they have exchanged with the middlemost two. The specific position of the first block of data after chunking with the last block must exchange the second block with the penultimate block of data until the exchange between the middlemost two blocks is complete. Adjacent odd blocks are exchanged by swapping each of the two odd bits of data from the beginning. Adjacent even blocks are swapped by swapping each of the two even bits of data from the header.  
Moreover, the above algorithm is labeled as One, two, three, and four at a time for the chaotic exchange process, as shown in Table 1 (suppose the plaintext is 123456789 and the chunk size is 2).  
The pseudo-code of the disordered exchange Algorithms 1-4 is as follows:  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Position Number** & **1** & **2** & **3** & **4** \\ \hline Position 0 & 34 & 78 & 12 & 56 \\ Position 1 & 12 & 56 & 78 & 34 \\ Position 2 & 78 & 34 & 56 & 12 \\ Position 3 & 56 & 12 & 34 & 78 \\ Position 4 & 9 & 9 & 9 & 9 \\ Final data & 341278569 & 785634129 & 127856349 & 563412789 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Diagram of chunked disorderly exchange.  
Figure 1: Resource platform architecture diagram.  
```
0:\(str\)\(\triangleright\) Data to be chunked for\(k\gets 0\) to \(str\_length-1\)do \(Swap(str[i],str[i+1])\)\(\triangleright\) Exchange \(k\gets k+2\) endfor
```  
**Algorithm 1** Parity of exchange  
```
0:\(str\)\(\triangleright\) Data to be chunked for\(k\gets 0\) to \(str\_length-2\)do \(Swap(str[i],str[i+2])\)\(\triangleright\) Exchange \(k\gets k+4\) endfor
```  
**Algorithm 2** HeadTail of exchange  
```
0:\(str\)\(\triangleright\) Data to be chunked for\(k\gets 1\) to \(str\_length-2\)do \(Swap(str[i],str[i+2])\)\(\triangleright\) Exchange \(k\gets k+4\) endfor
```  
**Algorithm 3** Odd of exchange  
The data are combined based on the above-mentioned chunking disorder rules in the following way:  
* Generate a random integer n as the random chunk size, chunk the plaintext message according to the random chunk size n, record the message length as the length, and obtain the chunk string S.
* If the last chunk length does not satisfy the chunk size n, then the last unsatisfied chunk is treated as a separate chunk, and finally, the number of chunks is counted.
* In the chunking process, the chunk size interval is defined as [2; 9].
* Generate a random integer T as the selected chaotic exchange algorithm number. Select the chaotic exchange algorithm corresponding to this number and perform a chaotic exchange of the current chunk string S according to the corresponding algorithm.
* Splice the chunk size n of the data with the algorithm number T to obtain a sharing code \(key=nT\).
* Iterate the above process m times; then, splice the sharing code of the m times chaotic exchange in order to obtain the final sharing code FinalKey and the encrypted data SplitSTR. Record the length of the sharing code FinalKey as K.
* Adopt the 16-bit lowercase in MD5 encryption. Take the MD5 value to the plaintext message to define the data as N, and take the MD5 value to the encrypted data SplitSTR string MD5 value to define the encrypted data as M.