# A Low-Complexity Security Scheme for Drone Communication Based on PUF and LDPC
## 3 Security Architecture
### QC-LDPC Encoding  
LDPC codes are a type of high-performance LBC. Their encoding method is similar to that of LBCs where in the codeword \(w=m\cdot G\ m\) is the message vector and \(G\) is a generating matrix. \(G\) consists of an identity matrix \(I\) and a parity-check matrix \(P\). LDPC codes have rules such that each parity-check bit supervises \(\rho\) message bits, and each message bit is supervised by \(\gamma\) parity-check bits. Additionally, in relation to the size of the matrix, both \(\rho\) and \(\gamma\) are typically small [26]. The principles of error correction for LDPC codes can be detailed in the paper on its origins [26]. LDPC codes have many construction methods; the performance of LDPC matrices constructed randomly is generally better than algebraic construction, but the matrices constructed randomly pose a challenge to the storage of drones. QC-LDPC is an algebraic construction method, and the nearly cyclic property greatly reduces the storage requirements [27; 28; 29; 30]. QC-LDPC is characterized by its parity-check matrix composed of zero and circulant permutation matrices. The check matrix can be expressed as follows:  
\[P^{T}= \begin{bmatrix}E^{c_{00}}&E^{c_{01}}&\cdots&E^{c_{0,n-1}}\\ E^{c_{10}}&E^{c_{11}}&\cdots&E^{c_{1,n-1}}\\ \vdots&\vdots&\ddots&\vdots\\ E^{c_{m-1,0}}&E^{c_{m-1,1}}&\cdots&E^{c_{m-1,n-1}}\end{bmatrix}  \tag{3}\]  
where \(E^{c_{ij}}(0\leq i\leq m-1,0\leq j\leq n-1)\) represents a \(b\times b\) circulant permutation matrix obtained by shifting the identity matrix to the right \(c_{ij}\in\{0,1,\ldots,b-1,-1\}\) times. If \(c_{ij}=-1\), it represents \(E\) as a zero matrix. The calculation method of \(c_{ij}\) is not unique, and this study adopts  
\[c_{ij}= \begin{cases}(i+1)k\bmod b&,a_{ij}=1,k\in\{0,1,\ldots,\rho-1\}\\ -1&,a_{ij}=0\end{cases}  \tag{4}\] \begin{table}
\begin{tabular}{c c c} \hline
**Parameters** & **Board 1** & **Board 2** \\ \hline Hamming weight of RAM & 382 & 414 \\ \hline Hamming distance of RAM & \multicolumn{2}{c}{358 bit/100 Byte = 44.75\%} \\ \hline The offset of the window & 4 & 24 \\ \hline The length of the window & 39 & 40 \\ \hline The number of unstable bits & 36 & 42 \\ \hline Still unstable ratio & 9.375\% & 7.8\% \\ \hline Probability of occurrence of & 2\% & 3\% \\ more than 2 bit flips & 2\% & 3\% \\ \hline Register ID & \
\begin{tabular}{c} ae0720286 ff7 ffdc4409 \\ 141a747f8d43400a336 \\ d7e840a50c07c2 ffea08 \\ 4000 \\ \end{tabular} &
\begin{tabular}{c} e1 eddf5 fc71090c6f591 \\ bee115201 bfffe670046 \\ ef67 ffd7 fd9000139337 \\ f79d \\ \end{tabular} \\ \hline Hamming weight of ID & 115(45\%) & 145(56.6\%) \\ \hline Hamming distance of ID & \multicolumn{2}{c}{154 b/256 bit = 60.16\%} \\ \hline \end{tabular}
\end{table} 
Table 4: Details of the stm324. where \(a_{ij}\) is an element of the base matrix. By replacing the element \(E^{c_{ij}}\) with \(c_{ij}\) in matrix \(P^{T}\), the shift parameter matrix \(C\) can be obtained:  
\[C= \begin{bmatrix}c_{00}&c_{01}&\cdots&c_{0,n-1}\\ c_{10}&c_{11}&\cdots&c_{1,n-1}\\ \vdots&\vdots&\ddots&\vdots\\ c_{m-1,0}&c_{m-1,1}&\cdots&c_{m-1,n-1}\end{bmatrix}  \tag{5}\]  
By replacing the element \"\(-1\)\" with \"\(0\)\" in matrix \(C\) and replacing the other elements with \"\(1\)\", the base matrix \(A\) can be obtained, where \(a_{ij}\in\{0,1\}\). \[A= \begin{bmatrix}a_{00}&a_{01}&\cdots&a_{0,n-1}\\ a_{10}&a_{11}&\cdots&a_{1,n-1}\\ \vdots&\vdots&\ddots&\vdots\\ a_{m-1,0}&a_{m-1,1}&\cdots&a_{m-1,n-1}\end{bmatrix}  \tag{6}\]  
It can be seen that for the codeword \(w=m\cdot G= \begin{bmatrix}m&m\cdot P\end{bmatrix} \), the key is to multiply with the message part \(m\). If represented by row vectors \(p_{i}\), \(P^{T}= \begin{bmatrix}p_{0},p_{1},\ldots,p_{n-k-1}\end{bmatrix} ^{T}\), it is \(w_{i}=m\cdot p_{i}=m_{0}p_{i0}+m_{1}p_{i1}+\ldots+m_{k}p_{ik}=\oplus_{p_{k}=1} m_{k},p_{ik}\in\{0,1\}\). Therefore, during encoding, it is only necessary to record the positions of \"\(1\)\" in each column of the matrix \(P^{T}\), \(p_{i}=