# Enhancing Communication Security in Drones Using QRNG in Frequency Hopping Spread Spectrum
## 5 Implementation
### Generation and Synchronization of Frequency Hopping Sequences  
Using the RPU, true random numbers \(R_{o}\) are generated and mapped to frequency values \(f_{o}\) within a predefined band. The frequency for the \(o\)-th time interval is given by:  
\[f_{o}=f_{\text{min}}+(f_{\text{max}}-f_{\text{min}})\frac{R_{o}}{R_{\text{max}}}\]  
where \(R_{\text{max}}\) is the maximum possible output of the RPU. This mapping ensures that the frequencies are chosen randomly and uniformly over the band. A critical challenge in FHSS systems, especially when using true random frequency hopping sequences, is maintaining synchronization between the transmitter and receiver. Unlike traditional FHSS systems that use pseudo-random number generators (PRNGs) with shared seeds, our system relies on sequences that are inherently unpredictable and cannot be reproduced by generating devices independently. Therefore, both the transmitter and receiver must have access to the same sequence of random numbers or be able to generate them in a synchronized manner. To achieve secure and reliable synchronization in our system, we implement a two-stage process involving public-key cryptography and symmetric key encryption:  
* Initial Synchronization and Key Agreement: At the start of communication, the transmitter and receiver engage in a secure key exchange protocol using public-key cryptography, such as RSA or Elliptic Curve Cryptography (ECC). This allows them to securely agree upon a symmetric key without exposing it to potential eavesdroppers. The symmetric key established during this phase is used for encrypting subsequent communications, including the true random sequence and synchronization information. * Secure Distribution of Random Sequences: With the symmetric key in place, the transmitter securely transmits the necessary synchronization information and the initial segment of the true random frequency hopping sequence to the receiver. This information is encrypted using the symmetric key, ensuring that only authorized parties with the corresponding key can decrypt and access the sequence. The use of a symmetric key for encryption at this stage is crucial because symmetric algorithms like Advanced Encryption Standard (AES) are more efficient for handling larger amounts of data in real-time communication compared to public-key algorithms. Once the initial synchronization is achieved, both parties use the shared true random sequence for frequency hopping. To maintain synchronization over time, the system incorporates:  
* Periodic Resynchronization: Due to potential clock drift or communication delays, periodic resynchronization is necessary. The transmitter periodically sends encrypted synchronization beacons or timestamps using the established symmetric key. This allows the receiver to adjust its timing and ensures continuous alignment with the transmitter's hopping sequence. * Dynamic Key Updating: To enhance security, the symmetric key used for encryption can be updated periodically using key derivation functions or additional key exchange protocols. This reduces the risk of key compromise over extended periods and mitigates potential replay or interception attacks. * Robust Error Handling: The synchronization protocol includes mechanisms for error detection and correction to handle data loss or corruption due to channel impairments or malicious interference. This ensures that synchronization integrity is maintained even in adverse conditions. That is, to achieve secure and reliable synchronization in our system, we implement a two-stage process involving public-key cryptography and symmetric key encryption. Initially, the transmitter and receiver engage in a secure key exchange protocol using public-key cryptography to establish a symmetric key without exposing it to potential eavesdroppers. With the symmetric key in place, the transmitter securely transmits the necessary synchronization information and the initial segment of the true random frequency hopping sequence to the receiver using symmetric encryption.