# A Survey on Cybersecurity in IoT
## 3 Data Integrity and Privacy
### Privacy Preservation in IoT  
Privacy concerns in IoT extend beyond the mere protection of data during transmission and storage; they encompass the broader issue of preventing the unauthorized inference of sensitive information. IoT devices often generate vast amounts of data that, when aggregated and analyzed, can reveal patterns and insights about individuals or organizations. This has given rise to the concept of data minimization, where only a minimal amount of necessary data are collected and processed, thus reducing the risk of privacy breaches [119; 120; 121].  
Techniques such as differential privacy have gained traction as a means to balance data utility with privacy. Differential privacy is a robust mathematical framework designed to protect individual privacy during data analysis. By introducing controlled noise into computations, differential privacy ensures that the inclusion or exclusion of a single data point has a negligible impact on the output, thereby safeguarding sensitive information about individuals [122; 123; 124].  
Differential privacy is formally defined as follows. Let \(\mathcal{M}\) be a randomized algorithm that operates on a dataset \(D\), producing an output in a range \(\mathcal{R}\). The algorithm \(\mathcal{M}\) satisfies \(e\)-differential privacy if, for all datasets \(D\) and \(D^{\prime}\) differing in at most one element, and for all subsets \(\mathcal{S}\subseteq\mathcal{R}\),  
\[\Pr[\mathcal{M}(D)\in\mathcal{S}]\leq e^{e}\cdot\Pr[\mathcal{M}(D^{\prime}) \in\mathcal{S}],\]  
where \(e>0\) is the privacy loss parameter. A smaller \(e\) indicates stronger privacy guarantees.  
This definition ensures that an observer cannot confidently determine whether any individual's data are included in the dataset based on the output of \(\mathcal{M}\). The parameter \(e\) controls the trade-off between privacy and utility: lower values of \(e\) provide stronger privacy but may reduce the utility of the output.  
Differential privacy is typically achieved by adding noise to the output of a computation. Two commonly used mechanisms are the Laplace Mechanism and the Gaussian Mechanism [125; 126].  
Laplace Mechanism:  
For a function \(f:D\rightarrow\mathbb{R}^{k}\), the Laplace Mechanism adds noise sampled from the Laplace distribution. If \(\Delta f\) is the global sensitivity of \(f\), defined as  
\[\Delta f=\max_{D,D^{\prime}}\|f(D)-f(D^{\prime})\|_{1},\]  
the mechanism outputs  
\[\mathcal{M}(D)=f(D)+\text{Lap}(\Delta f/\epsilon),\]  
where \(\text{Lap}(b)\) denotes the Laplace distribution with scale parameter \(b\).  
Gaussian Mechanism:  
The Gaussian Mechanism is suitable when privacy is measured using \((\epsilon,\delta)\)-differential privacy, a relaxed version of the standard definition. It adds Gaussian noise with variance proportional to the global sensitivity:  
\[\mathcal{M}(D)=f(D)+\mathcal{N}(0,\sigma^{2}),\sigma=\sqrt{2\ln(1.25/\delta)} \cdot\Delta f/\epsilon.\]  
In addition to differential privacy, the concept of federated learning has emerged as a promising approach to privacy-preserving ML in IoT. In federated learning, instead of sending raw data to a central server, IoT devices locally train ML models on their data and then send only the model updates to the central server. This approach significantly reduces the amount of sensitive data that need to be transmitted and stored centrally, thus enhancing privacy. However, federated learning introduces new challenges, such as ensuring the integrity and authenticity of the model updates and mitigating the risk of model inversion attacks, where adversaries attempt to reconstruct the original data from the model updates [127; 128; 129].