# QESIF: A Lightweight Quantum-Enhanced IoT Security Framework for Smart Cities
## 3 System Design and Components
### Hybrid Protocol Stack Design
On the other hand, when \(\mathcal{Q}_{\text{adapt}}(t)=0\), the system switches to classical encryption protocols, such as AES or RSA, for data protection. The stack is composed of the following layers: 1. Application Layer: Standard IoT protocols (e.g., MQTT or CoAP) are used for device-to-device communication. The data packets may be quantum-secured or classically encrypted depending on the quantum adaptation function. 2. Transport Layer: It is where the hybrid encryption protocol is implemented that dynamically switches between the quantum-secured and classical encryption based on \(\mathcal{Q}_{\text{adapt}}(t)\). 3. Network Layer: Controls the communication of the quantum keys using QKD protocols (e.g., BB84 or E91), or classical keys if the quantum mode is not available. It ensures that the distribution and refreshing of keys are carried out according to the function of quantum adaptation. 4. Physical Layer: Includes the actual quantum channel of key exchange and classical communication networks (e.g., Wi-Fi and Zigbee). It is on the physical layer that the infrastructure of both quantum communication and classical data transfer is implemented. For successful key management, the usage function of the quantum key \(\mathcal{U}_{K}(t)\) is defined as  
\[\mathcal{U}_{K}(t)=\frac{K_{\text{generated}}(t)}{K_{\text{max}}(t)} \tag{6}\]  
where  
* \(K_{\text{generated}}(t)\) is the total number of valid quantum keys generated by the QKD system at time \(t\). * \(K_{\text{max}}(t)\) is the maximum possible key capacity available at time \(t\), considering device limitations and network conditions. The quantum key utilization function optimizes key generation and addresses the requirements of the IoT network. Scalability is obtained through dynamic control of the distribution of quantum keys based on demand. Finally, the hybrid protocol stack decision module operates such that network performance, availability of quantum keys, and security levels are monitored continuously. If available quantum keys fall to a point or environmental noise increases, the system automatically reverts to classical communication methodologies to ensure service is uninterrupted. **Theorem 1**. : _Let \(\mathcal{S}_{\text{QESIF}}(t)\) denote the security level of the QESIF system at time \(t\), scaled between \(0\) (no security) and \(1\) (perfect quantum-secured channel). Let \(\mathcal{K}_{\text{IoT}}(d_{i},t)\) be the entropy-weighted quantum key generation rate for device \(d_{i}\) at time \(t\) (as defined in Equation (1)). Assume \(\mathcal{Q}_{\text{adapt}}(t)\) is the binary switching function (as in Equation (5))._  
_Then, for all time \(t\) and devices \(d_{i}\):_  
\[\mathcal{S}_{\text{QESIF}}(t)\geq\min\bigl{(}\mathcal{S}_{\text{ classical}},\mathcal{S}_{\text{quantum}}\cdot\mathcal{Q}_{\text{adapt}}(t) \bigr{)} \tag{7}\]  
_where_  
* \(\mathcal{S}_{\text{classical}}\) _is the baseline security using classical encryption (e.g., AES and ECC)._
* \(\mathcal{S}_{\text{quantum}}=1\) _under ideal QKD conditions (zero QBER and perfect key yield)._  
_Furthermore, if \(\mathcal{Q}_{\text{adapt}}(t)=1\) and \(QBER(t)\to 0\), then \(\mathcal{S}_{\text{QESIF}}(t)\to 1\), satisfying perfect forward secrecy._  
Proof of Theorem 1.: Two states are considered based on the adaptation function \(\mathcal{Q}_{\text{adapt}}(t)\):  
**Case 1:**\(\mathcal{Q}_{\text{adapt}}(t)=1\)  
The system uses quantum-derived keys. In this case, security is driven by QKD entropy and QBER:  
\[\mathcal{S}_{\text{QESIF}}(t)=f(H_{q}(t),QBER(t))\approx 1-\epsilon\text{ for small }QBER(t)\]  
If \(QBER(t)\to 0\), then \(f(H_{q},QBER)\to 1\). Therefore, \(\mathcal{S}_{\text{QESIF}}(t)\rightarrow\mathcal{S}_{\text{quantum}}=1\). **Case 2:**\(\mathcal{Q}_{\text{adapt}}(t)=0\)  
The system falls back to classical encryption. Hence, \(\mathcal{S}_{\text{QESIF}}(t)=\mathcal{S}_{\text{classical}}\).