## 4 Security and Privacy Countermeasures and Solutions in EC-Based IoT
A security assessment is a further extension of auditing, in which the network is examined from within by professionals trained in the vulnerabilities exploited by network invaders. Periodic assessments of network vulnerabilities should be part of any security policy and audit procedure. In addition, as a result, a specific plan should be made for correcting deficiencies, which might be as simple as retraining staff [120]. 8. _Prior testing_ is a behavioral test of the whole and the components of the EC network (e.g., EC routers/nodes, servers, etc.) that is conducted prior to the actual operation. This is performed by applying special inputs, pilot, and/or token signals to the network and monitoring their outputs. The aim of this solution is mainly to identify the possible attacks, simulate them, and evaluate their impacts on the EC-based IoT. It also defines which information must be logged and which is sensitive to be shared or stored [33, 92, 105, 132]. Furthermore, the input files should be inspected closely to prevent any malicious injection. 9. _Secure data aggregation_ is a highly secure, privacy-preserving [133, 134], and efficient data compression strategy. In this scheme, individual devices encrypt their data independently using homomorphic encryption schemes (such as the Brakerski, Gentry, and Vaikuntanathan (BGV) cryptosystem), then send the encrypted data to the EC nodes. The EC nodes will aggregate all data, compute the multiplication of individual data, and send the aggregated results to the central cloud servers [98, 99, 105, 135]. Discarding the replicate copies of data on intermediaries is required to be able to save the bandwidth in IoT networks. However, this method can disclose sensitive information to intermediaries or intruders. Data encryption is common to protect information and prevent data leakage, but it is not possible to detect replicate copies of data on intermediaries after encrypting the data since all the data will be transformed to random values. To overcome this threat, _secure data deduplication_ has been proposed that allows the intermediaries to detect the replicate data without learning any knowledge about the data [99, 105]. 10. _Secure data analysis_: with the advances in EC technology, some artificial intelligence (AI) functionalities can be shifted from the centralized cloud to EC devices/nodes. This can improve security, privacy, and latency. For instance, partitioning functionality execution across edge nodes/devices and the cloud enables individuals that locally and independently train their models and only share their trained models; therefore, they can keep their original data and respective private training set [99, 105]. This reduces the risk of privacy leakage. 11. _Combining EC and blockchain technologies_: a blockchain provides a trusted, reliable, and secure foundation for information transactions and data regulation between various operating network edge entities. Decisions about the correct execution of particular transactions are based on a consensus mechanism without depending on a trusted central authority between the communicating IoT edge nodes [110, 136]. In [137], the authors integrated smart contract technologies with a consortium blockchain and developed a secure distributed data storage and sharing method for vehicular EC networks. [PERSON] et al. [138] combined EC and blockchain technologies and proposed a permissioned blockchain EC model to address the privacy-preserving and energy security of smart grid IoT based on EC networks by combing EC and blockchain technologies. A security-aware strategy based on smart contracts running on the blockchain has also been presented in this work. Table 2 shows a summary of security and privacy solutions and countermeasures. It is worth noting that some of the security and privacy-related concepts, attacks, and solutions explained in the reference papers were in the context of centralized cloud-based IoT, but they are also applicable or can be extended to EC-based IoT.