# A Low-Complexity Security Scheme for Drone Communication Based on PUF and LDPC
## 3 Security Architecture
### Error Correction Schemes
#### 3.4.3 Decoding Algorithm Selection  
The decoding algorithm of LDPC codes is divided into the bit-flipping (BF) algorithm and the belief propagation (BP) algorithm [31; 32; 33]. BP decoding algorithms require channel information; for example, in an AWGN channel, one can calculate the probability of each bit being in error using the statistical information of the noise and performance decoding using maximum likelihood (ML) probability. However, in a BSC channel, knowledge of the statistical transition probabilities of each bit is required, but as the ML information is binary, there is less useful information available for BP. Even though the flipping probabilities of unstable bits can be measured in the previous section, and considering the need to store additional information in the drone, which is not conducive to PUF security (as it implicitly reveals potential error-prone locations), this study adopts the BF algorithm [34], as shown in Algorithm 1. Although its performance is not as good as the BP algorithm, its simplicity and lack of floating-point operations make it very suitable for resource-limited drone devices. However, the BF algorithm always flips the information bits by the parity bit first, until the flip functions are all equal; subsequently, it corrects the parity bit and then re-corrects the information bits. When the flip functions converge to unity, they likely enter a dead loop or indeed solve a legal codeword, but not the target codeword. ```
1: Initialize with the maximum number of iterations \(I_{\text{max}}\). 2: Initialize the hard judgment sequence \(z^{(1)}=\left\{z_{1}^{(1)},z_{2}^{(1)},\ldots,z_{n}^{(1)}\right\}\). 3:For\(k=0;\ k<I_{\text{max}}\); \(k++\)do
4: Initialize with the all-zero flag \(flag=1\)
5:For\(i=0;\ i<256;\ i++\)do
6: Calculate the symbol position of row \(i\) of the matrix \(H\)
7: Calculate the syndromes \(s_{i}^{(k)}=z^{(k)}\cdot H^{\text{T}}(:,i)\)
8:If\(s_{i}^{(k)}=1\)then\(flag=0\)end
9:Endfor
10:If\(flag=1\)thenbreak end
11: Initialize with the maximum value \(E_{\text{max}}=0\);
12:For\(j=0;\ j<256;\ j++\)do
13: Calculate the flip function \(E_{j}^{(k)}=\sum\limits_{j\in M_{j}}(2s_{i}^{(k)}-1)\)
14:If\(E_{j}^{(k)}>E_{\text{max}}\)then\(E_{\text{max}}=E_{j}^{(k)}\)end
15:Endfor
16:For each\(E_{j}\in E^{(k)}\)do
17:If\(E_{j}=E_{\text{max}}\)then\(z_{j}^{(k+1)}!=z_{j}^{(k)}\)

Figure 4: The two-hop range of the m5. #### 3.4.4 BF Algorithm Optimization

For the above situation, directional improvement is achieved by combining the characteristics of the protocol in this study: symmetrical error position of the information bit and the parity bit, but asymmetrical position of the information bit and its parity bit. Improvement is quite simple, according to the characteristics of the BF algorithm; the information bit and the parity bit in a symmetric position are flipped at the same time. Using the Monte Carlo method to simulate the above process, the main flow is shown in Figure 5 (the decoding process is not affected by where the perturbation comes from); the number of bits for each perturbation is simulated for 50,000 frames, and the decoding results are shown in Figure 6. In the context of this study, the power-up perturbation and GS perturbation are generally 3-4 bits, and its bit error rate (BER) is \(6.87<10^{-5}\); the average number of iterations is 2.5. Figure 5: Monte Carlo simulation. Figure 6: BER and average number of iterations. Note that symmetric BF (SYM\(-\)BF) is robust to symmetric errors, but if an asymmetric error occurs, there is a high probability that the maximum number of iterations is exceeded and the decoding fails. This feature can invalidate some attack methods that do not follow the protocol. For example, using the last stolen check information to decode the next power-up ID will decode the \(ID_{\delta}\) if and only if the two perturbations are identical. For intrusive attacks on replicated RAM, it is required that the replication error be no more than a few bits.