Pascal Urien

Keywords: Internet des objets, Sécurité, Blockchain, gestion de réputation, authentification Internet of Things, blockchain, trust management, authentication. 1.3. FOG COMPUTING

13 et Hicham Lakhlef, maitre de conférences à l'université de technologie de Compiègne, qui m'ont fait l'honneur d'avoir accepté d'examiner mon travail et participer au jury de ma thèse.

Je tiens à remercier tous les collègues au laboratoire Heudiasyc, pour leur aide et leur bonne humeur. Nous avons partagé de bons moments.

J'exprime ma plus profonde reconnaissance à mon grand père, ma mère et mon père, mes frères et soeurs pour leur soutien sans faille tout au long de ces années. Je tiens à leur dire à quel point leur soutien affectif a été important à mes yeux, ce travail a pu être mené à son terme grâce à leur soutien. Ce travail leur est légitimement dédié.

Introduction

Liste des tableaux

Publications

International Journal Publications Ainsi, la latence et la capacité de stockage sont réduites au maximum. Enfin, dans notre troisième contribution, nous avons proposé un nouveau protocole de gestion de réputation basé sur la technologie blockchain et le fog computing, avec la prise en charge de la mobilité des objets connectés. Notre protocole permet aux objets IoT d'évaluer et de partager avec précision la réputation relative aux autres objets de manière scalable, sans se recourir à une entité de confiance. Nous avons confirmé l'efficacité de notre protocole par des analyses théoriques et des simulations approfondies. Nous avons montré que notre protocole surpasse les solutions existantes, notamment en matière de scalabilité, prise en charge de la mobilité, la communication et le calcul.

Introduction

Context and research topic

Internet of Things (IoT) emerged as a new paradigm in which the network connects several physical objects that have the ability to collect and transfer/exchange data over a network and collaborate in order to perform high level tasks without requiring human-to-human or human-to-computer interaction. These objects can be engaged in complex relationships including the composition and collaboration with other independent and heterogeneous systems in order to provide new functionalities, thus leading to the Systems-of-Systems (SoS). the concept of Systems of Systems (SoS) can be defined as complex systems composed of several independent sub-systems that work together to achieve a common goal. IoT fits very well with the concept of SoS and shares the same properties of SoS. Indeed, the components of IoT are heterogeneous, autonomous and are managed by different entities and owners. In addition, IoT components are geographically distributed and are constantly evolving and interacting in dynamic environments with other complex systems such as cloud and fog computing. These complex interactions can lead to emergent behaviorss, which is one of the fundamental properties of the SoS.

One of the issues that potentially threaten IoT is the security and the privacy of exchanged/collected data that are often deeply linked to the life of users. These considerations lead us to underline the importance of enforcing security mechanisms in IoT applications which play a pioneer role in mitigating IoT risks. Security problems in IoT are most challenging than the existing security problems in Internet of nowadays. Indeed, it is instructive to note that the things are highly resourcesconstrained in terms of computing capacity, memory and energy which make the existing security solutions absolutely not applicable in this context. Moreover, the high number of connected objects, estimated by Cisco to be about 50 billions of objects by 2020, raises scalability issues. This thesis is part of the labex MS2T (Control of technological Systems-of Systems). In the context of integrating IoT systems in order to compose complex, large-scale SoS, the main goal of this thesis is devoted to the study the IoT based SoS key challenges and the development of global approaches for securing IoT based SoS architecture. We investigate different aspects of IoT security including confidentiality, authentication, trust management using cryptographic approaches and new emergent technologies such as blockchain technology.

Contributions

Hereafter, we highligh the main contributions of this thesis.

A top down survey on IoT security : in our first contribution [START_REF] Kouicem | Internet of things security : A top-down survey[END_REF], we have accomplished a comprehensive survey that includes the most relevant security challenges in different IoT applications and the existing solutions in the literature. We surveyed existing research works in a new approach which is a top down approach. We studied the most relevant aspects such as lightweight cryptographic approaches, blockchain, Software Defined Networking, the context awareness and the relationships between security and safety in IoT. In the first part of our survey, we presented the different challenges and security requirements inherents to the well known IoT applications. Then, we surveyed the literature solutions according to two main points of view : (1) classical approaches which are generally operating in centralized environments where we have central trusted entities ensuring the proper functioning of security services ; [START_REF] Acker | Secure ubiquitous house and facility control solution[END_REF] new emerging security solutions which can be handled in decentralized infrastructure.

A new solution to secure remote control of IoT actuators : nowadays, with the advent of Internet of Things, we need efficient mechanisms to secure and control remotely IoT smart actuators by users and controllers using smartphones and IoT devices. We mean by remote control all the actions that could be performed remotely on smart objects. This arises particularly in industrial Cyber-Physical Systems to supervise industrial processes. However, the complex environment of IoT systems makes this task very difficult to achieve regarding the number of connected objects and their resources limitation. In this contribution [START_REF] Kouicem | Distributed fine-grained secure control of smart actuators in internet of things[END_REF] we tackled the problem of remote secure control of IoT actuators. For that, we proposed a distributed lightweight fine-grained access control protocol based on Ciphertext Policy Attribute Based Encryption mechanism and one way hash chain. The results of formal security analysis, using AVISPA tool, demonstrated that our scheme is secure against various attacks. Moreover, the performance evaluation results demonstrated the scalability and the efficiency of our solution in terms of energy consumption and computation costs.

An Efficient Mutual Authentication Scheme For Fog Computing Architecture : in order to efficiently manage the huge number of IoT objects and data, a new architecture called fog computing has been introduced recently as the convergence between the Internet of things and cloud computing paradigms. This architecture aims to extend cloud-computing services to the edge of the network. With the new fog-computing paradigm, new challenges appear in prospect as authentication, which is one of the most important challenges.

We developed a new scalable and lightweight authentication scheme that meets the main requirements of IoT [START_REF] Imine | Masfog : An efficient mutual authentication scheme for fog computing architecture[END_REF]. For that, we proposed a novel and efficient authentication protocol which ensures mutual authentication at the edge of the network. Our scheme performs a first registration in the cloud level, and then it uses credentials provided by the cloud to realize any eventual mutual authentication with the fog nodes without any resort to the cloud. In addition, our solution takes into consideration the eventual authentication between fog nodes. We base our construction on blockchain technology and secret sharing technique. The Blockchain is maintained by fog nodes and it allows end users to authenticate any fog node in the architecture. In addition, it allows fog nodes to establish mutual authentication with each other. We showed through experimentations the efficiency of our authentication scheme which provides a low overhead in terms of storage capacity and computation.

An efficient Trust Management Protocol in IoT based on Blockchain technology : IoT can be viewed as service centric architecture where each device, or thing in general, can request services from other devices and it may also provide services for other devices (service providers). IoT service providers may behave dishonestly and maliciously for the purpose of promoting IoT devices to select them for one or many services on behalf of other trusted service providers. Therefore, it is clear that developping a trust management protocol to protect IoT devices from malicious service providers is more than necessary. We proposed a new scalable trust management architecture which is based on blockchain technology and fog computing paradigm [START_REF] Kouicem | An efficient architecture for trust management in ioe based systems of systems[END_REF]. Our solution allows IoT devices to accurately assess and share trust recommendations about other devices in a scalable way without referring to any pre-trusted entity. The blockchain is maintained by powerful fog nodes which offload lightweight IoT devices from trust information storage and heavy computations and save their bandwidth occupations. We have extended this work to develop a new trust management protocol upon the proposed architecture. Our protocol, named BC-Trust [START_REF] Kouicem | Decentralized trust management based blockchain protocol for internet of things[END_REF], is efficient and resilient against the known malicious attacks such as bad-mouthing, ballot-stuffing and cooperative attacks. We confirmed the efficiency of our proposal through theoretical analysis and extensive simulations. Finally, we showed that our protocol outperforms existing solutions especially in terms of scalability, mobility support, communication and computation.

Content of the thesis

This dissertation is organized into seven chapters. The first chapter sets the context of our research. Chapter 2 introduces the required technical backgrounds about the Internet of Things (IoT), which are necessary for the comprehension of this thesis. We also discuss the main core concepts around this technology as well as its technical challenges. In chapter 3, we propose a top down survey in which we present the different solutions proposed in the literature dealing with security in IoT. In particular, we discuss the benefits that emerging technologies such as blockchain and SDN (Software Defined Networking) and what they can bring to the IoT security in terms of scalability and efficiency. Finally, we propose a classification and a comparison of existing solutions. In chapter 4, we address the problem of remote secure control of smart actuators. For this purpose, we propose a distributed lightweight fine-grained access control based on Attribute Based Encryption scheme and one-way hash chain. Using a security analysis tool based on formal methods, we demonstrated that our scheme is secure against various attacks. The obtained simulation results show that our solution is highly scalable and efficient in terms of computation and storage.

In the rest of the dissertation, we focus mainly on the application of blockchain technology to address security problems in IoT. We propose two original solutions to address the authentication and trust management problems. In chapter 5, we propose a new efficient mutual authentication scheme in IoT based on fog computing architecture. This authentication scheme has the advantage to be performed at the edge of the network and hence reduces the latency of authentication. Beside, we demonstrate through simulations that our authentication scheme provides a low overhead in terms of storage capacity and computation. In chapter 6, we propose a new scalable trust management blockchain-based protocol for IoT. The blockchain is maintained by powerful fog nodes which offload lightweight IoT devices from trust information storage and heavy computations and save their bandwidth occupations. We discuss the main components of our protocol and how it deals against malicious attacks and its main benefits, especially high mobility support of devices. We confirm the efficiency of our proposal through theoretical analysis and experiments. Finally, we show that it outperforms existing solutions especially in terms of scalability, mobility support, communication and computation.

We end this dissertation by chapter 7, in which we give concluding remarks and summarize our main contributions. We highlight the perspectives and future work directions of our thesis.

Chapitre 1

Backgrounds about Internet of Things

Nowadays, Internet of Things (IoT) is changing much about the world we live in, the way we drive, how we make decisions, and even how we get energy. Internet of things consists of sensors, actuators and chips embedded in the physical things that around us by making them smarter than ever. These things are connected together and exchange data between them and with other digital components without any human intervention [START_REF] Al-Fuqaha | Internet of things : A survey on enabling technologies, protocols, and applications[END_REF]. IoT contributes significantly to enhance our daily life throughout many applications come from different sectors such as smart cities, smart building, healthcare, smart grids, industrial manufacturing among others.

In this chapter, we present the main definitions of the concepts of IoT and its main components. We shed the light on its typical architectures, its main applications. We also provide an overview of some of the key challenges relating to this technology. Moreover, we explore the relations between the IoT and other emerging technologies such as cloud and fog computing and how these emerging technologies are necessary for the development of future IoT.

Internet of Things

The Internet of things is an enabling technology that allows connecting heterogeneous objects through the Internet. This technology is about the pervasive presence of sophisticated sensors and chips that are embedded in the physical objects around us. These objects work together to achieve common goals by sensing, transmitting and processing valuable data [START_REF] Al-Fuqaha | Internet of things : A survey on enabling technologies, protocols, and applications[END_REF]. This vision of the Internet of Things has introduced a new dimension to information and communication technologies : in addition to people and computers, others physical objects will allow us to be connected to Internet from anywhere and at any time. However, these objects bring new challenges due the the low memory, energy, and compuataion capacity.

IoT architecture

Many working groups and consortiums such as oneM2M, ETSI, ATIS, TIA, etc. proposed some generic and horizontal architectures of the IoT, that will position themselves transversely, regardless the high level IoT applications. The most common elements between the large pool of the proposed architectures is that they consider the IoT as an evolution of the M2M (Machine-to-Machine) paradigm.

In Fig. 1.1, we present the typical architecture of the IoT which is proposed by ETSI (European Telecommunications Standards Institute) [START_REF] Wang | A survey on mobile edge networks : Convergence of computing, caching and communications[END_REF]. This architecture considers three main layers which are M2M domain layer, Network domain layer and application layer. In the recent literature, other models, such as 5-layers model, have been proposed to improve this basic 3-layers model, and hence be able to support the scalability of the IoT. Among the proposed models, the five-layer model is the most suitable model for IoT applications. Next, we provide a brief discussion the five layers of the IoT architecture.

Objects Layer

This layer, known also as the perception layer, includes the physical devices, sensor and actuators that are equipped by sensing, actuating and communication capabilities that allow them to observe and construct the perception of its physical environment. This bottom layer is the most important layer of this model and is responsible for the generation of valuable data such as temperature, pressure, weight, motion, vibration, acceleration, location, humidity, etc. This layer is connected to its upper layer (object abstraction layer) through communication channels using WIFI, Zigbee, 3G/4G/5G standards [START_REF] Wang | A survey on mobile edge networks : Convergence of computing, caching and communications[END_REF]. The perception layer, thanks to the huge amounts of data created at this layer, is the entry point of what we commonly call Big Data.

Object Abstraction Layer

This layer includes all edge components that provide connectivity among the devices in the objects layer and other gateways located at the edge of the objects layer. At this layer, gateways and edge computing servers can perform local analysis and transfer data to the service management layer through various technologies such as RFID, 3G, GSM, UMTS, WiFi, ZigBee, etc. This layer is introduced as an intermediate layer to manage the tremendous number of objects and support some sensitive IoT applications [START_REF] Wang | A survey on mobile edge networks : Convergence of computing, caching and communications[END_REF].

Service Management Layer

In this layer, we find M2M platforms, middleware, API of M2M applications and also cloud computing technologies that can manage data generated at the bottom layers. This layer enables IoT application developers to develop high level applications that are independent of any physical platform and the underlined technologies. At this layer, it is possible to handle the received data, deliver the required micro-services to developers and managers to make decisions and develop business applications.

Application Layer

The application layer interfaces with final users and customers through application protocols such as HTTP, MQTT, CoAP, etc. This layer provides high-quality services to users, and it contains all the required softwares to meet the requirements of final customers. These applications should be designed in such away to answer to many markets' needs in different fields such as smart building, transportation, industry, smart grids and healthcare. These applications are deployed on powerful cloud servers to satisfy a good quality of service for final customers and ensure a good level of reliability.

Business Layer

The business layer consists on the upper layer of the five-layer model. Its main role is the management of the overall IoT systems, services, applications and users. This layer takes as an input the data received from the application layer in order to develop more effective business models, predict the customer behaviors, show high level metrics, graphs and flowcharts, etc. Moreover, we can implement and perform big data analytics in order to transform data and information into actions to support decision-making processes. In addition, application and customer monitoring and management are achieved at this layer.

IoT Applications

The IoT cover a wide range of applications and will touch almost every area we face on our daily lives. Among these applications, we can mention the following :

1.1.2.

Smart Grids

Electrical energy is a treasure which has a very high industrial value, and plays an important role in economic development. Nowadays, we use very modern IT technologies to optimize electricity production by taking into account user demands throughout the electricity distribution line. The smart grid is the technology behind this distribution line. It consists of an integrated network, called also the advanced metering infrastructure (AMI) installed between the electricity production centers and the end customers, whose important role is to coordinate the electricity production with respect to the consumption of end customers. Smart grids represent one of the most attractive areas in IoT. The main goal is to improve the quality of experience of final customers and optimize the electricity production. To better understand in more details how IoT can improve the electricity production in smart grids, the reader is referred to [START_REF] Liu | Cyber security and privacy issues in smart grids[END_REF][START_REF] Dalipi | Security and privacy considerations for iot application on smart grids : Survey and research challenges[END_REF].

Healthcare

Smart healthcare plays a significant role in healthcare applications through embedding sensors and actuators in patients' bodies for monitoring and tracking purposes. The IoT is used in healthcare in order to monitor physiological statuses of patients. The embedded sensors have the ability to collect information directly from the body area of the patient and transmit it to the physician. This technology has the potential to completely detach the patient from the centralized system which is the hospital while maintaining continuous contact with the physician. Currently, Healthcare based IoT applications represent one of the promising technologies that impact hugely the society which is mainly due to the aging of the population. Indeed, in France, the percentage of people over the age of 60 reached about 24% of the population in 2015 and will rise to 32% by 20601 . Furthermore, the budget reserved for healthcare applications reached about 12% of the GDP (Gross domestic product) 2 . In this context of population aging and the cost related to the treatment, a great interest emerges to adopt new IoT based technologies to monitor the patients in real time.

Transportation systems

Intelligent transportation systems (ITS) represent the next generation of transportation that aims to link people, roads and intelligent vehicles thanks to the development of embedded systems and communication technologies. By connecting and distributing intelligent processors inside vehicles and also through transportation infrastructure, we can make the transportation safer, greener and more convenient. ITS employs four main components, namely : vehicle subsystem (consists of GPS, RFID reader, OBU, and communication), station subsystem (road-side equipment), ITS monitoring center and security subsystem [START_REF] Leng | Novel design of intelligent internet-of-vehicles management system based on cloud-computing and internet-of-things[END_REF]. Connected vehicles are becoming more important with the aim to make driving more reliable, enjoyable and efficient [START_REF] Gerla | Internet of vehicles : From intelligent grid to autonomous cars and vehicular clouds[END_REF]. Actually, we have three types of communications in vehicular networks : V2V (Vehicle to Vehicle), V2I (Vehicle to Infrastructure) and V2P (Vehicle to Pedestrian) [START_REF] Leng | Novel design of intelligent internet-of-vehicles management system based on cloud-computing and internet-of-things[END_REF]. However, recently, a new type of communication has emerged, called V2G (Vehicle to Grid), whose main goal is to ensure electrical Vehicles charging based on energy of smart grid electricity distribution [START_REF] Liu | Cyber security and privacy issues in smart grids[END_REF].

Smart cities

Smart cities consist of one of the most important applications of IoT. Although, there is no formal definition of "smart city", it consists of a new emerging paradigm that aims to enhance the usage of public resources, increase the quality of service to citizens [START_REF] Zanella | Internet of things for smart cities[END_REF]. In this context, sensors are deployed all over roads, buildings, smart cars, etc. to better manage traffic, adapt to the weather, lighting follows the position of the sun, domestic incidents can be avoided with alarms, etc.

Manufacturing

Nowadays, IoT plays an important role in the industry. It is considered as a promising solution to automate the process of manufacturing and the control of the production chain. Industrial Internet of Things (IIoT) uses new technologies such as Machine-to-Machine (M2M) communication, Wireless Sensor Networks (WSN), automation technologies as well as Big Data to create an intelligent industrial ecosystem [START_REF] Sadeghi | Security and privacy challenges in industrial internet of things[END_REF]. The main aim of IIoT is to provide better productivity, efficiency, reliability and better control of final products.

IoT challenges

The IoT is a big industry that should bring a lot of business opportunities and benefits. The IoT accentuates the considerable positive impact already produced in our society, and thus a real change of socio-economic and cultural models. However, these benefits cannot be ultimately achieved without addressing many tricky challenges and issues. We enumerate in the following the main challenges that IoT faces :

1. Scalability : the tremendous number of objects connected to the Internet should be considered in many IoT protocols. The number of connected devices surpassed the number of humain population in 2010. Therefore, it is important to design scalable architecture and build efficient protocols that can deal with IoT scalability issues.

2. Limitation of resources : most of IoT devices are limited in terms of storage and computation capabilites. Thus, it is important to design lighweight protocols that support this ressource limitation and meet the requirements of customers.

3. Reliability : IoT systems are vulnerable to many safety and reliability issues that can cause huge damages. It is mandatory to design reliable systems that works properly under any circumstances especially when it comes to emergency and critical applications like manufacturing, transportation and healthcare applications [START_REF] Wang | A survey on mobile edge networks : Convergence of computing, caching and communications[END_REF].

4. Management : one of the most challenging tasks in IoT is how to provide real-time, lightweigt and secure management protocols to manage Fault, Configuration, Accounting, Performance and Security (FCAPS) of the connected devices.

5. Mobility : is another important challenge as most of IoT devices are mobile.

It is very important that IoT services be delivered to end mobile user with respecting their requirements.

6. Interoperability : IoT applications, platforms, devices and protocols are likely to be heterogeneous. For instance, there is no unique standard that can support interconnection between all the heterogeneous IoT systems [START_REF] Wang | A survey on mobile edge networks : Convergence of computing, caching and communications[END_REF]. Therefore, there is a real need to take into consideration the hetereneity aspects of the IoT to build applications that can be easily maintained, extended and integrated with other systems and applications.

7. Security and privacy : this challenge is probably the hardest one that hinder the evolution of the IoT. These last years, security and privacy challenge are considered as one of the most important research field in IoT.

Fog Computing in Support of the IoT

With the tremendous growth in the amounts of data that IoT objects report, we need new emerging technologies that can act as a bridge between IoT devices and cloud computing. During the past several decades, cloud-computing technology showed its efficiency as a powerful tool to store, process, and analyze this data while meeting high level application requirements. However, the centralized nature of the cloud remains a serious problem to meet the requirements of some emerging IoT applications that require very low latency.

Recently, fog computing paradigm has been introduced as an extension of cloudcomputing services to the edge of the network. This new architecture integrates network edge devices to overcome several cloud computing limitations related to bandwidth and latency. Fog computing architecture introduces a new rich service layer (computation, communication, storage and control operations) able to interact with any end device with any connection mode such as 4G, WIFI, etc. In addition, thanks to their proximity to the end-users compared to the cloud datacenters fog computing can impressively reduce latency, and provides the expected interoperability and reliability [START_REF] Wang | A survey on mobile edge networks : Convergence of computing, caching and communications[END_REF][START_REF] Al-Fuqaha | Internet of things : A survey on enabling technologies, protocols, and applications[END_REF]. This paradigm is realized by adding a resource-rich extra layer composed of a large number of edge devices such as routers, base stations, servers located on existing access points, etc. These fog devices provide low latency mobile services while ensuring the connection with cloud data centers for any eventual control operations and data aggregation.

We can consider fog computing as an optimal choice for the IoT designers thanks to the following features [START_REF] Wang | A survey on mobile edge networks : Convergence of computing, caching and communications[END_REF] :

• Reduced Latency : fog resources are close to end mobile users and objects.

Thus, all processing and storage operations can be performed at the edge of the network without referring to cloud servers, which allows to provide better delay performance. • Bandwidth reduction : thanks to storage capabilities and proactive caching mecanisms that are deployed at the edge of the network, fog nodes can reduce the bandwidth consumption of some hungry applications up to 67% [START_REF] Wang | A survey on mobile edge networks : Convergence of computing, caching and communications[END_REF].

• Energy efficiency : in fog computing architecture, heavy data processing and storage operations are offloaded to powerful fog nodes. Therefore, this will substantially optimize storage and computation resources at IoT devices level.

• Distribution : fog computing architecture is realized based on "micro" clusters with storage, processing and communication capabilities spread all over the edge of the network. Indeed, it is possible to deploy many "micro" clusters closer to the end-users with a reduced cost compared to cloud datacenters.

• Scalability : fog allows IoT systems to be more scalable such that as the number of end-users increase, the number of deployed "micro" fog centers can increase to cope with the increasing load. Such an increase cannot be achieved by the cloud because the deployment of new data-centers is cost prohibitive.

• Data and service replication : Fog helps to provide efficient mechanisms to deal with data management and replication of services, which allows to achieve high resilliency and availability.

• Mobility support : fog nodes deal efficiently with high mobility scenarios and can track the location of IoT devices to benefit from this information in other decision making services.

• Standardization : fog resources is designed in such away they can interoperate with various cloud providers and can support many IoT protocols.

Conclusion

The Internet of Things (IoT) is one of the promising technologies that has attracted much attention from researchers in the industrial and academic sectors in the last years. As things add capabilities and as more people and new types of information are connected, IoT becomes an Internet of Everything (IoE). We have presented in this chapter the main definitions of these technologies, their architectures, their applications and also their main challenges.

In future, the IoT will raise questions, which will directly concern the security of properties and people. For example, some applications may be closely related to strategic infrastructure such as water and electricity supply, monitoring bridges and buildings, while others will manage information related to the privacy of people like their travels and health conditions.

Chapitre 2

Internet of Things Security : State of the art

As new emergent technology, IoT suffers from several security issues which are most challenging than those from other fields regarding its complex environment and resources-constrained IoT devices. These last years, a lot of researches are leading to address the various security challenges closely related to IoT such as key management issues [START_REF] Sicari | Internet of things : Security in the keys[END_REF], confidentiality, integrity, privacy, policy enforcements [START_REF] Sicari | A policy enforcement framework for internet of things applications in the smart health[END_REF][START_REF] Sicari | Security policy enforcement for networked smart objects[END_REF] among many other challenges. The main works in the literature tried to adapt the security solutions proposed for wireless sensor networks (WSNs) and Internet in the context of IoT. However, we must point out that IoT's challenges take a new dimension which is far from being easy to overcome with traditional solutions. In addition, we must emphasize that most security approaches rely to centralized architectures, making their applications in IoT much more complicated regarding the large number of objects. So, distributed approaches are required to deal with security issues in IoT.

In this chapter, we survey the different solutions according to two perspectives, namely the security approaches based on traditional cryptographic approaches and the other approaches based on new emerging technologies such as SDN and Blockchain. Furthermore, we provide a top down review and a comparison study that gives a holistic view of the security in Internet of Things. This review encompasses the different aspects of security in IoT by starting from generic to specific aspects.

Background on security services

Security consists of all the techniques that aim to preserve, restore and guarantee the protection of information in computer systems from malicious attacks. Daily news puts security at the top of concerns : leakage of personal data and economic espionage, infection of sensitive computer systems, identity theft and fears about card payments are just few examples of threats. The security of computer networks and information systems in general, consists to provide the following services [START_REF] Noura | Adaptation of Cryptographic Algorithms According to the Applications Requirements and Limitations : Design, Analyze and Lessons Learned[END_REF] :

• Confidentiality : it ensures that information is made unintelligible to unauthorized individuals, entities, and processes.

• Integrity : it ensures that data has not been modified by a third party (accidentally or intentionally).

• Authentication : it verifies that the sender of the message fits with its pretended identity.

• Non-repudiation : it ensures that the sender of the message can not deny having sent the message in the future.

• Availability : It ensures that the services of the system should be available for legitimate users.

• Privacy : It ensures that users' identities should not be identifiable nor traceable from their behaviors and their performed actions in the system.

Several cryptographic mechanisms have been put in place to deal with the different security threats and ensure the security services mentioned above. We provide in table 2 • Scalability issues : the number of connected object has surpassed the number of population in the world and still grow continuosly. The management of security of all these devices present several challenges. For example, it is very hard to efficiently apply updates and security patches accross distributed environements with heteregeneous devices. Beside, the management of cryptographic keys of all these devices to build secure communications is actually a big challenge.

• Vulnerabilities related to information and communication systems : it is not enough to ensure security only at IoT devices level. Indeed, it is important to ensure that the communication between these devices and other plateforms and applications (like cloud and fog computing applications) is secure. Integrity, confidentiality and privacy of data, IP spoofing, injection, DoS/DDos attacks are just examples of attacks among others.

• Data sensitivity and privacy : IoT devices generate and exhange sensitive data like electricity consumption, health information, etc. These pieces of data must not be leaked by any unothorised entity.

• Resources limitations : most of connected devices have limited resources in terms of computation, memory and battery. Since the most of cryptographic solutions are computationally expensive, adapting them to ensure a high level of security while minimizing energy consumption is a hard challenge.

Taxonomy of security solutions in IoT

Security subject is one of the hot research topic in IoT and has attracted a lot of researchers not only from academic and industry but also from standardization organizations. To date, there have been a lot of proposals aiming to address the security problems in IoT. In this section, we propose a classification of these solutions from an architectural point of view and we illustrate in figure 2.1, our classification of security solutions in Internet of Things. We distinguish in the light of this classification two main categories of approaches :

1. Classical approaches : this category of solutions groups the cryptographic based techniques that were especially designed for IoT communications or have been adapted from wireless sensor networks or M2M communications. In section 2.4, we present only the most significant solutions and we provide the main limitations of each proposal. We note that in this survey, we focus basically on solutions that ensure : confidentiality, privacy and availability services. It is worth mentioning that most of these solutions operate in centralized environments where we have central trusted entities ensuring the proper functioning of the security services. The cryptographic tools employed to ensure the security services are whether symmetric or asymmetric techniques that we will discuss by pointing out their main advantages and limitations in the context of IoT for each security service.

2. New emerging security solutions : This category groups security solutions that are based on new techniques other than cryptographic tools. They are more convenient to meet the scalability issues compared to cryptographic ap-proaches. In general, the solutions belonging to this category are decentralized. In section 2.5, we focus on two emerging technologies :

(a) Software Defined Networking (SDN), which is a new network paradigm that is revolutionizing the world of networking this last years. Its aim is to provide an environment to develop more flexible network solutions and make the network resources more easy to manage using centralized SDN controller. Many SDN based security solutions for IoT have been proposed in the literature. We will discuss in more details these solutions in section 2.5.1.

(b) Blockchain technology, which is the technology behind the cryptocurrency tools such as bitcoin, aims to make the transactions between entities in a distributed manner (peer to peer architecture without referring to any central trusted server. Moreover, this solution does not require that entities trust each other. In this technology, it is piratically impossible to deny performed transactions once they are validated. Beside its application on the cryptocurrency domain, these last years, a lot of researchers have started to put the light on this technology in order to address security solutions in IoT such as data privacy, access control, etc.

We present an analysis of these solutions in section 2.5.1.

We present mainly in section 2.5 the benefits of SDN and blockchain in terms of security, their key advantages, the issues that these technologies can solve and classical approaches can't and also their limitations.

Classical IoT security approaches

In this section, we review and discuss the main proposed solutions which are based on cryptographic approaches to address the main security services. Considering the traditional approaches, we focus on : confidentiality, availability and privacy services.

Confidentiality solutions

In the Internet of Things, it is mandatory to protect data exchanged between objects from attackers by means of encryption mechanisms. Hence, we should ensure that only legitimate users are able to disclose encrypted data. For this goal, cryptographic solutions exist to ensure data confidentiality, however, in most cases, these solutions are inefficient or even inapplicable in IoT devices with high resource constraints because they are based on algorithms that are very greedy in terms of storage and computation. To get an idea about the energy consumption and the effeciency of the different cryptographic algorithms, the reader is invited to read the paper of Malina et al. [START_REF] Malina | On perspective of security and privacy-preserving solutions in the internet of things[END_REF] where intensive analysis was investigated to compare the different cryptographic primitives widely used in security and privacy. Considering the power limitation of smart objects, a lot of cryptographic solutions have been proposed to deal with resources constraint's issues. Basically, these solutions belong to two main classes, namely symmetric and asymmetric cryptographic solutions.

Symmetric key solutions

In Symmetric key schemes, each entity in the system should share cryptographic keys with all other entities in the system. The main advantages of symmetric based cryptographic solutions are their efficiency (they are less-computational) and easy to implement in hardware platforms. AES (Advanced Encryption Standard), RC4 and 3DES are just few examples widely used in practice. Although their efficiencies, symmetric key based security solutions suffer from scalability and key management issues. Indeed, this latter emerges as serious problem in Internet of Things where there are a lot of devices that exchange sensitive data in dynamic environments. In Symmetric key based solutions, each device must keep secret keys with all the devices evolving in the IoT system in order to exchange sensitive data. Basically, we can distinguish between two key distribution approaches [START_REF] Granjal | Security for the internet of things : a survey of existing protocols and open research issues[END_REF], namely : 1) Probabilistic key distribution and 2) Deterministic key distribution.

In deterministic approaches, each entity must be able to establish a secure link with all other entities to form a full secure connectivity coverage. Therefore the number of shared keys in the system increases quadratically according to the number of entities (for n entities, we need n(n -1 )/2 keys). Depending on the presence or not of a trust third party during key bootstrapping, we distinguish two subcategories [START_REF] Granjal | Security for the internet of things : a survey of existing protocols and open research issues[END_REF], namely : 1) offline key distribution approach where nodes can share session keys in a distributed way without the intervention of any central entity ; and 2) Server-assisted key distribution where we dispose of a central server that is charged of expensive cryptographic computations and attributes session keys to IoT devices. In contrast, Leap scheme [START_REF] Zhu | Leap+ : Efficient security mechanisms for large-scale distributed sensor networks[END_REF] uses a temporary key which is kept in sensor nodes to generate session keys and is removed from the memory when the key agreement is done. For security purposes, Leap requires that sensor devices must not be exposed to attacks during a predefined time after the deployment. In [START_REF] Choi | The best keying protocol for sensor networks[END_REF], the authors proposed a memory-efficient key management scheme that reduces the storage to only (n -1 )/2 keys per node. The main idea consists to introduce new mechanisms based on a hash function to generate half of symmetric keys while storing the other half in sensors' memories.

In Probabilistic key distribution, it's not guaranteed that each node in the network shares a secure key with all other nodes, but the nodes share keys with their neighbors according to some probabilities in such way we must be able to form secure paths1 between all entities in the network. With this approach, the scalability issues are solved but the key management protocols become less resilient in case of nodes' comprises. In the literature, there are a lot of probabilistic key management schemes. The first probabilistic key distribution scheme for WSNs is the scheme called Random key pre-distribution (RKP) proposed by Eschenauer et al. [START_REF] Eschenauer | A key-management scheme for distributed sensor networks[END_REF]. In this scheme, each node i in the network is pre-loaded randomly with a set of key ring R i of size k , selected from a large pool S . After the deployment of sensor nodes, each node i broadcasts its keys' identifiers to its neighbors. The node i establishes a key session between some neighbor j only if the intersection between R i and R j contains at least one key (R i ∩ R j = ∅), and thereby they choose one key among R i ∩ R j as a session key. In the case of (R i ∩ R j = ∅), nodes i and j determine a secure path composed of secure links. The main drawbacks of this approach are its memory consumption required for keys storage and importantly its non resiliency against key compromise attacks. Indeed, if some nodes are compromised by an attacker, all the session keys that these nodes have established with their neighbors will be disclosed which corrupt fundamentally the security of the network. Some enhancements [START_REF] Chan | Random key predistribution schemes for sensor networks[END_REF][START_REF] Du | A key predistribution scheme for sensor networks using deployment knowledge[END_REF] of the basic RKP scheme have been proposed ; namely : Q-Composite scheme [START_REF] Chan | Random key predistribution schemes for sensor networks[END_REF] enhances the resiliency of RKP by introducing additional requirements in order to establish session keys between nodes, basically two nodes i and j can establish a session key only if they share at least Q keys used to compute a pairwise key obtained by computing the hash of all the concatenated shared keys. In [START_REF] Du | A key predistribution scheme for sensor networks using deployment knowledge[END_REF], Du et al. proposed a solution to overcome key storage issue of RKP by establishing only the necessary session keys. On the other hands, Blom's scheme [START_REF] Blom | An optimal class of symmetric key generation systems[END_REF] is also a very efficient scheme that is very suitable for WSNs and IoT as claimed by some researchers [START_REF] Granjal | Security for the internet of things : a survey of existing protocols and open research issues[END_REF]. In Blom's scheme, the secret keys are vectors obtained by simple matrix multiplications. The idea is that, each node i has an identifier I i randomly generated and known by all nodes in the network. In the deployment phase, private key g i for the node i is generated from its identifier as follows : g i = DI i , where D is a secret symmetric matrix generated over the finite field GF (p) where p is a prime. For the node i , in order to share a secret key with node j , it computes secret i j = g t i I j = g t j I i . Obviously the security of the scheme is strongly dependent of the secret matrix D which must be kept carefully by a trusted central server. This matrix is used also to add sensor nodes to the network.

Traditional Public key solutions

Traditional Asymmetric approaches group all the methods based on public keys and requires the authority to issue certificates to different users in the system. In this family, we find RSA, DSA, El Gammal, NTRU, ECC cryptosystems, etc. The advantages of these approaches are their flexibility, scalability and key management efficiency. However, these solutions are energy-consuming which are not suitable for constrained devices. NTRU consists of the less computational asymmetric approach based on the shortest vector problem in a lattice [START_REF] Nguyen | Survey on secure communication protocols for the internet of things[END_REF]. However, it requires more memory space to store keys. Elliptic curves are also in some cases very efficient and can ensure the same level of security as RSA and similar asymmetric cryptographic approaches with keys of small sizes [START_REF] Chatzigiannakis | Elliptic curve based zero knowledge proofs and their applicability on resource constrained devices[END_REF]. Indeed, with 80-bit security level, we need only keys of 160 bit contrary to RSA where we need keys of 1024 bits.

The contribution in [START_REF] Ma | Distributed access control with adaptive privacy preserving property for wireless sensor networks[END_REF] is twofold. First a signcryption called DQAC scheme has been designed to sign and encrypt query messages which ensures authentication and confidentiality and it also preserves the privacy of users requesting WSNs' data. Second, a distributed access control based on the proposed signcryption scheme in addition to proxy based signature in order to anonymize users' identities. The proposed signcryption technique is based on Elliptic curve and is securely provable under the Computational Diffie-Hellman model.

The authors in [START_REF] He | Distributed access control with privacy support in wireless sensor networks[END_REF] considered network users as a set of predefined groups, where each user is assigned to a single group. The groups are constructed in such a way users having the same access privileges belong to the same group. The main proposal consists on "privacy-preserving" ring signature scheme considering the members of each group as the nodes forming the ring. This technique allows IoT devices (signature verifiers) to grant access to legitimate users (signers) without disclosing the identity of each user neither from sensor data owner nor from other users. The only revealed information about queries is the group (gid) containing the signer's group ID from which the query is originated without knowing exactly which signer. The experiments were performed in real Imote2 platform running TinyOS2 demonstrate the efficiency and feasibility of the scheme in real WSN and IoT applications.

In [START_REF] Gusmeroli | A capability-based security approach to manage access control in the internet of things[END_REF], authors claimed that, actually, existing access control mechanisms like RBAC (Role Based Access control), MAC (Mandatory Access control) are not anymore scalable, difficult to manage and don't fit well with distributed environments like Internet of Things, and hence the need for a new effective access control mechanism is unavoidable. The authors proposed a new access control mechanism called capability-based access control (CapBAC), which can overcome the actual issues in terms of scalability and manageability raised with the existing access mechanisms. The idea behind the concept is the usage of capability based authority tokens which are unfalsifiable and easy to communicate and grant seamlessly the access to IoT resources and process.

Identity Based Encryption (IBE)

The main issue of transitional public key cryptosystems is that they are not scalable enough. Indeed, they strongly depend on the authority that issues certificates for each user in the system which is required in order to deal with spoofing and identity usurpation. Therefore, certificates raise the complexity of the system. In order to overcome the scalability and the complexity issues, Identity Based Encryption tools have been proposed by introducing a new concept that consists to use unforgeable string related to the user identity (such as user's phone number, email address, etc.) as public key to encrypt data and thereby eliminate the need for certificates. Although their scalability and efficiency, IBE techniques are not very suitable for IoT because they are expensive and incur heavy resource consumption. In the literature, some research works have been investigated to design new, efficient, and lightweight IBE schemes that could support constrained devices.

Using Elliptic Curve Cryptosystems, bilinear maps and hash functions, Chen [START_REF] Chen | An ibe-based security scheme on internet of things[END_REF] proposed a new lightweight Identity Based Encryption scheme to secure communications between devices based RFID tags. The main advantage of the scheme is its simplicity and its ability to reduce substantially the computation overhead. However, the authors did not provide any discussion about the security of the scheme.

Fagen et al. [START_REF] Li | Practical access control for sensor networks in the context of the internet of things[END_REF] addressed the access control problem in WSN in the context of IoT where internet hosts query WSN to get sensor information. The main contribution consists of heterogeneous signcryption (HSC) technique based on two mechanisms : (1) certificateless cryptography (non usage of certificates) that belongs to internet hosts ; and (2) IBC cryptographic technique that belongs to WSN environment. As singcryption technique, the proposed scheme ensures both authenticity and confidentiality with less computation. Moreover, it is useful to control the access between heterogeneous environments.

In [START_REF] Klugah-Brown | A signcryption scheme from certificateless to identity-based environment for wsns into iot[END_REF], a signcryption scheme has specially designed for WSNs in the context of Internet of Things. The scheme is based on elliptic curves and is secure under the Diffie-Hellman computation hypothesis. Nevertheless, this scheme is applied only in contexts where the verifiers are always powerful nodes that have enough computational resources and it's consequently very heavy for IoT devices.

Fuzzy identity-based Encryption (FIBE) is considered as an enhancement of IBE with introducing error-tolerance property. The main idea behind FIBE is to give the users, having at least k among n attributes, the possibility to decrypt the ciphertext encrypted under the hole attributes (n) [START_REF] Sahai | Fuzzy identity-based encryption[END_REF]. In [START_REF] Mao | Fully secure fuzzy identity-based encryption for secure iot communications[END_REF], the authors designed FIBE scheme based on bilinear maps which is securely provable in the full model. Performance analysis demonstrated the applicability of this scheme in IoT.

Attribute Based Encryption (ABE)

The concept of Attribute Based Encryption (ABE) has been introduced, first, by Sahai and Waters in Advances in Cryptology EUROCRYPT 2005 [START_REF] Sahai | Fuzzy identity-based encryption[END_REF] as an enhancement of Fuzzy Based Identity Encryption [START_REF] Boneh | Identity-based encryption from the weil pairing[END_REF][START_REF] Cocks | An identity based encryption scheme based on quadratic residues[END_REF]. ABE introduces an expressive way to control the access to private data using policy access structure that defines relationships between a set of attributes3 used to encrypt data. In ABE system, Key Generation Server (KGS) generates for each legitimate user a private key based on its attributes, and also a public key used to encrypt data based on predefined policy. A legitimate user is able to decrypt data only if it holds the sufficient attributes that satisfy the policy.

• Key Policy ABE (KP-ABE) : In this scheme, the data owner defines an access structure A and encrypts data based on a set of attributes I . A user which wants to decrypt the cipher-text must holds the attributes that satisfy the access structure A to be able to derive the private key that decrypts the cipher-text [START_REF] Goyal | Attribute-based encryption for fine-grained access control of encrypted data[END_REF] (see figure 2.2).

• Cipher-text Policy ABE (CP-ABE) : In this scheme, the encryption is based on the access structure A. A legitimate user is a user who holds a set of sufficient attributes I that satisfies the access structure (policy A) attached to the ciphertext [START_REF] Bethencourt | Ciphertext-policy attributebased encryption[END_REF] (see figure 2.3).

Attribute-Based Encryption is considered as a promising scheme for many applications such Cloud computing, multicast communication, M2M, etc. Particularly, in Internet of Things' applications, we need often efficient mechanisms that ensure finegrained access control to IoT data based on the roles of the users in the IoT systems. We can take as an example, the Healthcare applications where EHRs (Electronic Healthcare Records) related to patients are only accessed by physicians and nurses based on their roles in the hospital institution. This is achieved by ABE thanks to its scalability, efficiency and its fine-grained capability. However, the complexity and the high overhead induced by the cryptographic operations in ABE schemes make its application in resource-constrained devices very difficult. These drawbacks are serious problems to overcome in order to adapt ABE in IoT applications.

In [START_REF] Touati | C-cp-abe : Cooperative ciphertext policy attribute-based encryption for the internet of things[END_REF], the authors proposed a distributed lightweight ABE solution based on CP-ABE scheme. The solution takes advantage of IoT heterogeneous nature which consists to delegate the most costly cryptographic operations (exponentiation) to more powerful nodes. However the solution consumes a lot of bandwidth, as objects exchange cryptographic information in order to accomplish the encryption process. The cost due to message exchanges is very considerable in the radio field and must not be neglected.

On the other hand, Nouha et al. [START_REF] Oualha | Lightweight attribute-based encryption for the internet of things[END_REF] proposed ABE based solution that ensures a tradeoff between computation and storage capacity of constrained devices. They use a pre-computation technique in order to reduce computation cost. This technique consists to pre-compute and store in a lookup table a set of pairs obtained generally with expensive cryptographic operations done on elliptic curves and pairing group settings. This information is used later to carry out cryptographic operations with very low computations. The main drawback of this solution is that the look-up table must be as bigger as possible in order to overcome dictionary attacks. Shucheng et al. [START_REF] Yu | Fdac : Toward fine-grained distributed data access control in wireless sensor networks[END_REF] proposed a distributed fine-grained access control scheme based on KP-ABE for wireless sensor networks called FDAC. The authors consider sensor node properties such as its geographic location, the type of sensor's data, time, its owner, etc. as attributes to define access policies in order to control the access of users to sensor data encrypted under the defined attributes. The main properties of the scheme are that sensor nodes may change seamlessly their attributes as well as its capacity to support data aggregation. The feasibility of the solution is evaluated with real experiments under iMote2 platform.

In [START_REF] Guo | Cp-abe with constant-size keys for lightweight devices[END_REF], the authors addressed the key storage in CP-ABE in IoT context. Mostly the encryption key is constant-size (does not depend on the number of attributes). The proposed solution is provably secure in the selective security model. However, this solution generates big ciphertexts which create a big problem for IoT devices that are highly constrained in terms of bandwidth and storage.

In contrast, Müller et al. in [START_REF] Müller | Distributed attribute-based encryption[END_REF] proposed a multi-distributed-authorities based ABE solution for IoT environments. The solution is kind of an adaptation of ABE to support a distributed access policy among a set of authorities, where the generation of secret keys from the attributes is handled with the collaboration of several authorities. Each authority generates a sub-key taking in consideration its maintained access policy.

The most existing ABE schemes are based on expensive bilinear pairing operations, which are, in general, not suitable for constrained devices in IoT. For this reason, some researches have been conducted in order to propose a lightweight nonpairing ABE schemes. The contribution in [START_REF] Yao | A lightweight attribute-based encryption scheme for the internet of things[END_REF] is new lightweight ECC-Based ABE scheme that consists on replacing pairing operations by point scalar multiplication on elliptic curves. Under the ECDDH assumption, the authors proposed a security proof of the scheme in the attribute based selective-set model.

In [START_REF] Su | epass : An expressive attribute-based signature scheme with privacy and an unforgeability guarantee for the internet of things[END_REF], the authors tackled the problem of integrity and authentication in IoT with an expressive attribute based signature (ABS) scheme. The scheme preserves the privacy of signers and don't leak any information about users. However the scheme is still heavy computational for both the signer and the signature's checker as it uses a lot of pairing operations and exponential computations. Thus the scheme is not quite suitable for IoT constrained devices.

In the context of communication based groups in IoT, the authors in [START_REF] Thatmann | Applying attribute-based encryption on publish subscribe messaging patterns for the internet of things[END_REF] proposed to combine Attribute Based Encryption schemes and Publish Subcribe based MQTT messaging architecture in order to ensure data encryption as well as the security requirements in group communications, namely forward and backward secrecy. the proposed solution ensures a flexible keys updating in case of join/leave procedures in MQTT architecture.

In order to study the adaptability and feasibility of applying ABE schemes, namely CP-ABE and KP-ABE, on smart-phone and IoT devices, Ambrosin et al. [START_REF] Ambrosin | On the feasibility of attributebased encryption on smartphone devices[END_REF] have conducted intensive experiments in diverse mobile platforms (smart-phones, laptops, etc.) based on different OS (Android, Windows). The obtained results demonstrate the feasibility of ABE in smart-phones and similarly for IoT devices. On the other hand, authors in [START_REF] Abdel-Aziz | Hardware low power implementation of attribute-based encryption[END_REF] proposed a lightweight hardware implementation of CP-ABE scheme on Field Programmable Gate Array (FPGA). As a proof of concept, CP-ABE based 16 bits key size was tested with different setups. It's worth noting that with the conducted experiments, the scheme is quiet less power consuming.

Privacy solutions

Actually preserving privacy in IoT is mandatory as data issued by smart objects are very sensitives and inherently related to real life's individuals. The main goal of privacy techniques is to ensure the following requirements :

• Anonymity : Property ensuring that a third entity is unable to identify person's identity among other identities in the system.

• Unlinkability : Impossibility to cover the persons' identity from the information they produce.

• Untraceability : Difficulty to track actions and information issued from the behavior of an entity in the system.

The privacy solutions aim to protect sensitive data and also provide mechanisms that hide users' identities in such way the intruders cannot know about their behaviors.

In the following, we discuss some solutions proposed in the literature that address the privacy of data and user's behaviors in Internet of Things.

Data privacy

Data tagging is one of the most known techniques, mainly used to ensure privacy of data flows. The idea behind this concept is to associate additional labels called tags, to data flows in order to allow trusted computing entities to reason about flows of private data and thus hide identities of individuals who hold or control data [START_REF] Bruening | Data tagging for new information governance models[END_REF]. Nevertheless, tagging mechanisms might cause a challenge for constrained devices as tags' sizes raise according to the size of data and also generate additional expensive computations. In [START_REF] Evans | Efficient data tagging for managing privacy in the internet of things[END_REF], authors demonstrated the applicability of tagging mechanism for constrained programmable micro-controller (PIC) by providing lightweight code templates dedicated to resource-constrained devices in order to add tags to data flows.

ZKP (Zero Knowledge Proof

) is a powerful mechanism largely used to ensure the privacy of users' identities. The idea behind ZKP is to allow to one party (prover) to demonstrate to another party (verifier) some property by proving its possessing of some information without disclosing it [START_REF] Chatzigiannakis | Elliptic curve based zero knowledge proofs and their applicability on resource constrained devices[END_REF]. This concept is very useful to develop security protocols while preserving the privacy of users' data and properties. In contrast, Ioannis et al. [START_REF] Chatzigiannakis | Elliptic curve based zero knowledge proofs and their applicability on resource constrained devices[END_REF] proposed an evaluation of some ZKP protocols based on the Discrete Logarithm Problem on elliptic curves (ECC) for resource-constrained devices. The obtained results demonstrate that using ECC (with 1024 key's length) comparing to RSA provide less execution time and less memory with the same level of security. Importantly, with small message sizes, the energy related to the communication is minimized. However, beyond some threshold, the ZKP protocols became more overloaded which is due to the fragmentation of messages.

K-anonymity model is another potential approach to protect the privacy of data in Internet of Things' applications. Considering the context of a set of homogenous data stored in a table where each column represents a record of these data which is owned by some specific user. The K-anonymity models aim to protect each record in the table and make it indistinguishable from at least k -1 records in the same table by hiding the sensitive information about its owner [START_REF] Sweeney | k-anonymity : A model for protecting privacy[END_REF]. These sensitive information may be the ages, the phone numbers, the addresses, etc. This model is largely adopted in big data and cloud applications to protect the privacy of data streams issued by different users. Particularly, in IoT applications, there are also some attempts to adopt k-anonymity models [START_REF] Niu | Achieving k-anonymity in privacy-aware location-based services[END_REF][START_REF] Huang | User interactive internet of things privacy preserved access control[END_REF][START_REF] Huo-Wang | Parallel clustering-based k-anonymity algorithm in internet of things[END_REF]. In [START_REF] Huang | User interactive internet of things privacy preserved access control[END_REF], authors proposed context aware k-anonymity model with conjunction to other privacy protection mechanisms to protect data issued from sensor nodes in WSN. Huo-wang et al.

[72] investigated a clustering technique to propose a k-anonymity model to hide sensitive data about the locations of sensor nodes in IoT context. The idea behind the solution is to gather the data related to the sensor nodes located in different regions in different classes to make them indistinguishable.

Privacy of users' behaviors

In Internet of Things, users and objects perform actions in the systems such as access to sensor data, control remote actuators, etc. Therefore, it's mandatory that their behaviors should be protected against malicious intruders. In what follows, we discuss some works that aim to protect the privacy of users' behaviors.

In [START_REF] Zhang | Distributed privacy-preserving access control in sensor networks[END_REF], the main contribution is a privacy-aware access control protocol called DP 2 AC in Wireless Sensor Networks based on RSA blind signature mechanism. In this solution, the owner of data signs the hash of an arbitrary integer m generated by some user x which forms an access token. So, the user x uses the token < m, (σ(m) = (h(m)) d , where h(m) and σ(m) are respectively the hash of the integer m and the signature of the message m using the owner's private key d > to prove its capability to access data. The verifier which holds the data, checks if h(m) = σ(m) e = h(m) ed to control the access of the user x without necessarily leaking any information about its identity. The protocol has the advantage to be simple and efficient. However, it does not ensure fine grained access as all users have the same privileges to access sensor data.

According to [START_REF] Conoscenti | Blockchain for the internet of things : a systematic literature review[END_REF], decentralized approaches can enhance privacy more than centralized approaches as they do not rely to any central entity which might track data flows and thus can probably deduce sensitive information of individuals from the exchanged data. In contrast, Alcaide et al. [START_REF] Alcaide | Anonymous authentication for privacy-preserving iot target-driven applications[END_REF] proposed a fully decentralized authentication protocol that preserves the privacy of users. Besides, users in the system are authenticated by data collectors in a flexible manner based on Anonymous Access Credentials which are unlinkable.

In [START_REF] Skarmeta | A decentralized approach for security and privacy challenges in the internet of things[END_REF], authors proposed a capability-based access control mechanism by introducing lightweight tokens to access CoAP 4 (Constrained Application Protocol) IoT resources while preserving the privacy of data over end-to-end communications. The token is exchanged in GET CoAP requests and contains the necessary information to control the access to device resources such as request Id, subject Id, Device Id, Issuer Id, Issued time, ESDSA signature, etc.

Recently, Samet et al. [START_REF] Tonyali | Secure data obfuscation scheme to enable privacy-preserving state estimation in smart grid ami networks[END_REF] investigated a new mechanism based on Data Obfuscation schemes in order to preserve the privacy of the exchanged metrics in smart grid AMI networks. The idea of data obfuscation is that each gateway creates and distributes obfuscated values to smart meters. Then, smart meters slightly disturb the sensed data based on obfuscated values and transmit them again to the utility control center, which can do estimation about the received data containing basically the electricity consumption of smart meters. This solution is less-computational which makes it applicable in resource-constrained devices. However, it generates a lot of overhead in the AMI network infrastructure.

Availability solutions

In IoT, the availability of the system is one of the most important security services needs to be protected against malicious attacks (like DoS/DDoS) or unintentional failures. Very often, the damages caused by the violation of the availability are tremendous which can be economical losses (in manufacturing systems) or safety damages (in transportation systems). Furthermore, ensuring the availability is a very challenging task because attackers exploit all types of vulnerabilities in different levels (network, software design, cryptographic algorithms, etc.) to break the system. For example, in October 21, 2016, one of the largest American computer companies providing DNS service, DYN (Dyn Managed DNS) was attacked by hackers who used a type of DDos attack exploiting IoT devices. During this attack, many known sites were blocked for 10 hours, such as Amazon, BBC, PayPal, etc. The attackers take advantage of comprised IoT devices (such as surveillance cameras) infected with the malicious software named Mirai to relay massive packet streams. [START_REF] Sahraoui | Efficient hip-based approach to ensure lightweight end-to-end security in the internet of things[END_REF]. However, these protocols are not initially designed to deal with the most common IP based DoS/DDoS attacks. Many solutions have been investigated to enhance DTLS based transport layer and RPL based 6LoWPAN routing protocol in order to turn them more robust and secure against DoS attacks. In these solutions, IP routers and IoT gateways inspect and analyze packets in order to identify eventual malicious behaviors and take actions accordingly.

Regarding TCP/IP transport layer, the contribution in [START_REF] Maleh | Dos attacks analysis and improvement in dtls protocol for internet of things[END_REF] consists on an enhancement of the DTLS protocol in order to mitigate DoS/DDoS against IoT devices and gateways. The enhancement is done by extending the process of the DTLS handshake with an additional cookie exchange technique where the server, before resource reservation, sends an authentication cookie's code to the client through HelloVerifyRequest message. This later, upon receiving the message, could authenticate the server and sends again to the server a new authentication cookie encapsulated in Hello message. To prevent IP spoofing attacks during the handshake phase, a mutual authentication step is done between the client and the server through a Gateway.

On the other hand, in TCP/IP network layer and specifically in the routing level, many security enhancements of RPL and 6LoWPAN based IoT architectures are proposed. In contrast, Kasinathan et al. [START_REF] Kasinathan | Denialof-service detection in 6lowpan based internet of things[END_REF] proposed an architecture to protect IoT based 6LoWPAN devices against DoS attacks as well as jamming and tampering attacks in the context of the European project called ebbits 7 . The main contribution is twofold : first, the design of Intrusion detection manager that is charged to protect constrained devices against DoS attacks. Second, the design of the IDS (Intrusion Detection System), operating in promiscuous mode, that is responsible to monitor 6LoWPAN packets and raises alerts in case of any misbehavior. The solution is based on Suricata IDS8 that uses the signature based detection technique. Likewise, Hummen et al. [START_REF] Hummen | 6lowpan fragmentation attacks and mitigation mechanisms[END_REF] investigated the attacks related to 6LoWPAN fragmentation mechanism, basically two attacks were studied : fragment duplication attacks and buffer reservation attacks which both of them aim to prevent the availability of the IoT devices. They proposed a mitigation approaches that counter to these attacks. In the routing level, Rghioui et al. [START_REF] Rghioui | Denial-of-service attacks on 6lowpan-rpl networks : Threats and an intrusion detection system proposition[END_REF] surveyed the potential DoS attacks that could disturb RPL and 6LoWPAN IoT protocols. They proposed also mitigation solutions of theses attacks based on IDS approach. Likewise, recently, [START_REF] Shreenivas | Intrusion detection in the rpl-connected 6lowpan networks[END_REF] focused on intrusion detection in RPL based 6LoWPAN. They proposed some extensions of the protocol by exploiting the ETX (Expected Transmissions) metric as a mechanism to prevent malicious nodes.

Recently, Cusack et al. [START_REF] Cusack | Identifying dos and ddos attack origin : Ip traceback methods comparison and evaluation for iot[END_REF] discussed and compared many IP traceback approaches based on some metrics such as storage requirements, processing overhead, bandwidth overhead, scalability, etc.

Artificial intelligence techniques such as Artificial Neural Networks (ANN)

are considered as one of the most powerful techniques used to design security solutions as IDS for example IDS. In [START_REF] De Almeida | Performance evaluation of an artificial neural network References multilayer perceptron with limited weights for detecting denial of service attack on internet of things[END_REF], authors investigated the application of ANN to detect DoS attacks in IoT. They evaluated two kinds of ANNs, namely : Multilayer Perceptron with Limited Weights and Multilayer Perceptron with normal weights in order to verify which one is more adequate as an IDS in IoT. It's worth noting that both of ANN techniques reduce false positive detection under training process. However, they consume a lot of memory which makes them not quite suitable for constrained IoT devices.

Others researchers [START_REF] Machaka | Using the cumulative sum algorithm against distributed denial of service attacks in internet of things[END_REF] investigated the possibility of applying Cumulative Sum (CUMSUM) algorithm in order to detect DDoS attacks in the context of IoT. The main aim of CUSUM algorithm is to detect real time changes in statistic process issued from data streams. The DDoS detection is done by analyzing the network traffic and computing statistics about it. The algorithm handles, continuously, these statistics to eventually detect changes which are related to any misbehavior in the network traffic. A trade-off between False Positive Rate and Detection Rate is also investigated by playing on CUMSUM algorithm parameters.

Other works have tackled with DoS attacks related to routing protocols in WSN and Internet of Things. Indeed, security of routing protocols is a fundamental field of research as many IoT applications use in general wireless mesh or ad-hoc network infrastructures to exchange data in real time. It is the case, for example, of AMI in smart grids and ad-hoc infrastructures in Vehicular Networks. In [START_REF] Alanazi | On resilience of wireless mesh routing protocol against dos attacks in iot-based ambient assisted living applications[END_REF], authors interested in healthcare applications. They studied several mesh routing protocols in order to choose the most robust and secure protocol against DoS attacks. They focused on one type of DoS attacks that aims to divert the routing protocol behavior from its initial function. For example, routing attacks that force some network nodes to reroute data to inappropriate destination. Simulation results confirmed that PASER protocol is the most suitable for Healthcare applications and it is resilient against Hello Flooding attacks.

New emerging security solutions for Internet of Things

The IoT promises to connect everything together anywhere and everywhere. All devices must interact efficiently with each other in a secure, scalable and reliable ways. Actually with the current centralized architecture, it could be difficult and challenging to deal with scalability in huge IoT networks. This issue may be solved by adopting a new approach of security emerged away from the current centralized model. New emerging approaches deal very efficiently with scalability, interoperability and compatibility issues. Hereafter, we discuss two emerging technologies which are being adopted as approaches to ensure security in IoT environments and deal very efficiently with scalability issues.

Software Defined Networking based solutions

The Software Defined Networking (SDN) is a new paradigm that has revolutionized the world of networking, thanks to the programmability and the intelligence it has introduced into the network. The main idea behind this concept, which began in 2011, is to separate the network control plan and the data plan. Using this paradigm, we can do centralized control and configuration of networks as well as dynamic management of network traffic. In SDN architectures, devices (routers, switches, gateways and IoT devices in general) do not make control decisions like forwarding tables and ACL rules [START_REF] Hu | A system architecture for software-defined industrial internet of things[END_REF]. Instead of that, they learn these rules from central component called SDN controller, which is managed to take all decisions in the network using protocols like Openflow. Devices in SDN architecture handle packets based on flow tables dictated by SDN controller.

SDN is an efficient solution to meet some challenges in IoT environments where most of devices have limited network resources. As a result, SDN deployment in conjunction with NFV (Network function Visualization) can optimize efficiently the resource allocation in IoT devices. Therefore, it introduces some many opportunities in order to overcome some challenges of reliability, security, scalability and QoS in IoT applications in more efficient and flexible way [START_REF] Hu | A system architecture for software-defined industrial internet of things[END_REF]. Hereafter, we discuss some SDN based solutions that address the security issues in IoT.

The main contributions in [START_REF] Flauzac | Sdn based architecture for iot and improvement of the security[END_REF] are twofold. First, the authors proposed a new multi-domains SDN based IoT architecture that supports both networks with or without infrastructure. Second, they designed a distributed security model to manage security policies between multiple SDN domains. In order to address the conflict issues that appear from the enforcement of the security policies on the several domains, the solution takes advantage of the grid of security paradigm that aims to solve security heterogeneity issues. So, each SDN controller is charged to push security policies inside its domain and coordinates with other SDN controllers outside the domain.

In [START_REF] Bull | Flow based security for iot devices using an sdn gateway[END_REF], authors presented an openflow9 based SDN architecture for IoT devices. The proposed architecture includes IoT gateways that are managed to identify attacks and anomalies in order to determine which devices are acting maliciously and which are the compromised nodes in the network. To do that, each gateway analyzes the network traffic dynamically. So, upon the detection of an anomaly or an abnormal behavior such as generated periodic flows (DoS attacks), the gateway applies an appropriate mitigation action (block, forward, apply QoS) depending on the anomaly.

The work in [START_REF] Vandana | Security improvement in iot based on software defined networking (sdn)[END_REF] considers the heterogeneous IoT infrastructure as a couple of connected clusters or segments, where in each segment, there are IoT nodes that support Openflow protocol and have sufficient resources in terms of computation and energy. These IoT nodes act as SDN gateways, and are charged to : 1) authenticate nodes in the same segment, and 2) enforce adequate security rules using Openflow protocol. The SDN gateways exchange between them the security rules in order to establish secure, end-to-end connections between IoT nodes in different segments.

Gonzalez et al. [START_REF] Gonzalez | Sdnbased security framework for the iot in distributed grid[END_REF] present a new SDN framework to overcome the different kind of attacks in IoT environments. The proposed framework is based on the architecture called SDCSN (Software Defined Cluster Sensor Networks) proposed in [START_REF] Olivier | Sdn based architecture for clustered wsn[END_REF] that consists of multi-domain SDN architecture. Each SDN domain (cluster) has a SDNCH (SDN Cluster Head) that is charged to monitor and secure SDN domain and prevent outside and inside attacks. The mechanisms employed in order to implement an SDN firewall are based on analysis of flow entries on the application level.

Other works investigated SDN approaches as solutions to prevent against malicious attacks such as DoS and also implement efficient IDS. In this contrast, Lee et al. [START_REF] Lee | Assessing the impact of dos attacks on iot gateway[END_REF] tackled the problem of availability in IoT based gateway environments for which they proposed an SDN based solution to prevent IoT gateways from DoS attacks and evaluate the main impacts. In order to evaluate the impact of different kinds of Dos attacks on IoT gateways, the software solution was implemented using Raspeberry Pi2 platform, OpenWRT operating system as a wireless Router and Opendaylight as an SDN controller.

Aydeger et al. [START_REF] Aydeger | Mitigating crossfire attacks using sdn-based moving target defense[END_REF] proposed a SDN-based MTD (moving target defense) mechanism to defend against specific types of DDoS attacks called Crossfire. The SDN-based mitigation approach consists to enhance the packet forwarding process in such away routes containing congested links are avoided.

Main challenges of SDN in terms of security in IoT

During these last years, there are a lot of discussions about SDN and its benefits in the industry of networking. However as new emerging technology, SDN is not enough mature to address the security issues in Internet of Things. Hereafter, we discuss some potential challenges that are still difficult to overcome with SDN based approaches :

• In general SDN based security solutions are designed to operate in centralized architectures. Therefore, the centralized SDN controllers emerge as a potential single points of attacks that should be protected against attacks such as DDoS for example.

• Southbound interface between SDN controller and data plan is vulnerable to threats that could degrade the performance of the network. As example, Openflow protocol suffers from integrity as mentioned in [START_REF] Brief | Sdn security considerations in the data center[END_REF].

• SDN approaches suffer from scalability issues. Indeed, SDN controllers can not deal efficiently with the large number of IoT devices in the underlying data plan network.

• In highly dynamic environments like vehicular networks, where network topology changes frequently and a lot of messages are exchanged between vehicles, centralized SDN approaches is still limited. Indeed, gathering all these changes from the underlying network to enforce security policies and configurations using SDN approaches takes a lot of time.

Blockchain based solutions

Blockchain is a new effective technology that has revolutionized the world of cryptocurrency these last years. this technology has received a great attention by researchers in various fields. Until now, its application has recognized a great success in financial applications and smart contracts, but some researchers claim that it's worth investigating to think out of the box and try to figure out other application domains than cryptocurrency that this effective technology can improve considerably as Internet of things and security domains. In this section, we introduce the technology blockchain, its benefits as well as some security based solutions in the field of IoT.

Review on Blockchain

Blockchain consists mainly of a secure distributed database (a.k.a public ledger) containing all the transactions that have been made by all the participating entities.

The main aim of this database is to allow heterogeneous nodes to communicate and exchange assets between each other in a completely distributed and secure way, without relying to any trusted central entity. Basically, each node in the blockchain does not trust any other node, however, it trusts the whole blockchain network. In the blockchain, each node holds a pair of cryptographic keys (public and private key) that allows to generate transactions and interact with other nodes in the network. In addition, these transactions are immutable. Indeed, it is hard to falsify any transaction once added to the blockchain. In the distributed (P2P) architecture, blockchain network, it is mandatory that the whole nodes reach a consensus state about the validation of each transaction. We note that in order to insert a transaction in the blockchain, the majority of validation nodes called miners or validators need to validate it. In what follows, we explain the different steps from transaction generation until the validation of the transaction in the blockchain [START_REF] Bouzefrane | Cloudlets authentication in nfc-based mobile computing[END_REF] :

• When an entity A wants to exchange some asset (crytomoney in case of bitcoin) with another entity B , it generates first a transaction containing the asset and sign the transansaction with its private key. Then, it broadcasts the transaction to all the peers in the blockchain.

• Each validator node (known also as miner in bitcoin) periodically (10 minutes in the case of bitcoin) gather a set of transactions in one single block. It must verify the correctness of each transaction before adding it into the block.

• Each validator must locally execute the adopted consensus technique to validate and broadcast the block to all the peers in the network.

• After verifying the format of the transactions, the other nodes verify the correctness of the validated block received by each validator node. If the the block is correct and the consenus is reached, all the peer add this block to the blockchain. Otherwise, the block is discarded.

Basicaly, we have two types of blockchains : public blockchain (permissionless) and private blockchain (permissioned). In public blockchains, any node in the network is able to perform and participate in the consensus process to validate transactions. On the other hand, in private blockchains, the consensus processus is performed only by a subset of nodes that form a consortium.

Consensus mecanisms

Depending on the type of the blockchain, we distinguish several consensus protocols [START_REF] Cachin | Blockchain consensus protocols in the wild[END_REF]. In the following, we highlight three most known consensus protocols :

Proof of Work (PoW) : the process of validation in PoW is done by a subset of powerful nodes called the miners that must solve a heavy mathematical puzzle. This puzzle consists on finding a nonce value in such a way, when it is contactenated with the hash of the previous block H(B t-1 ), the merkle hash of the current block M erkleHash and the timestamp, the obtained hash must start by a certain number of zeros depending on the difficulty of mining. In other words, the nonce value must verify h(h(B t-1 )||M erkeHash||timestamp||nonce) < dif f iculty. Once the block is validated, it is simple for each node in the blockchain to verify whether the validation of the block is done correctly. In practice, it is impossible to to falsify or update one block yet validated without redoing the same heavy validation process for this block and all its subsequent blocks in the blockchain.

Proof of Stack : in proof of stack concensus, each node must prove its possession of some stack (coins in the case of cryptocurrency). This stack value is used to choose the validator for each block, so nodes that hold the highest amount of stack are more likely to be selected. The concept of stack can be generalized to represent any kind of assests such nodes' trust level of nodes. Practical Byzantine Fault Tolerance (PBFT) : PBFT was originally proposed to solve the problem of Byzantine generals [START_REF] Castro | Practical byzantine fault tolerance[END_REF]. This protocol can tolerate Byzantine faults up to 1 /3 faults. Indeed, the validation of each block is done only if each node receives at least 2 /3 of "block commit" messages from the other validator nodes. This protocol is very efficient especially in private blockchains as there is no need to perform heavy compulations during validation process and it is fairly distributed compared to PoS protocol which tends to be centralized.

In figure 2.5, we illustrate the different steps evolved in the blockchain transaction treatment process. We illustrate also in figure 2.4 the general structure of a block (the case of bitcoin system).

New emerging IoT based applications will be taking advantage of secure and private transaction messaging, decentralization of communications, privacy by design which are all very important features for IoT [START_REF] Bahga | Blockchain platform for industrial internet of things[END_REF]. As IoT continues to grow, sensors and devices are becoming more common places to communicate information like location, temperature and other properties. Often, this information needs to be shared between different entities and exploited for big data analysis and also for monitoring purposes in some critical applications. Blockchain can help to create tamper-resistant record which allows all participating smart objects to access the same data in more consistent and safer way. In addition to data flow management, blockchain consists of an efficient way for automating business and creating smart contacts among smart devices without referring to central entities. We mean by smart contracts, all kinds of digital rules forming the terms of a contact [START_REF] Christidis | Blockchains and smart contracts for the internet of things[END_REF]. Concretely, a smart contract consists of a computer program that is automatically executed by smart objects, and defines a set of rules and conditions based on the terms of the contract. Blockchain could help to ensure the smooth running of the contracts in a distributed way. We already have some examples of applications that are non financial such as global identity registry systems (namecoin [START_REF] Loibl | Namecoin. namecoin[END_REF], Blockstack [START_REF] Ali | Blockstack : A global naming and storage system secured by blockchains[END_REF] among others), insurance applications [START_REF] Mainelli | Chain of a lifetime : How blockchain technology might transform personal insurance[END_REF], online voting [START_REF] Roby | Application of blockchain technology in online voting[END_REF], supply chain provenance [START_REF] Kim | Towards an ontology-driven blockchain design for supply chain provenance[END_REF], decentralized peer to peer storage platform (storj [START_REF] Wilkinson | Storj a peerto-peer cloud storage network[END_REF]) etc. Moreover, recently, in the literature, some blockchain based solutions have been proposed to solve some security and privacy issues in IoT. We discuss some of these solution in the following sections.

Benefits of blockchain in IoT

Hereafter, some added values that blockchain technology can bring to IoT and security domains [START_REF] Conoscenti | Blockchain for the internet of things : a systematic literature review[END_REF] :

• Decentralization : Because of the decentralized architecture of IoT, blockchain is most suitable as a security solution in IoT. The decentralized architecture of blockchain makes security solutions most scalable and can solve the problem of single point of failure and becomes more robust to DoS attacks.

• Pseudononymity : The nodes in blockchain are identified by their public keys (or the hash of public keys). These pseudonyms don't link any information about the identity of the participating nodes.

• Security of transactions : Each transaction, before being sent to blockchain network, is signed by the node and must be verified and validated by miners.

After the validation, it's practically impossible to forge or modify transactions already saved in the blockchain. This provides a proof of traceable events in the system.

Secure IoT transactions

Using blockchains, some works were focused on secure IoT transactions in decentralized architectures. We discuss hereafter some of those proposals. The first IoT platform based blockchain solution was developed by IBM in 2013. This platform is called ADEPT (Autonomous Decentralized Peer-To-Peer Telemetry) [START_REF] Atzori | Blockchain-based architectures for the internet of things : A survey[END_REF] which consists of proof of concept of a decentralized and secure IoT platform based on Ethereum protocol which is a seamless solution to deal with devices contracting and transactions in a most scalable way. So IoT devices can define and set autonomously their own roles, responsibilities and permissions in the whole IoT ecosystem and also can do transactions and complex negotiations between themselves.

In [START_REF] Gaurav | Iot transaction security[END_REF], authors proposed an HTTPS protocol for IoT devices by eliminating the intermediary devices (like mobiles) to create secure HTTPS channel (classical solution). The session key is generated by PBKDF2 (Password-Based Key Derivation Function 2) algorithm and the IoT transactions are stored in a blockchain maintained between several devices. This solution could be enhanced by introducing a priority among transactions.

Recently, Kamanashis et al. [START_REF] Biswas | Securing smart cities using blockchain technology[END_REF] proposed a multi-layer security architecture for smart cities that integrates the blockchain as a distributed database layer to share and store heterogeneous IoT data related to the smart city environment such as traffic, temperature, location, humidity, etc. The data storage aims to share these data in a secure way among different smart cities' components. The architecture is designed to deal with scalability and reliability issues that are very challenging in smart cities environments.

In [START_REF] Kokoris-Kogias | Managing identities using blockchains and cosi[END_REF], the authors proposed a solution to manage SSH public keys based on blockchain and collective signing authorities. They mainly addressed the key management problem presented between IoT devices to access to distant services. The main idea of the solution consists on adding a new block in the blockchain containing the SSH public keys whenever a key is added, rotated or updated.

Recently, Hardjono et al. [START_REF] Hardjono | Cloud-based commissioning of constrained devices using permissioned blockchains[END_REF] proposed a solution for identifying the manufacturing provenance of IoT devices while preserving the identities of the users using blockchain and cloud computing. The authors proposed a platform solution based on EPID (Enhanced Privacy Identity protocol) of Intel, a standard used for identification of IoT devices. The platform supports also device owners data selling in order to incentive IoT devices' owners to share their IoT data.

Data Sharing

In several IoT applications, a lot of data is exchanged between objects and with other entities. For that, it's very important to deal with this data and propose security solutions to share it with others. Moreover, privacy is a great issue that should be considered while addressing sharing data problem in IoT. According to [START_REF] Conoscenti | Blockchain for the internet of things : a systematic literature review[END_REF], to ensure privacy in IoT systems, it is recommended to use peer-to-peer architecture, and specifically the blockchain technology. In addition, as all the operations handled on IoT data are controlled by the blockchain, it is easy to detect any abuse in data [START_REF] Conoscenti | Blockchain for the internet of things : a systematic literature review[END_REF]. Blockchain might serve as a tool to deal with all these aspects. In this trend, several works have been proposed.

In [START_REF] Hashemi | World of empowered iot users[END_REF], authors proposed a decentralized solution for sharing data in IoT environment which consists of a distributed data storage system. The proposed system uses blockchain to maintain data access control and data storage model. The main features of this system are : 1) separation of data store and data management. This later is ensured using blockchains, 2) a decentralized access control and 3) a scalable messaging based on Publish-subscribe model to query data.

In [START_REF] Yue | Healthcare data gateways : found healthcare intelligence on blockchain with novel privacy risk control[END_REF], authors proposed a healthcare data sharing based blockchain architecture. The proposed architecture includes three layers to manage the access to private ERH (Electronic Medical Record) related to patients. The first layer consists of the different users that are potentially interested to access the patient's data. To do that, a user sends different requests to the Healthcare Data Gateways (second layer) in charge of the management of the access control to the data stored in the blockchain, used as a storage data layer which is based on cloud storage. Besides the immutability property of blockchain, the ERH are encrypted and signed to ensure the confidentiality, the authenticity and the integrity of data.

Main challenges of blockchain in IoT

Despite the blockchain's benefits mentioned above, it is still some challenges to be solved in order to adapt the blockchain technology in IoT. We enumerate the following challenges :

• Computation and storage issues : As most of IoT devices have limited capabilities in terms of computation and storage resources, the blockchain needs to be customized before its application as security solution in IoT. To address the problem of adaptability, one solution may consist to add a new application level that hides the details of blockchain implementation, namely the PoW (Proof of Work) [START_REF] Conoscenti | Blockchain for the internet of things : a systematic literature review[END_REF]. This solution allows the resource-constrained IoT devices to involve in the system without computing the PoW.

• Time latency : In bitcoin blockchain, the validation of transactions takes about 10 minutes, which creates a problem for real time applications.

• Scalability issues : Although the remarkable success of bitcoin blockchain and the number of users that rises year after year, blockchain technology is still non scalable solution in IoT environments.

• Bandwidth consumption : As IoT devices generate a lot of transactions, this includes an important problem if it is necessary to validate each of those transactions that consume a lot of bandwidth.

• The anonymity : Actually, blockchain does't ensure a fully anonymous transactions. Indeed, the peers are identified by pseudonyms that can be tracked but they are still unlikable (impossibility of extracting identity of the person from its pseudonym) [START_REF] Conoscenti | Blockchain for the internet of things : a systematic literature review[END_REF].

Summary and discussion

In Table 2.2, we present a comparison of security solutions implemented in IoT based on criteria that we described previously in section 2.2

At first glance, we notice that security solutions implemented in IoT and proposed in the literature are not all efficient in all the aspects and don't fulfill all the security requirements. Indeed, traditional solutions based on cryptographic techniques which are adapted for IoT applications are, generally, efficient in terms of storage and computation. However, they are limited in terms of scalability and heterogeneity. In the other hand, blockchain based solutions deal very well with scalability and heterogeneity issues thanks to the distributed architecture offered by blockchain technology. Nevertheless, the most drawbacks of blockchain technology are the energy consumption and latency caused by the proof of work mechanism to validate transactions which is serious problem in the case of real-time and energy constrained IoT applications. In the other side, SDN approaches optimize very efficiently computation costs, energy consumption and network resources since all control tasks are dedicated to high-performance servers (called SDN controllers) which discharge constrained IoT devices from greedy operations (including the execution of cryptographic tasks). Obviously, as a centralized approach, SDN doesn't deal efficiently with scalability issues in IoT.

Conclusion

In this chapter, we surveyed security solutions proposed for IoT applications. We first categorized the different IoT applications by identifying their security requirements and their inherent challenges. Then, we discussed the IoT solutions dealing with confidentiality, privacy and availability which are based on traditional cryptographic solutions. We also reviewed some emerging technologies such as Blockchain and Software Defined Networking which are considered as efficient mechanisms to deal with scalability issues in IoT. Finally, we discussed some security solutions that take care of the context in which IoT applications involve and also the different impacts of security issues on the safety of systems and some countermeasures. Comprehensive comparison of the different approaches was provided based on some criteria, we investigated also some analysis of which techniques are suitable for each kind of IoT application. Despite the efforts that have been spent to deal with the various challenges to which Internet of things face, it is still a lot of open issues to be addressed such as scalability and dynamism issues, especially because IoT is becoming an Internet of Everything where humans, data, processes and objects are We provide in this table a deep analysis and comparison of the solutions we presented previously in this survey according to several security challenges. We use the following notations to assess the level of satisfaction of each solution with respect to the different challenges : + + good ; + average ; -poor (limited) and --bad.

evolving together in highly dynamic and complex system.

Chapitre 3

Fine-Grained Secure Control of Smart Actuators in IoT

In this chapter, we focus on some kind of IoT applications where we need to control remotely smart actuators over the Internet using IoT devices such as mobile devices and smartphones. This arises particularly in industrial applications to control manufacturing processes and also in smart home applications to control home appliances such as the control of home alarm systems, the monitoring and the regulation of the temperature level, turning on/off lights, etc. In SCADA based manufacturing systems, there are a tremendous number of smart actuators and sensor devices to monitor and control physical infrastructures. Basically SCADA based control systems are designed in practice in such a way actuators and robots could be accessed and controlled remotely via mobile devices [START_REF] Cárdenas | Research challenges for the security of control systems[END_REF][START_REF] Żółkiewski | Remote control of industry robots using mobile devices[END_REF]. This problem of remote control of actuators was investigated in some previous research works [START_REF] Ahammed | Home appliances control using mobile phone[END_REF][START_REF] Das | Home automation and security for mobile devices[END_REF][START_REF] Ghabar | Remote control and monitoring of smart home facilities via smartphone with wi-fly[END_REF][START_REF] Pellarin | Communication method and device for remote control of an actuator for mobile equipment in a building[END_REF]. However, most of the proposed solutions have only interested in implementing remote control protocols without addressing the security issues that could occur between mobile devices and remote actuators. Indeed, there are vulnerabilities related to the underlying network between mobile devices and smart actuators that were not considered. As examples of such vulnerabilities, one can cite, eavesdropping, denial of service, replay attacks and node compromises among others. Therefore, an access control mechanism shoud be developed in order to guarantee the execution of sensitive actions by only the uthorized users. Particularly, in industrial systems as SCADA, existing security solutions are not scalable enough to meet the requirements of large systems. Indeed, most of existing solutions do not allow to define fine-grained security policies in scalable way to control the access to remote actuators.

In order to overcome this important issues discussed above, we propose in this chapter a new efficient security protocol to secure the execution of remote actions on smart actuators. In our solution, we define fine-grained privileges to the different users based on their roles in the system. To this end, we take advantage of the Attribute Based Encryption tool to define access policies in a more scalable way.

Furthermore, we use one way hash chain as a technique to authenticate IoT devices while preventing against replay attacks.

We evaluated the robustness of our solution in terms of security using AVISPA as a formal verification tool and the obtained results demonstrated that our protocol is secure under various kind of attacks. We also evaluated the performance of our solution and the obtained results show its efficiency in terms of computation and scalability.

Related works

In this section, we review some secure control based IoT solutions which are closely related to our work.

In [START_REF] Mantoro | Secured communication between mobile devices and smart home appliances[END_REF], the authors proposed a solution to remotely control and monitor home appliances via internal and external mobile devices. The communication between mobile devices and home appliances is done by GSM network and using SMS messages to send commands to the home gateway to perform remote actions. The exchanged control messages are encrypted using AES standard. As a prototype, they developped a Java application to control sensorboxes in smart home environement. The main drawback of this solution is its non scalability since the architecture is not designed to support large number of mobile devices. Therefore, the solution could not be applied in large scale systems such as SCADA systems.

Mantoro et al. [START_REF] Acker | Secure ubiquitous house and facility control solution[END_REF] proposed an enhanced SSP (Secure simple pairing) for Bluetooth based comunications between smartphones and home appliances in order to control and monitor IoT devices in small areas. Basically, the enhancement consists to improve SSP protocol, designed initially for Bluetooth communications, to resist against man-in-the-middle attack during the connection between smart home device and the mobile device.

Wang et al. [START_REF] Wang | Secure and efficient control transfer for iot devices[END_REF] proposed a lightweight protocol to secure remote control of IoT devices by portal controllers like smart phones or tablets. The protocol involves three parts : the IoT devices, the portal controllers (smart phones in general) and trust center. The Trust Center is responsible for transfering the control process to legitimate controllers, those later are authenticated against IoT devices based on lightweight hash function and shared keys between IoT devices and controllers. The protocol is resistant to classical attacks such replay, DoS, desynchronization and man in the middle attacks and preserves the privacy of communications like non traceability of control messages between smart devices and controllers. However, the protocol has some scalability issues, since each IoT device needs to share symmetric keys with trust center and all legitimate portal controllers controlling such device.

In addition, the protocol generates an overhead regarding the number of exchanged messages.

Compared to the above schemes, our protocol ensures finegrained access control while minimizing the overhead of message exchanges and cost computation thanks to Attribute Based Encryption and One way hash chain mechanisms.

Background

In this section, we provide a brief description about Ciphertext-Policy Attribute Based Encryption mechanism and one-way hash chain, which serve as techniques to design our solution.

Ciphertext-Policy Attribute Based Encryption

CP-ABE is powerful encryption tool, proposed by Bethencourt et al. in [START_REF] Bethencourt | Ciphertext-policy attributebased encryption[END_REF], to ensure fine-grained access control of data shared by an owner. The idea of CP-ABE is that the encryption is done based on a policy that defines relationship between a set of attributes. So, only users that hold a set of attributes that satisfy the policy are able to decrypt ciphertexts. CP-ABE consists of the following algorithms [START_REF] Bethencourt | Ciphertext-policy attributebased encryption[END_REF] :

• Setup(k ) : it is a randomized algorithm which is run by the authority. It takes k (security parameter) as a parameter and outputs a master key MK which is kept secret in the authority and a public key PK which is made public and used to encrypt data.

• Encrypt(PK , M , Γ ) : it is a randomized algorithm which is run by the owner of data. It takes as parameter the public key PK , the message to encrypt M and the policy Γ . The algorithm outputs the ciphertext CT of the message M encrypted under the policy Γ .

• Key-Generation(MK , γ) : It is a randomized algorithm, which is run by the authority to generate secret keys D based on a set of attributes γ hold by each user.

• Decrypt(CT , D, PK ) : it is a deterministic algorithm which is run by the user that wants to decrypt the ciphertext CT based on its secret key D. The user is able to cover the plaintext M only if its secret key D was generated based on a set of attributes γ that satisfies the policy Γ (i.e Γ (γ) = 1 ). Otherwise, the algorithm outputs ⊥.

Example of encryption with CP-ABE

Consider a simple example in the context of access control in smart building of research laboratory. As shown in figure 3.1, let assume that the director of security team encrypts a file by defining the access policy Γ = ("Director" OR ("Student" AND "M ember in security team")), based on the encryption primitive of CP-ABE. If the user A holds a secret key that has been generated based on the attributes set γ A = {"Director"}, it will be able to decrypt the cyphertext published by the owner, as the set of attributes γ A satisfies the policy access Γ. On the other side, if the user B has the attributes γ B = {"Student", "M ember in networking team"}, it will not be able to decrypt the cyphertext because it does not hold the sufficient attributes that satisfy the access policy.

One way Hash Chain

One-Way Hash Chain is a powerful technique widely used to authenticate data sources in real-time data stream communications. In this work, we use this technique as lightweight mechanism to authenticate IoT devices and users by IoT actuators in such way we overcome replay attacks.

Considering a secure one way hash function H : {0 , 1 } * → {0 , 1 } l , one way hash chain is defined as a sequence of n hash values : h 1 , h 2 , , h n for n ∈ N , where the hash values h i ∈ {0 , 1 } l , for 1 ≤ i ≤ n , are defined as follows : The hash chain is designed in such way from a hash value h i we can compute efficiently the values h j , for j < i , but it is hard to compute the values h k for k > i .

h k =    H(h k-1 ) if 1 < k ≤ n H(m), m ∈ {0, 1} * if k = 1 (3.1)
Each value h i is used as disposable token to authenticate one user in one period of time. The order of tokens' usage is depicted in figure 3.2.

Models and security requirements

In this section, we present the system model and the security requirements that we consider in the developpement of our solution.

System model

In our system model, we consider a set of IoT smart actuators SA = {SA 1 , SA 2 , } owned by some owner O i . We note that we could have multiple owners that manage their IoT smart actuators. However for sack of simplicity, consider only one owner. As depicted in figure 3.3, the system that we consider is composed of the following entities :

• Network of actuators : a set of IoT smart actuators SA = {SA 1 , SA 2 , } that form the control system network. These actuators are deployed in an area of interest and are internet enabled to allow outside users to control them remotely. We can give as an example an IoT based industrial control system where a set of IoT components are remotely controlled by client IoT devices which are located outside of smart actuators network. Each smart actuator SA j allows remote execution of a set of actions A j = {A j1 , A j2 , }. Since actuators are usually not powerful, so we have to design lightweight authentication protocol that is less energy consuming.

• Gateway : The gateway is deployed at the edge of the actuators' network which serves as a relay between IoT actuators in the inside of the network and other IoT devices at the outside of the network. It is also charged to manage access control to IoT actuators to execute actions remotely.

Security model and requirements

In our security model, we consider the following assumptions :

The central authority is completely trusted by all IoT devices (actuators and sensors) and also by owners and IoT gateways.

IoT actuators are not powerful and are not robust against internal attacks trying to comprise them. In this work, we will not discuss mechanisms that deal with attacks trying to compromise actuators and therefore we assume that IoT actuators are available and are not compromised neither spoofed.

IoT Gateways are supposed to be honest-but-curious which means that they follow the protocol properly but they may be curious about users' behaviors and their privacy.

We note by PK O i and D O i the owner's public and private keys respectively. Likewise, PK G and D G are the public and the private keys of the gateway G. We assume also that the communications between gateway G and IoT actuators as well as between the owner O i and the gateway are secure (secure channels are established between the different entities).

Under the aforementioned assumptions and the system model previously described, Replay attacks robustness : Our authentication protocol must deal with replay attacks. This mean that an attacker or malicious user using an IoT device D j cannot use the token T i (t) elapsed by some IoT device D i (i = j ) at the instant t to get access to the same actuator by using the same token T i (t) at the instant t + 1 .

Proposed lightweight fine-grained secure control protocol

After introducing the system and security models, in this section, we present in more details our proposed protocol which allows to control remotely the execution of actions on smart actuators. Table 3.1 defines the most important notations used in this section.

In order to design an adaptative and fine-grained access control protocol, we exploit two main mechanisms which serve as the building blocks of our protocol namely : The public key of the gatewayG

CH i

The hash chain used by some actuator to authenticate device aD i Tableau 3.1 -Table of notations 1) Cipher-Text Attribute Based Encryption and 2) One way hash chain. Basically, our proposed protocol works in three steps that we sketch in the rest of the section.

Initialization

In this phase, the trusted authority generates material keys (public and secret keys) for IoT devices based on the roles of the users (the attributes held by each device

D i ).
Each owner O i defines, for each smart actuator SA j it holds, the adequate policies for all the actions a jk ∈ A j that should be executed remotely on the actuator SA j .

In other words, we associate for each action a jk ∈ A j a policy P jk that defines finegrained access rules based on some attributes held by the smart IoT devices. The relationships between the attributes are established based on logical "AND" and "OR" gates as discussed in CP-ABE initial scheme [START_REF] Bethencourt | Ciphertext-policy attributebased encryption[END_REF].

Subsequently, each owner O i generates, for each action a jk , a random challenge

M jk ∈ {0 , 1 } l .

Token generation

In this phase, client IoT devices negotiate tokens from the IoT gateways to execute actions on smart actuators. As depicted in figure 3.6 (from step 5 to step 10), many steps are carried out by three entities : the client IoT device D i , the gateway G and the smart actuator SA j as follows :

The client IoT device D i , which wants to execute action A jk on the actuator SA j , sends a request message containing the pair < SA j , A jk > to the gateway G (step 4 in Fig. 3 set of attributes that satisfies the policy P jk , then it will be able to decrypt the ciphertext C jk using CP-ABE decryption primitive and thereby covers the plaintext M jk . Then, the device D i compute the hash of the message M jk concatenated to the nonce value V j . Let R j k = H (M jk ||V j ) the resulting hash value. Finally D i sends the response R jk to the gateway G (step 7 and 8).

The gateway G, upon receiving the response R jk , checks out if

H (M jk ||V j ) = R jk .
If so, the gateway G generates an access token for the device D i to execute the action A j k which consists on the hash chain CH i = {h i1 , h i2 , , h in } and sends the triplet < D i , A jk , h in > to the actuator SA j along with the whole chain CH i to the device D i . The actuator saves, in a lookup table, the triplet < D i , A jk , h in > which is used to authenticate the device D i (steps 9 and 10).

Action execution

In this phase, the actuator SA j can authenticate real time access control of remote IoT devices. The process of authentication is executed as follows : Device D i sends a request to the actuator SA j to execute some action A jk .

The request includes a quadruplet of information < D i , SA j , A jk , h i(n-t) >, where h i(n-t) is the hash value that is used in t th access. For the first access, D i uses the (n -1 )th hash value h i(n-1 ) . For the second access, it uses the value h n-2 and son on.

Smart actuator SA j looks for the entry < D i , A jk > in its lookup table. If this entry is found, the actuators checks out if

H (h i(n-t) ) = h i(n-t+1 ) = h last .
If this condition holds, the actuator SA j authenticate the device D i to execute the action A jk . Then, SA i updates also the value h i(n-t+1 ) by the received one h i(n-t) .

Security evaluation

In this section, we evaluate the security of our scheme. For that, we give some security analysis and we provide formal verification using the AVISPA tool.

Security analysis

In this section, we present a discussion about the main security analysis and the proof of properties that our proposed protocol ensures.

Authentication

In our protocol, there are two levels of authentication. First, the gateway G authenticates the legitimate IoT devices based on a challenge-response authentication technique. Once the first authentication is done, each smart actuator SA j authenticates IoT device D i based on one way hash chain CH i every time an action A jk is perfomed.

Respect of privileges

In our scheme, the execution of each action A jk could be performed only by the legitimate devices. Since, the challenge C jk is encrypted in such a way that only the legitimate devices have the required keys to decrypt the ciphertext as defined in the access policy P jk . Furthermore, CP-ABE scheme does not allow users' collision, which means that two or many illegitimate IoT devices can not cooperate to construct a secret key that allows them to decrypt the ciphertext [START_REF] Bethencourt | Ciphertext-policy attributebased encryption[END_REF].

Replay attacks

During the token generation process, the gateway generates a random nonce value

V i and sends it to the IoT device D i with the challenge C jk . The response message contains the value H (V i ||M jk ) that reveals no information about the plaintext M jk . The value H (V i ||M jk ) cannot be used by another IoT device D j (i ) to get an authorized token to execute the same action since a fresh random nonce value V i is generated for each token generation request.

In addition, the execution of each remote action on smart actuator elapses one hash value from the hash chain. Therefore, even thought, an intruder intercepts the hash value h i(n-t) at instant t, it cannot deduce the next token h i(n-t-1 ) thanks to the irreversible mathematical property of the hash function.

Formal verification

AVISPA tool

We described our protocol using the AVISPA's High-Level Protocol Specification Language (hlpsl) [START_REF] Team | Avispa v1. 1 user manual[END_REF]. The AVISPA tool allows the designers of security protocols to detect potential attacks and verify if their protocols meet the attended security services.

The protocol specifications

In our protocol, we defined four roles in HLPSL language. Namely : the owner (O), the gateway (P ), the device (D) and the actuator (A) roles which correspond to the differents agents in our system. The figure 3.8 shows the example of the gateway role in which we specify the different exchanged messages as explained previously. The channel (dy) is modeled in our specifications based on Dolev-Yao intruder model which means that all the exchanged messages between all the agents are intercepted by the intruder. This last can analyze, modify the intercepted messages or eventualy decrypts them if he knows the requiered keys. In our protocol, we analyze some security properties, which are specified in the goal section of hlpsl specifications as shown in figure 3.8. Basically, we verify the following properties :

P authenticates P on H (V i ||M jk ) : P generates a nonce value V i and sends the challenge C jk . If D is able to construct H (V i ||M jk ) from the challenge C jk and the nonce V i , P authenticates D.

A authenticates D on H (h (n-t) ) : The agent A disposes of the hash value h (n-t+1 ) . If A receives a hash value h (n-t+1 ) from the agent D such that

H (h (n-t) ) = h (n-t+1 ) , A authenticates D.
Secrecy of CH i : P generates the hash chain CH i . It sends the hole chain to the agent D. This information must be kept secrete between P and D.

Secrecy of h n : P generates the hash chain CH i . It sends the last generated hash value h n in the hole chain CH i to the agent A. This value must be kept secrete between S , D and A.

The obtained results

We can see clearly from the figure 3.10 that the obtained results demonstrate the security of our protcol under the test we performed using AVISPA.

Performance alalysis

In this section, we present the performance analysis of our scheme. The table 3.2 shows the evaluation of our proposed scheme in terms of number of execution of cryptographic operations (enrcyption/ decryption and hash) and the storage occupation with respect to the number of performed actions p by an IoT device D i on an actuator SA j . We consider 256 bits as the lenght of each hash value (usage of SHA-256 hash function). Furthermore, we consider the size of each challenge equale to 512 bytes. The size of the identifier of each action is set to 32 bits which allows the owners and the gateway to manage about 4.2 billions of actions on the actuators.

Computation Storage Public key enc/dec Secret key en/dec Hash

gateway G 1 4 p 1540 j∈SA |A j | IoT device D i 3 1 p + 1 32|CH i | + 4 Actuator SA j 0 1 p 36|CH i | Owner O k j∈SA |A j | |SA| - - Tableau 3.

-Computation and storage analysis

For IoT devices and actuators, we notice that our protocol minimises the number of encryption/decryption operations against an increase of the number of hash computations. Indeed, the number of executions of encryption/decryption algorithms does not increase with respect to p. The number of hash computations increases proportionally to p, but their cost is damn negligible compared to the high cost of encryption/decryption operations.

Experiment settings

We performed these simulations in a virtual machine 64 bits ubuntu 16.04 with 2GB of RAM and with Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz 2.40 GHz Processor. We used the cpabe toolkit implemented by1 , which is based on PBC-0.5.4 pairing library2 to implement algebraic operations. We used AES as a secret key encryption scheme, SHA256 as a Hash function, and RSA as a public key encryption scheme. We developped the different simulation scenarios based on Python language.

Subsequently, we discuss furthermore the evaluation of the computation cost of our with the variation of several parameters in order to evaluate their impacts on our solution.

Scenario 1 : The evaluation of token generation cost

In this first scenario, we focus on the token generation phase of our protocol. For that, we consider one IoT device D that wants to get a token to execute a certain action on a given actuator. In the test, we compute the execution time that the device D takes to cover the plaintext associated to the challenge and produces the response message. We evaluate especially the impact of the lenght of challenges to be decrypted by D. We assume also that the challenges are encrypted based on CP-ABE encryption algorithm using special access policies that consist of a tree Γ that contains 10 attributes linked with one "AND" gate, ie. Γ = AND(att1 , ..., att10 ).

The table 3.3 shows the mean execution time of challenge response, performed by one device during the token generation phase, with respect to different lenghts of the challenge.

We notice that the execution time elapsed during the token generation phase is not largely influenced by the length of challenges. Basically, with challenges of 512 and 1024 bytes, token generation phase gets a little more time than with the challenges of 128 bytes ; therefore, we recommend the usage of challenges of 256 bytes as it's still unbreakable by force brute attacks while maintaining a good efficiency.

Scenario 2 : The impact of the action execution rate and the number of IoT devices

In this scenario, we vary the rate of execution of actions arrivals for several IoT devices. Each device D i periodically perfoms one action in one actuator. To simplify, we assume that for each two devices D i and D j (i = j), they execute two actions on two different actuators. In this test, we assume that the gateway can handle one request for only one IoT device at each time, which is the worse case that we can consider 3 . We simulate the rate of action execution requests arrivals according to poisson process of parameter λ. We measure the execution time from event arrival until the execution of the action. Note that, one device D i executes the token generation algorithm only in the first time in order to get the required token to execute the same action subsequently. Figure 3.11 shows the average of execution time of token generation obtained by varying the number of IoT devices |D| and fixing the parameter λ to the value 0.5 (ie. 2 actions per second for each device). Figure 3.11 shows that the mean execution time of token generation and action execution phases is not hugely impacted by the number of IoT devices |D| neither by the rate of the execution of actions. Indeed, with |D| = 100 IoT devices that execute different actions simultaneously and with a rate of one action per 2 seconds for each device, the execution is about 640 ms.

Similarly, in figure 3.12, we plot the average of execution time of token generation with respect to the rate of action execution arrivals λ, we note that the execution time increase with respect to the parameter λ. The increasing shape of the curve 3.12 is close to the linear form, which is satisfactory under the assumption that the gateway can handle only one request of one device each time.

Therefore, our scheme scales very well with complex systems and it could be useful for real time control systems.

Conclusion

In this chapter, we have proposed a distributed protocol to control the execution of remote actions on smart actuators using smart objects and mobile devices. Our protocol has the advantage of being efficient, scalable and allows fine-grained access control. Furthermore, the security analysis, using AVISPA toolkit, showed that our protocol is robust against various attacks. Moreover, we have demonstrated in this paper that our protocol is less energy consuming and scales very well with the number of IoT devices and actuators. The proposed protocol is very suitable for many applications, particularly in resource-limited environments.

Chapitre 4

Mutual-authentication in IoT based fog computing architecture

According to Cisco [START_REF] Networking | Cisco global cloud index : Forecast and methodology[END_REF], more than 50 billion devices are going to be connected to the internet by 2020, with an amount of data that will reach 500 zettabytes. Thus, efficient data management and processing technologies are needed to cover this huge data quantity. Cloud-computing technology has shown its efficiency regarding data processing, high computational power, and data storage and management tasks. Indeed, the cloud already handles many applications, which exploit the strength of this technology, as a service repository. Therefore, it may be an important player in the supply /demand equation that the world is about to face in the coming years.

Cloud computing has been known as a centralized paradigm because all the data need to be processed/stored into one of cloud data centers. However, this operating mode can become problematic when the processed data raise up since it will endure more latency and so a lack of efficiency, especially for real time applications. Consequently, a new paradigm called fog computing has appeared recently to overcome these challenges [START_REF] Bonomi | Fog computing and its role in the internet of things[END_REF][START_REF] Stojmenovic | The fog computing paradigm : Scenarios and security issues[END_REF].

Fog computing paradigm aims to extend cloud-computing services to the edge of the network while ensuring interaction with the cloud [START_REF] Hu | Survey on fog computing : architecture, key technologies, applications and open issues[END_REF]. Therefore, computation, communication, storage and control operations are performed closer to end users and IoT devices by pooling network's local resources. Indeed, this paradigm adds a resource-rich extra layer composed of a large number of edge devices such as routers, base stations, etc. to ensure an interoperable, low latency and a highly reliable service supply space [START_REF] Zhang | Fog computing in multi-tier data center networks : A hierarchical game approach[END_REF]. With the new fog-computing paradigm, new challenges appear in prospect. Data security is one of the most important challenges of this architecture. Indeed, the fully distributed and untrustworthy nature of this architecture makes data security as one of the main users' concerns [START_REF] Manoj | An enhanced remote user authentication scheme with smart card[END_REF]. Authentication service is the entry point of any security system which consists of verifying users' identities.

In this chapter, we propose a novel and efficient authentication protocol which ensures mutual authentication at the edge of IoT network. Our scheme performs a first registration in the cloud level, and then it uses credentials provided by the cloud to realize any eventual mutual authentication between IoT devices and fog nodes without any resort to the cloud. In addition, our solution takes into consideration the eventual authentication between fog nodes. We base our construction on blockchain technology and secret sharing technique. The Blockchain is maintained by fog nodes and it allows IoT devices to authenticate any fog node in the architecture.

In addition, it allows fog nodes to establish mutual authentication with end IoT devices. On the other side, end IoT devices are authenticated through secret sharing mechanism. Using blockchain and secret sharing scheme, IoT devices store only a few and a fixed number of information in order to authenticate any fog node in the architecture.

Related work

Fog computing is a new paradigm, which extends cloud computing services to the edge of the network. This new architecture integrates network edge devices to overcome several cloud computing limitations related to bandwidth and latency. Fog computing architecture introduces a new rich service layer able to interact with any end device with any connection mode such as 4G/5G, WIFI, etc. In addition, it can impressively reduce latency, and provides the expected interoperability and reliability [START_REF] Stojmenovic | The fog computing paradigm : Scenarios and security issues[END_REF][START_REF] Chen | On the computation offloading at ad hoc cloudlet : architecture and service modes[END_REF], while ensuring the connection with cloud data centers for any eventual control operations and data aggregation. The objectives of fog computing paradigm are not recent and have several similarities with previous proposals such as cloudlet and mobile edge computing (MEC) which has the same goals. Yet, fog computing architecture is the most adequate proposal, which overcomes cloudcomputing limitations while ensuring a better reliability compared to cloudlets and mobile edge computing proposals [START_REF] Ahmed | A survey on mobile edge computing[END_REF][START_REF] Dinh | A survey of mobile cloud computing : architecture, applications, and approaches[END_REF].

However, adopting fog computing architecture introduces several challenges. Security is one of the most important challenges, which needs to be addressed in order to attract devices to use this new computing model. Generally, authentication is the first service which needs to be addressed in any security system. As far as we know there have been only one scientific paper [START_REF] Dastjerdi | Fog computing : Helping the internet of things realize its potential[END_REF] which addresses mutual authentication in fog computing. In [START_REF] Dastjerdi | Fog computing : Helping the internet of things realize its potential[END_REF], the author proposed an authentication scheme, which allows any Fog user to authenticate mutually with any Fog server under the authority of a Cloud service provider. In this scheme, a Registration Authority (RA) is deployed in the cloud and defines a random master key for each user. This master key is used to generate secret keys for each fog server in order to allow them to verify the authenticity of the devices. Thus, each fog server will maintain a secret key for each user in the network. Moreover, each time a user joins the network, the RA generates and sends a secret key to each fog server. Otherwise, the fog servers are not going to be able to authenticate that new user and thus the user will not be able to access the fog server services. In addition, the author in [START_REF] Dastjerdi | Fog computing : Helping the internet of things realize its potential[END_REF] did not consider authentication between fog servers.

Several authentication solutions have been proposed for similar architectures as fog computing. In [START_REF] Varshney | Demystifying fog computing : Characterizing architectures, applications and abstractions[END_REF] the authors proposed an authentication scheme based on near field communication (NFC) technologies, which relies on physical contact for preauthentication in a location-limited channel. Similarly, NFC-based solutions have been used as an authentication model for Cloudlet in [START_REF] Ibrahim | Octopus : An edge-fog mutual authentication scheme[END_REF]. However, this solution cannot always be applied, since there is no guarantee that the devices and the fog nodes are located in a near area. Similarly, password based solutions have been proposed in several architectures [START_REF] Lu | A simple user authentication scheme for grid computing[END_REF][START_REF] Panayappan | Vanet-based approach for parking space availability[END_REF]. The problem with these solutions is their low entropy since are vulnerable to dictionary attacks. Moreover, due to the untrustworthy nature of fog architecture, the fog nodes cannot be trusted with devices login and passwords. In addition, solutions based on passwords cannot ensure mutual authentication by themselves. Likewise, Biometric authentication techniques are complex and cannot always be applied in fog computing due to the heterogeneous nature of fog architecture, in which several devices do not possess biometric information.

Background

In this section, we present some cryptographic tools that we will use in our authentication solution.

Review on Shamir's secret sharing scheme

In cryptography, secret sharing refers to a method for distributing a secret amongst a group of participants by giving each one of them a part of that secret. These parts are called shares. The distributed secret can be reconstructed if all the shares are combined together. Otherwise, individual shares are of no use on their own.

Based on the fact that the collection of at least k different points can reconstruct a polynomial of degree k -1, Shamir [START_REF] Balfanz | Talking to strangers : Authentication in ad-hoc wireless networks[END_REF] introduced the secret sharing scheme by dividing a secret S into pieces (x i , S i = q(x i )) using a randomly chosen polynomial :

q(x) = a 0 + a 1 x + a 2 x 2 + ..... + a k-1 x k-1
In which a 0 represents the secret S and (1, S1 = q(1)), (2, S2 = q(2))(k, Sk = q(k)) are the shares. The polynomial q can be reconstructed using Lagrange interpolation as :

q(x) = k i=1 Y i × k j=1,j =i x -x j x i -x j Where Y i = S i
Consequently, the secret S can be calculated as S = q(0 )

Our solution

In this section, we present our proposed solution, which ensures mutual authentication in fog computing architecture. In our solution, we consider an architecture (figure 2) composed by the following components : Several cloud brokers responsible for the verification of devices and fog nodes' identities. In addition, these entities distribute authentication credentials for both devices and fog nodes in order to allow them to be authenticated at the edge of the network.

Fog nodes, which provide computational services at the edge of the network.

End devices, which request services from the fog nodes.

The main idea of our solution is as follows :

An application called broker is setup in each cloud in order to verify the authenticity of both the devices and the fog nodes. Thus, each user should perform a first authentication nearby one of the Cloud brokers which verifies the validity of the user's identity. If it succeeds, then it generates credentials and sends them to that user. This allows any fog node to authenticate him at the edge of the network. To authenticate a user, the the concerned fog node performs a first authentication using its certificate at the cloud as well. The aim of this step is to verify the authenticity of the fog nodes and provide some information which allows them to verify devices' credentials at the edge of the network, without contacting the cloud brokers. In addition, the brokers set up a mechanism which allows the devices to authenticate the fog nodes by using blockchain technology. Indeed, after the verification of fog node's certificate, the cloud broker generates a transaction which contains the node's public key and signs it using its private key. Then, it broadcasts that transaction, so one of the other brokers can validate and insert it into the blockchain. We note that our blockchain is private and it is stored in each fog node. Furthermore, it does not just allow the devices to authenticate any fog node in the architecture, but it also allows fog nodes to authenticate each other.

The mutual authentication starts when a user requests a service from a fog node. First, that user should authenticate the fog nodes from which he requests a service. Thus, it verifies the part of the blockchain where one of the cloud brokers has signed the transaction which contains the public key of that fog node. Once the user verifies the authenticity of the fog node, he should send his credentials to that fog node. Then, based on secret sharing scheme, the fog node combines the user's credential and the information provided by the cloud broker, during its initial authentication, to verify the authenticity of that user.

We note that in our scheme, we do not consider further access control issues with respect to whether the user has the right to run any application in the fog node, or which services he has the right to exploit.

Implementation

In what follows, we show how we can achieve our proposed authentication scheme which allows to verify the authenticity of both devices and fog nodes at the edge of the network.

We note that our solution uses public key cryptography in some points of the authentication process, thus, for sake of illustration in what follows, we consider RSA [START_REF] Shamir | How to share a secret[END_REF] as a model of public key cryptography.

Our scheme achieves mutual authentication based on secret sharing scheme and blockchain technology, and it works as follows :

Setup phase

In this phase, the brokers set up the system parameters that will be used in the eventual registration and authentication phases. We note that it is suffucient if only one of the brokers runs this setup phase and shares the setup parameters with the other brokers. Thus, in what follows, one of the brokers is running this phase as :

Initialize a blockchain, which will contain the public key of each legitimate fog node. We assume that each cloud broker B i already has a pair of keys (public key P K i and private key SK i ). The key P K i should be known by the other brokers since the broker B i uses SK i to sign each transaction that it generates. In addition, the brokers should share in common another pair of keys (P K, SK). SK will be used to sign valid transactions, while P K will be used by the devices to verify the SK signature at the edge authentication level.

Choose a polynomial P of degree m, as follows :

P (x) = a 0 + a 1 x + a 2 x 2 + ..... + a n x m
The degree m of the polynomial can be randomly chosen and does not depend neither on the number of devices nor the number of fog nodes.

a 0 is considered as the secret token that is going to allow the fog nodes to verify the authenticity of the devices, and a i , i ∈ [1, m] are randomly chosen coefficients from Z p .

Choose two primes q 1 , q 2 and compute two values φ(n) = (q 1 -1)×(q 2 -1)

and n = q 1 × q 2 .
Generate m points P i(X i , Y i ) randomly from Z p , and set the verification parameters V P as :

V P = {(token = S), {P i (X i , Y i )}, n} (4.1)

Fog registration phase

Fog nodes should perform a first registration in the cloud level. Thus, it provides its certificate to one of the cloud brokers. Then the broker runs the following actions :

Verify the certificate given by the fog node.

Prepare a transaction signed by the secret key SK i and which contains the public key of the fog node, its state "legitimate".

Insert the transaction into a new block (figure 3), and most importantly fill the difficulty field which defines the mathematical problem that should be solved in the validation step.

Broadcast the transaction between the blockchain peers (the other brokers) so it can be validated.

Choose a unique and random X ui from Z p which is coprime with φ(n).

Then, it computes a X -1 ui which is the modular multiplicative inverse of X ui (modulo φ(n)).

Generate a unique point P ui (X ui , Y ui ), where X ui and Y ui in Z p . We note that P ui has to be different from the P i points generated in the setup phase.

Combine the user's specific point with the m points P i generated in the setup phase as follows :

L u,i = m j=1 X ui X ui -X j U s ui = Y u,i × L u,i
Prepare the user's credential as :

User's credential = {P K, U s ui , X ui , X -1 ui , n} (4.2)
Where : P K is the validation public key.

We note that the operations to compute the L u,i and the user's share U s ui are realized in Z p and do not have any relation with Z n , where n has been defined in the setup phase. In addition, by sending the public key (P K), we aim to allow the user to verify that the information given by the fog node, in the mutual authentication phase, comes from the valid blockchain and not a falsified one.

Mutual authentication phase

Using the credentials given by the cloud broker and the information in the blockchain, both the devices and the fog nodes can mutually authenticate each other at the edge of the network as follows :

Fog node authentication : the device starts by authenticating the fog node through the following steps :

Request the transaction from the blockchain in which the cloud broker inserted and signed the fog node's public key and its current state.

As soon as the fog node sends back its transaction block, from the blockchain, verify that the received transaction comes from the valid blockchain that the brokers use to publish legitimate fog nodes. Therefore, broker (eq.1) as follows :

Lf n k = -X ui X k -X ui × m j=1,j =k -X j X k -X j F s = m i=1 Y i × Lf n i Computed token = U s ui + F s = S
Compare the two values S and the token S. If the token S is valid, the fog node generates a hash chain H[] and a session key CS, which will be used in the eventual further data exchange between the fog node and the authentic user. Then, it encrypts them using X ui as follows :

access credential = {CS, H[]}X ui
Where :

{ * }X ui is a public encryption method in Z n , which uses X ui as a public key.

Note that we linked both secret sharing scheme and public key encyption through X ui value. Thus, this value is not just an importatnt part in the process which prooves that the user is valid member of the group, it also respresents an insurance that the access credentials given by the fog node can only be decrypted an entity which really possesses credentials (eq.4.2) given by the broker.

Finally, the fog node sends the access credentials, and triggers a timer which defines the period of time that the fog node should wait until the first service request from the user.

We note that, if the user does not send any service request, encypted with the session key and contains the first element of the hash chain H[0]. Then, by the end of the timer, the authentication session expires. Figure 4, describes the mutual authentication process.

Threat model

In our protocol, we distinguish two different adversarial models where each model reflects a specific situation defined as follows : 1) The case where an attacker impersonates fog nodes : Let A be a polynomial time adversary which interacts with a signature oracle. Thus, it submits arbitrary messages m i to the oracle in order to get the signature of these messages. Finally, the adversary outputs a message m that has never been submitted to the oracle along with its signature.

Adversary A wins the security game if he outputs a valid signature for the message m.

2) The case where an attacker impersonates end-d : Let A be a polynomial time adversary which interacts with a random encryption oracle. A submits two messages {m 0 , m 1 } to the oracle. Then, the oracle picks a random coin b ∈ {0, 1} and replies by sending E(m b ), where E is a public key encryption function. Finally, the adversary outputs a guess b about which one of the two submitted messages {m 0 , m 1 } has been encrypted with E.

The advantage of adversary A in this game is expressed as :

Adv = P r[b = b ] -1/2

Security analysis

In this section, we prove that our authentication solution ensures the expected security requirements.

Replay/impersonation attack

In our authentication scheme, the fog node verifies the user's credentials, then it sends him the session key with the hash chain encrypted using X ui as a public key. Finally, it sets a timer and waits for the user's request. On the other side, the user needs to get the session key and sends a service request to the fog node before the achievement of the timer. Otherwise, the authentication session will expire. As we can notice, the user needs to send a service request in a limited period of time. Thus, it will be useless for any party to try to replay the user's authentication request since any party, which wants to successfully perform this attack, needs to recover the user's private key X -1 ui and get the session key to use it in the eventual service request. Since X -1 ui is a secret key generated through one of proven secure public key schemes, as RSA [START_REF] Shamir | How to share a secret[END_REF], its security is preserved. Likewise, it remains useless to impersonate the user's identity and use its credentials to be authenticated in the fog node, since it also requires the attacker to recover the user's private key X -1 ui .

On the other side, if an attacker impersonates an existing fog node identity, it will need to recover the private key of that fog node, which is used to sign access credentials (the session key and the hash chain). Likewise, if an attacker tries to convince a user that he is a legitimate fog node, it needs to provide a valid blockchain transaction signed by one of the known brokers and which contains its public key. Therefore, the attacker has to forge the validation signature key used by the brokers.

In the case of RSA signature, a formal proof about its security has been provided in [START_REF] Christidis | Blockchains and smart contracts for the internet of things[END_REF].

Man in the middle

If an intermediate node tries to perform man in the middle attack to get access to one of the legitimate fog node, it will need to guess the user's private key X -1 ui , in order to find out the session key and send back a service request to the fog node before the achievement of the timer. Thus, this attack will also fail since the probability of guessing the user's private key in a limited time is negligeable.

User/ Fog compromise

If a fog node has been compromised, it will not affect the authentication of the users nearby other fog nodes since fog nodes possess only verification parameters and have no knowledge about the devices' private keys X -1 ui . Thus, a compromised fog node cannot perform any kind of attack which aims to use any user's credential to get access in other fog nodes. On the other side, a user which has been compromised, can still be authenticated in any other fog node. Thus, it is important that the devices ask for a revocation nearby one of the cloud brokers in case they were compromised. If the system detects misbehavior in any user/fog node, one of the cloud brokers needs to revoke them. Using the blockchain as a repository of the revocation list for both revoked fog nodes/devices can be an adequate solution to manage this situation.

Performance evaluation

In this section, we evaluate the performance of our authentication scheme. Our experimentations have been realized in a real wireless adhoc network, using two laptops (an HP, i7 laptop with a CPU frequency of 2.7 GHZ and a Samsung i5 laptop with a CPU frequency of 2.6 GHZ). We first measure the computational time that the broker spends in the generation of devices' credentials during the devices' registration phase. Then, we provide the measurements of our edge authentication level and compare it with multi-level certificate-based solution. We note that all arithmetic operations are realized in Z n or Z p where p and n are encoded in 1024 bits (128 bytes).

Registration in the Cloud

The registration algorithm in the cloud broker level verifies the user's identity, then it generates credentials for that user. The verification of devices' identities depends on the authentication algorithm adopted in the cloud. Whereas, the credential generation step consists only of computing some multiplications. Thus, we conclude that the complexity of this phase is linear in the order of O(n), where n is the number of registration requests that the broker receives at the same time. Figure 5, illustrates the computational time of credential generation according to the number of registration requests, received in parallel.

Edge level authentication

As shown in Figure 6, the edge level authentication does not take much time. At this authentication level, the fog node verifies the user's credential. In our solution, almost all computation operations are performed by the fog node, which has a considerable computation power. In addition, the authentication process is performed at the edge level of the network, so it does not occur a considerable latency. In our solution, the fog node will only perform a constant number of multiplication and addition operations to verify the authenticity of the user. Similarly, to authenticate a fog node, the user will only verify the transaction provided by that node. This operation consists of verifying that one of the authorized brokers signed the provided transaction, which is not a time consuming task as shown in Table 4.2.

In existing certificate-based solutions, the fog node will search and verify a set of intermediate certificates going up to a certificate issued from one of the root authorities that the fog node trusts. This operation endures an important latency since the verification depends on the number of intermediate authorities going up to a root authority (certificate level). Note that in our experiments, the intermediate authorities are in the same network. Thus, the latency can be higher if the authorities are on another network. 5.4 shows the computation and storage overhead in each step of our protocol. Note that, (Inv, Mult, Add) refer to modular inverse, multiplication and addition resp. (Sign, Sign-Verif, Asm-Enc/Dec) refer to RSA signature, signature verification and RSA asymmetric encryption/decryption respectively. (m, nbF , TS ) are the predefined polynomial degree, number of fog nodes and trasanction size respectively.

Val refers to the validation process in the blockchain. As we can notice, all the components perform lightweight arithmetic operations during the different steps of our protocol, except Cloud brokers which sometimes validate blocs in the blockchain. In terms of storage, the devices store few credentials while the fog nodes store the blockchain and verification parameters. Note that the size of the blockchain depends on the number of fog nodes.

Blockchain Performance evaluation

In order to evaluate the performance of validation and verification of transactions, which are part in the process of fog nodes registration, we have measured the average time to validate one transaction as well as the time that the user takes to verify the signature and the content of one transaction. In our evaluation, we use go-ethereum platform1 which is one of the official implementations of ethereum blockchain protocol. In table 4.2, we present the average time of transaction's validation and signature verification. In this test, we also measure the average memory and CPU occupations. We note that the average memory usage for running the mining process is around 27.9 MO. During the transactions' validation, the percentage of miner's CPU overhead reaches 92.65. We note that the mining operation is done by the cloud brokers, which have an important computation power far away from what we use to evaluate our scheme's performance. Therefore, better results can be achieved as much as we use more computational power.

Conclusion

In this chapter, we have proposed a new secure authentication scheme based on secret sharing and blockchain technology in fog computing architecture. In our scheme, both the devices and the fog nodes perform one registration in the cloud level. Then, they will be able to mutually authenticate each other at the edge of the network without resorting to the cloud. The devices hold some information which allow them to verify the authenticity of any legitimate fog. Moreover, fog nodes in our solution do not need to store any devices' identifiers and any digital certificates : they only hold a couple of values that are going to allow them to verify the authenticity of any user in the system. In addition, fog nodes can also authenticate each other at the edge of the network using the blockchain. Furthermore, our scheme deals efficiently with situations where an entity from the system tries to impersonate another one in order to get services from fog nodes. Finally, our experimental results show that our proposal realizes mutual authentication in a short time comparing to certificate based authentication approaches. In the future, we intend to address more intensively the revocation problem in fog computing architecture.

Chapitre 5

Decentralized Blockchain-Based Trust Management Protocol for IoT Internet of Things can be viewed as service centric architecture where each device, or thing in general, can request services from other devices and it may also provide services for other devices (service provider). Service centric based IoT applications face several security challenges such as trust management. Indeed, IoT service providers may behave dishonestly and maliciously for the purpose of promoting IoT devices (service requesters) to select them for one or many services on behalf of other trusted service providers. Furthermore, dishonest IoT service providers may perform discriminatory, bad-mouthing and ballot-stuffing attacks to disrupt the network and monopolize many provided services. Therefore, it is clear that a trust management protocol to evaluate the trustworthiness of IoT service providers, in a scalable and efficient way, is more than necessary.

To date, there is a large number of trust management protocols that have been developed for Wireless Sensor Networks (WSN), Social networks and P2P systems in general (eg. [START_REF] Bao | Hierarchical trust management for wireless sensor networks and its applications to trustbased routing and intrusion detection[END_REF][START_REF] Chen | Trust management for encounter-based routing in delay tolerant networks[END_REF][START_REF] Cho | Modeling and analysis of trust management for cognitive mission-driven group communication systems in mobile ad hoc networks[END_REF]128,[START_REF] Chen | Trust management for soa-based iot and its application to service composition[END_REF][START_REF] Meng | Getrust : A guarantee-based trust model in chordbased p2p networks[END_REF][START_REF] Guo | A trust-based privacy-preserving friend recommendation scheme for online social networks[END_REF]). In these protocols, trust evaluation is often based on some information that includes : 1) the direct observations of each node regarding the others (which is gathered whenever the node encounters the IoT service providers) and 2) the indirect recommendations received from other nodes against the service providers. These solutions are still not scalable and are not suitable in high mobility based applications. Indeed, in most solutions, a node needs to communicate with a large number of IoT devices so it would be able to accurately compute trust levels of IoT service providers. Moreover, other questions still arise on how trust information (direct observations and indirect recommendations) is disseminated and shared in a scalable way among different IoT objects in order to speed up the process of trust computation and make it more accurate. In addition, each node has to store this whole trust information about every encountered service provider. Hence, this raises an important question : how we can ensure a fully distributed and scalable trust management protocol with mobility support, in which IoT devices can evaluate trustworthiness of any service provider in Internet, without the presence of any pre-trusted entity ?

In this chapter, we propose a new scalable trust management solution, named BC-Trust, to address the aforementioned limitations. Our solution is based on blockchain technology and fog computing paradigm, and allows highly mobile IoT devices to accurately assess and share trust recommendations about other devices in a scalable way without referring to any pre-trusted entity.

Related work

In this section, we review some trust management protocols for IoT which are closely related to our work.

Very recently, Guo et al. [START_REF] Guo | A survey of trust computation models for service management in internet of things systems[END_REF] provided a comprehensive survey about the most recent works in the trust managements and computational trust models in IoT. They focused basically on service management in IoT dealing with the choice of IoT devices as service providers according to their trustworthiness. They discussed the five fundamental components of each trust management system, namely : trust composition, trust propagation, trust aggregation, trust update and trust formation.

Chen et al. [START_REF] Chen | Trm-iot : A trust management model based on fuzzy reputation for internet of things[END_REF] proposed a trust management model based on fuzzy reputation concept for IoT. However, they considered only some specific WSN applications where nodes can establish limited trust relationships with other nodes. Actually, compared to WSN nodes, IoT devices are internet-enabled and can establish complex relationships with other IoT devices and owners. Saied et al. [START_REF] Saied | Trust management system design for the internet of things : A context-aware and multi-service approach[END_REF] proposed a multi-service and context-aware trust management protocol for IoT systems, which deals efficiently with different malicious attacks. However, their protocol is based on centralized trusted servers that collect trustworthiness from IoT devices which is not viable in IoT. Similarly, Guo et al. [START_REF] Guo | A mobile cloud hierarchical trust management protocol for iot systems[END_REF] proposed a 3-tier hierarchical architecture based on cloudlets to disseminate trust information to a central cloud. Their architecture allows IoT devices to report trust information and also query trustworthiness of other devices directly from the local cloudlets. However, the proposed architecture refers always to the central cloud which is responsible to disseminate the trustworthiness information gathered from one cloudlet to the other cloudlets which can involve latency issues. Moreover, their trust model is still limited, since distributed cloudlets are assumed to be honest in their architecture and they maintain only trust data in their geographical area.

The concept of social Internet of Things has been developed recently in many works. This concept consists on extending the world of IoT in such away, IoT devices will be able to establish autonomously social relationships between other devices and users. Many works have investigated the trust management problem in the context of social IoT [START_REF] Chen | Trust-based service management for social internet of things systems[END_REF][START_REF] Jayasinghe | Rpr : A trust computation model for social internet of things[END_REF][START_REF] Lin | Clarifying trust in social internet of things[END_REF][START_REF] Nitti | Trustworthiness management in the social internet of things[END_REF]. Chen et al. [START_REF] Chen | Trust-based service management for social internet of things systems[END_REF] proposed an adaptive trust management protocol for social and dynamic IoT systems. The main idea consists on distributing the computation of trust information among IoT devices. In their computational model, each device maintains its own trust assessment toward other users and devices. The trust assessment is based on the recommendations of the other devices, the direct observations and also the history of the interactions. The authors considered different classes of trust properties such as QoS, honesty and cooperativeness depending on the social relationships between IoT devices. However, their protocol is not scalable enough since each device must save all the trust pieces of information (that include its history and the recommendations of the other devices, etc.) related to its social friends (IoT devices and owners) in a lookup table. In [START_REF] Nitti | Trustworthiness management in the social internet of things[END_REF], the authors proposed two trustworthiness computational models. 1) A subjective model which basically consists on the combination of the local trust parameters (direct observations) and also the received indirect recommendations. And 2) An objective model, where they proposed to disseminate trust assessments in a distributed Hash table maintained by a subset of trusted IoT devices. However, this last assumption is not actually practical in IoT environments. Moreover, their solution is still limited and it is applicable only in social based IoT applications.

Recently, Lu et al. [START_REF] Yang | Blockchain-based decentralized trust management in vehicular networks[END_REF] proposed a new blockchain based trust management solution for vehicular networks (VANETs). The idea of their solution is to use the blockchain as a platform to share the reputation opinion reported by different vehicles. The blockchain is maintained by the road side units (RSU), which are also the miners. The authors proposed a new consensus algorithm that favors blocks containing a large variation of trust values. However, the proposed consensus method is vulnerable to some kind of collaborative attacks aiming to report high or low trust values to generate priority blocks and then disrupt blockchain trust values. Similarly, Yang et al. [START_REF] Lu | A privacy-preserving trust model based on blockchain for vanets[END_REF] proposed a privacy-preserving trust model for VANETs that combines blockchain and public key infrastructure to deal with tracking attacks while broadcasting forged messages. However, the authors did not discuss the security of their trust management protocol against trust attacks like bad mouthing and ballot stuffing attacks.

Security model

In this Section, we define our security model by highlighting the main security attacks that may occur in our system. In our model, we assume that every IoT device may provide services for other devices and it may simply behave as service requester. Moreover, we consider dishonest service providers that act for their own benefits in order to be selected as service providers by other IoT service requesters. Thus, each malicious service provider can perform the following trust-related malicious attacks [START_REF] Guo | A survey of trust computation models for service management in internet of things systems[END_REF] :

Self-promotion attacks : a malicious service provider can promote its importance to other service requesters by sending good recommendations about itself, then it may act maliciously by providing bad services.

Bad-mouthing attacks : a malicious service provider can distrust the trustworthiness of other trusted service providers by providing bad recommendations about them to service requesters and therefore decrease their chances to be selected as service providers. These attacks could be performed in a collaborative way by a set of malicious nodes to ruin well-behaved nodes.

Ballot-stuffing attacks : a malicious service provider can consolidate other malicious service providers and boost their trustworthiness by providing good recommendations. Therefore, this may increase their chances to be selected as service providers. Similarly to Bad-mouthing attacks, this attack could be performed in collaborative way by malicious nodes to recommend each other.

Opportunistic service attacks : a malicious service provider can decide to provide opportunistically a good service to attract the service requesters and enhance its reputation regarding them. This malicious node could exploit this good opportunistic reputation to perform successful Ballotstuffing and Bad-mouthing attacks.

On-off attacks : in this kind of attacks, one node can decide to provide good and bad services in a random way to avoid the risk of not being selected as a service provider. Once again, with good reputation, this malicious node can perform Ballot-stuffing and Bad-mouthing attacks with the collaboration of other malicious nodes.

Our Trust management solution

In this section, we prensent our architecture, then we define the main steps of our protocol which allows any entity in our architecture to measure the trustworthiness of any service provider.

Our architecture

In our solution, we consider a trust management architecture, composed of the following components :

IoT service requesters are nodes which communicate with any other component in the architecture, via Internet or other network protocols. Each service requester can request services from other service providers in the architecture. We denote the set of service requesters by

D = {O 1 , O 2 , ..., O N }.
Service providers are nodes which offer services to other devices. We denote the set of service providers by Sp = {Sp 1 , Sp 2 , ..., Sp M }. Note that in our architecture, we assume that service providers are powerful nodes that have enough computational power and storage capacity to validate and maintain blocks into the blockchain.

Fog nodes are responsible for a reliable management of trustworthiness in the system. Indeed, the set of fog nodes FN = {FN 1 , FN 2 , ..., FN P } maintains a blockchain which stores the various trust values related to service providers. In addition, fog nodes provide to service requesters a global view on the trustworthiness of each service provider. Note that these fog nodes are not assumed to be trusted. Indeed, since our solution is based on blockchain there is no need to trust any node as far as the whole blockchain is trusted. Moreover, we assume that fog nodes layer covers all the IoT network scope and can manage the high mobility of IoT devices.

Blockchain layer which is maintained between fog nodes and service providers. The blockchain layer is responsible for the management of trustworithness data reported by IoT devices. In our architecture design we use private blockchain as we restricted the validation process to only service providers which are known in our system. Thus, we believe that consortium blockchain is relevant solution for our protocol. Moreover, we combined PBFT and PoS protocols to design a scalable and secure consenus protocol (see section 5.3.5).

We illustrate in Figure 5.1 our architecture on which we base to propose our trust management protocol.

Our Trust model

In our trust model, we usually use the following appellations that we define as :

Trust value T S ij (

Setup phase

The setup phase of our protocol is completed in two following steps :

1. Identification step : in a massively distributed system of a very large number of heterogeneous IoT devices, the identification of IoT devices is one of the major challenges that must be addressed before developing a trust management protocol [START_REF] Guo | A survey of trust computation models for service management in internet of things systems[END_REF]. In our system, we assume that there is a public key infrastructure which is responsible for cryptographic key generation. Therefore, PKI authority generates a public and private key pair for each IoT device and fog node in the architecture. The public keys are maintained in the blockchain by the fog nodes. Thus, once PKI authority generates the pair (PK A , SK A ) for each entity A, it sends a transaction containing PK A to the blockchain. PK A (public key) serves as an identifier of entity A. Hence, at the end of identification step, all entities in the architecture are able to identify each other via the blockchain.

2. Service indexing step : in order to allow IoT devices to discover available services, service providers register their proposed services into their closest fog nodes. Thus, we propose to use a distributed hash table (DHT) to store the different services provided by different service providers. This DHT table, maintained by the fog nodes, is synchronized and updated via a distributed protocol similar to structured P2P networks [START_REF] Cohen | Incentives build robustness in bittorrent[END_REF].

Trust Dissemination Phase

During the execution of the protocol, each "honest" IoT device O i periodically reports its recommendations toward the encountered service providers every ∆T R time units (∆T R is a system parameter). Device O i 's recommendations are reported to the closest fog nodes. For sake of optimization, each device O i reports only the most fresh recommendations that have been updated during the last ∆T R . Therefore, at the end of ∆T R , the reported trust values are structured in separate transactions, where each transaction Tx R (O i , Sp j , S k ) contains the following information :

The trustor node identifier : which is the public key PK O i of service requester O i .

The trustee node identifier : which is the public key PK Sp j of service provider Sp j .

The service S k that has been provided by node Sp j to device O i during the last ∆T R .

A The approval of service S k signed by the service provider Sp j as :

{approval , S k , timestamp} SK Sp j . This information is used as a proof that service S k has been accomplished and provided by Sp j and thus it prohibits that O i can report a recommendation about the service provider Sp j without requesting any service from it.

The device O i signs the transaction Tx R (O i , Sp j , S k ) by its private key SK O i and sends it to all its closest fog nodes. In order to avoid some security threats related to dishonesty of some fog nodes1 , each device must send the transaction to many fog nodes (the closest ones) to increase the probability of its insertion into the blockchain. Upon receiving the transactions, the fog node periodically performs the following steps :

1. It first verifies these transactions by verifying the signature of both service provider Sp j (the approval signature) and service requester O i (the transaction signature).

2. It gathers only the valid transactions in one single block.

3. It broadcasts the block to be validated to the whole service providers that maintain the blockchain.

4. Finally, once the validation is done, the block will be added to the blockchain by all fog nodes and service providers.

Trust assessment process

When a node O i requests the service S k from service provider Sp j at time t, it first queries for the available services from the distributed hash table (maintained by the fog nodes) to identify the potential IoT service providers it should interact with them. Node O i will choose one service provider Sp j among others based on the trustworthiness level of each service provider at time t. The trustor IoT device O i assesses or updates the trustworthiness of service provider Sp j (trustee) as follows :

T S k ij (t) =    αT S k ij (t -∆t) + βD S k ij (t) + γR S k ij (∆t), if P (i, j) R S k ij (∆t), otherwise (5.1)
where 0 ≤ α, β, γ ≤ 1 and α + β + γ = 1 , are used to weigh the importance of each trust parameter. These weighs are adjusted dynamically by the trustor in order to maximize the accuracy of trust assessment as well as make the protocol more resilient to bad-mouthing and ballot-stuffing attacks. In equation (5.1), P (i , j ) is a predicate that is equal to true if the device O i has interacted previously with the service provider Sp j , otherwise P (i , j ) = false.

In equation (5.1), we distinguish two main cases depending on the experience of device O i with the encountered IoT service provider Sp j :

1. Case 1 : if the device O i has previously encountered the service provider Sp j , it will assess its trustworthiness level based on

T S k ij (t -∆t), D S k ij (t -∆t) and R S k ij (∆t). T S k ij (t -
D S k ij (t) = α ij n = t i ∈{t 1 ,..,tn} S ij (t i ) n (5.2)
where :

α ij is the cumulative of the satisfaction levels and is continuously updated by α ij = α ij + S ij (t). Fog node sends the recommendation 2) Case 2 (L = ∅) : this case means that there have been no device which recommended Sp j during the last ∆T time units. If service provider Sp j has never been recommended by any IoT object in the architecture, then fog node FN l returns a recommendation R S k ij (T ) = 0.5. Otherwise, fog node FN l searches the most recent transaction Tx R that has been reported prior interval [t -∆T , t]. Since Tx R has not been reported in the last ∆T , it is still considered as an old transaction. Therefore, fog node FN l will consider recommendation reported in transaction Tx R with a small penalty Pnl . In our solution, we consider a constant penalty Pnl equal to 0 .05 . Thus, let R S k kj (t ) be the recommendation reported in Tx R such that t < t -∆T , fog node FN l computes the recommendation R S k ij (∆t) as follows :

t
R S k ij to O i 5: if (T S k ij , D S k ij ) ∈ loockup(O i ) then 6: T S k ij ← α × T S k ij + β × D S k ij + γ × R S k ij 7: else 8: T S k ij ← R S k ij 9: end if 10: if T S k ij <
R S k ij (∆t) = (1 -P nl) × R S k ij (t )
, where t < t -∆T Algorithm 2 summarizes the different steps performed by fog nodes while computing recommendations.

We illustrate in Figure 5.3 the different steps of our protocol.

Contermesure against selfish service providers : it is possible that some service providers don't participate in the process of block validation in order to save their computational power or break down the whole system. In order to avoid the problem of selfishness, the protocol uses a penalty in the computation of R S k ij (∆t). Therefore, fog node FN l must check if Sp j has participated in the process of validation during the last N generated blocks. In the case of non participation, the value R S k ij (∆t) is mutiplied by 1 -Pnl where Pnl = 0 .1 .

Countermeasure against cooperative attacks

The most common attacks that are performed in IoT based trust management systems are basically bad-mouthing and ballot stuffing attacks. In these attacks, malicious nodes tend to report bad recommendations for honest service providers or good recommendations for malicious ones. For more effectiveness, in general, this kind of attacks is cooperatively performed by several attackers in order to promote each other or target some honest service providers. Cooperative bad-mouthing and ballot-stuffing attacks involve great damages on the whole IoT system. Moreover, these attacks are very hard to detect and overcome, at least for the following reasons : Risk of false negative : when a group of nodes give bad recommendations for one particular node A repetitively, it is hard to say for sure whether this group of nodes is malicious or because the node A is really malicious.

Risk of false positive : it could be possible in some cases that a group of nodes request periodically one particular service from one service provider (the case for example of data aggregation). Therefore, reporting periodically the same recommendations for one service provider (the aggregator node for example) does not necessarily mean that this group of nodes is conducting a cooperative attack against this service provider.

Block generation and consensus protocol

In this section, we propose a consensus algorithm for block generation and validation. Our main goal is to achieve a good tradeoff between security and scalability. Therefore, we propose an enhanced version of the protocol PBFT implemented in Tendermint 2 . Our consenus is a combination of PBFT (Practical Byzantine Fault Tolerance) and PoS (Proof of stack) algorithms. To ensure a high security level, we adopt as stack concept the trust value of each service provider. Thus, service providers with high trust values are more likely to be selected as validators.

The PBFT mechanism is capable of supporting up to f Byzantine "faults" if and only if the network is composed of at least 3f + 1 nodes. The particular implementation of this algorithm works with a reasonably communication overhead in small networks. Unfortunately, the size of the necessary communication overhead increases drastically with the number of nodes, making the mechanism inefficient in large scale (bad scalability) [START_REF] Ongaro | In search of an understandable consensus algorithm[END_REF].

To enhance the scalability of the PBFT protocol, we propose to choose a subset of log(n) validators (instead on n) among the list of validators (service providers). Our consensus protocol is summarized in the following stages :

Validators selection stage : as soon as a block is formed, each block proposer (fog node) needs to randomly choose log(n) validators from the set of n candidate service providers having a trust value higher than a treshold (0 .7 in our protocol). The random selection is weighted to the trust values (stack) of the candidate service providers. So, each service provider Sp j has a known probability of selection which correponds to the ratio T j n k=1 T k . Thus, service providers with high trustworthiness have high probabity to be selected. Once the selection of validators is done, the block proposer sends a validate message to these selected validators and broadcasts the block to all blockchain nodes.

Pre-vote stage : once receiving the validate request, each validator checks the transactions forming the block. Mainly, it verifies the correctness of the signatures and the timestamp in each transaction. If the block is correct, the validator sends pre-vote messages to the other validators. Then, it waits for reception of 2 3 * log(n) pre-vote messages.

Pre-commit stage : once the validator node receives 2 3 * log(n) the pre-vote messages from the other validator nodes, it broadcast a pre-commit message to all the blockchain participants.

Commit phase : Each node in the blockchain (fog nodes and service providers) commit the block if it receives at least 2 /3 of log(n) pre-commit messages.

In order to protect the protocol from fault byzantine errors in the propagation of the messages and blocks, we introduce time-outs after sending each message or block. Therefore, each node waits for a certain time-out related to each stage (pre-vote, pre-commit). In case the expiration of the time-out, the node deletes the block to be validated from its memory. Besides, all the exchanged messages are digitally signed by the private keys of message senders. In this section, we propose a countermeasure solution to reduce the impact of cooperative attacks in the system. Our mitigation technique takes advantage of the history of the recommendations reported to the blockchain and works as follows : 1) Analyze the history of the received recommendations to detect if there is a cooperative attack. 2) Trigger a mitigation technique to eliminate the recommendations provided by the group of malicious nodes in the case of any eventual cooperative attack.

In order to deal with cooperative attacks, each fog node, during the computation of trust recommendations, executes the algorithm 2. This later works in the following steps :

1. First, the fog node selects all the recommendations for one particular IoT service provider S k (as discussed previously in our protocol). Let

L = {O 1 , O 2 , ..., O l } ∪ {Sp 1 , Sp 2 , .
.., Sp m } be the subset of IoT devices and service providers that have recommended Sp k during the last ∆T .

2. The fog node computes min k (t) = min i∈L {T S k ik (t)} and max k (t) = max i∈L {T S k ik (t)} which are respectively the minimum and the maximum of the recommendations provided by the devices of the list L. If the difference max k (t) -min k (t) is bigger than Thr , then the sevice provider Sp k may be subject of a cooperative attack. Indeed, having a large difference between max k (t) and min k (t) is a suspicious situation. In fact, there is at least one node who did not grant a good recommendation to Sp k contrariwise to others. Thus, one of these sub-groups is malicious (see from step 3 to step 7 in algorithm 2).

3. If an anomaly has been detected, the fog node consults the history of recommendations, available in the blockchain, which concern service provider Sp k in the last n time slots ∆T . The fog node ignores the recommendation of each node who frequently appears in the history (see from step 7 to step 16 in algorithm 2).

Theoretical Analysis

In this section, we will study the convergence of our protocol BC-Trust with respect to the parameters of our system. In this theoretical analysis, we give lower and upper bounds of trust values obtained by our protocol under bad-mouthing and ballot stuffing attacks, showing that our protocol is highly resilient to these attacks. We recall in Table 2 the symbols used in this section.

D ij n = α ij n = n t=1 S ij (t) n (5.7)
Since Sp j is a honest service provider, the satisfaction value S ij (t) at time t is at least equal to m and at most equal to 1 . Therefore, we obtain from equation (5.7) :

m ≤ D ij n ≤ 1
Given a network of N devices with a rate sp of service providers and λ (λ > 0 ) the rate of honest devices. Under bad-mouthing attacks, for each honest device O i and honest service provider Sp j such that i, j ∈ {1, ..., N }, i = j, we have :

∀n ≥ 1, R ij n ≥ λ m × T min n-1 (
R ij n = sp × Rs ij (n) + (1 -sp) × Ro ij (n)
Given a set L = L S ∪ L O composed of two subsets L S (service providers) and L O (IoT devices) that have recommended Sp j . We distinguish two cases for each subset :

1) For the subset L O , recommendation Ro ij (n) is expressed as follows :

Ro ij (n) = 1 |L O | × k∈L O T kj n-1 = R H + R M
where :

R H = 1 |L O | × k∈L O ∩H T kj n-1 R M = 1 |L O | × k∈L O ∩M T kj n-1
In what follows, we study the lower bounds of (R H and R M ).

Case 1 : the sum R H R H = 1 |L O | × k∈L O ∩H T kj n-1
By definition, for each n ≥ 0, we have : ∀i, j ∈ {1, ..., N }, T kj n ≥ T min n Hence, given that λ is the rate of honest devices in L O , we can simplify R H as follows :

∀n ≥ 1, R H ≥ λ × T min n-1
(5.9)

Case 2 : the sum R M Under bad-mouthing attacks, malicious devices report bad recommendations T ij n which are equal to 0 in the worst case. Therefore :

R M = 1 |L O | × k∈L O ∩M T kj n-1 T ij n ≥ 0 =⇒ R M = 1 |L O | × k∈L O ∩M T kj n-1 ≥ 0 (5.10)
From inequalities (5.9) and (5.10), we have :

Ro ij (n) ≥ λ × T min n-1
(5.11)

2) For the subset L S , recommendation Rs ij (n) is expressed as follows :

Rs ij (n) = k∈L S T ik n-1 k∈L S T ik n-1 × T kj n-1
Since our protocol considers only service providers that device O i grant them a trust value T ik n-1 > T hreshold (refer to Section 5.3.3.5 about the computation of Rs S k ij (∆t)). Hence, the set L S will be reduced to the new set L S :

L S = L S -{Sp k , T ik ≤ T hreshold} Rs ij (n) = k∈L S T ik n-1 k∈L S T ik n-1 × T kj n-1
Given T kj n-1 ≥ T min n-1 for each n ≥ 1 , we have :

Rs ij (n) ≥ k∈L S T ik n-1 k∈L S T ik n-1 × T min n-1 Let a k = T ik n-1 k ∈L S T ik n-1
. We can easily check that a = k ∈L S a k = 1 . Therefore, the sum Rs ij (n) can be simplified as :

Rs ij (n) ≥ T min n-1
(5.12)

From inequalities (5.11) and (5.12), we find out :

R ij n ≥ λ m × T min n-1
where λ m = sp + (1 -sp) × λ

Resiliency against malicious attacks

Given a network of N devices with sp the rate of service providers and λ (λ > 0 ) the rate of honest devices. Under bad-mouthing attacks, for each honest device O i PROTOCOL FOR IOT and honest service provider Sp j , such that i, j ∈ {1, ..., N }, i = j, we have : Based on the result of lemma 1 and lemma 2, we have :

T h = lim n→∞ T ij n ≥ m × β 1 -α -γ × λ m ( 5
T min n ≥ α × T min n-1 + β × m + γ × λ m × T min n-1
Hence, we get :

lim n→∞ T min n ≥ (α + γ × λ m ) × lim n→∞ T min n-1 + β × m Therefore : lim n→∞ T min n ≥ β × m 1 -α -γ × λ m Since ∀n ≥ 0, T ij n ≥ T min n
, we have :

lim n→∞ T ij n ≥ lim n→∞ T min n Therefore, T h = lim n→∞ T ij n ≥ β × m 1 -α -γ × λ m
Given a network of N devices with sp the rate of service providers and λ (λ > 0 ) the rate of honest devices. Under ballot-stuffing attacks, for each honest device O i and malicious service provider Sp j , such that i, j ∈ {1, ..., N }, i = j, we have :

T m = lim n→∞ T ij (n) ≤ 1 - m × β 1 -α -γ × λ m (5.14)
where :

λ m = sp + (1 -sp) × λ
Démonstration. The proof is similar to the proof of proposition 1.

Theorem 5.1. Given a network of N devices with sp the rate of service providers and λ (λ > 0 ) the rate of honest devices. Under bad-mouthing attacks, the mean trust E h (T j ) of honest service providers measured by all network devices is :

E h (T j ) ≥ λ × T h ≥ λ × β × m 1 -α -γ × λ m (5.15)
Démonstration. Let Sp j be a honest service provider, we have :

E h (T j ) = lim n→∞ 1 L L i=1 T ij n = lim n→∞ 1 L L i=1 [P r(O i is honest) × T ij n + P r(O i is malicious) × T ij n ] = lim n→∞ λ × T ij n + (1 -λ) × ε
Since ε ≥ 0 , the worst value of ε given by bad-mouthing attacker is 0 . Hence, we have :

E h (T j ) ≥ lim n→∞ λ × T ij n + (1 -λ) × 0 ≥ λ × T h ≥ λ × β × m 1 -α -γ × λ m
Theorem 5.2. Given a network of N devices with sp the rate of service providers and λ (λ > 0 ) the rate of honest devices. Under ballot-stuffing attacks, the mean trust E m (T ) of dishonest service providers measured by all network devices is :

E h (T j ) ≤ λ × T m + 1 -λ ≤ 2 -λ - λ × β × m 1 -α -γ × λ m (5.16)
Démonstration. Let Sp j be a dishonest service provider, we have :

E h (T j ) = lim n→∞ 1 N N i=1 T ij n = lim n→∞ 1 N N i=1 [P r(O i is honest) × T ij n + P r(O i is malicious) × T ij n ] = lim n→∞ λ × T ij n + (1 -λ) × ε
Since ε ≤ 1 , the best value of ε given by a ballot-stuffing attacker is 1 . Hence, we PROTOCOL FOR IOT have :

E h (T j ) ≤ lim n→∞ λ × T ij n + (1 -λ) × 1 ≤ λ × T m + 1 -λ ≤ 2 -λ - λ × β × m 1 -α -γ × λ m

Performances evaluation

In this section, we evaluate the effectiveness, resiliency and the benefits of our proposed BC-Trust approach through different experiments. We demonstrate how our experimental results fit with the theoretical analysis presented in the previous section. Basically, we performed three initial experiments. The first one evaluates the effectiveness of our solution in terms of convergence time with respect to different parameters (α, β, γ). The second one evaluates the resiliency of our protocol against bad-mouthing and ballot-stuffing attacks. Finally, we evaluate the effectiveness of our countermeasure approach against cooperative attacks. Table 5.3 summarizes the main setting parameters related to our experiments.

Evaluation of the convergence of our protocol

The first bunch of experiments aims to measure the convergence time of our protocol, and to study the impact of parameters α, β, γ and m on both convergence value and time. In order to get a clear view on the behavior of our protocol, this first sequence of experiments is done in a safe area where all the nodes are assumed to be honest.

Figure 5.4 illustrates the evolution of the mean trust value of all the service providers seen by all IoT devices during the lifetime of the simulation. We clearly notice that the limit trust value depends on the parameter m (the minimum satisfaction level that can be attributed to honest service providers). Besides, this limit trust value converges to the value m+1 2 which exactly fits with the result of proposition 1. However, we notice that the convergence time does not depend on the parameter m. Indeed, even with two different m values, our protocol converges to almost the same time (convergence after about 70 time units). Figure 5.5 depicts the mean trust value with respects to the parameters : α, β, γ. As we notice, these three parameters have an impact only on the convergence time of the mean trust value. However, these parameters do not affect the convergence value. Moreover, parameter β (the weight of direct observation) enhances significantly the convergence time compared to parameters α and γ. Indeed, with β = 2 3 and α = γ = 1 6 , the convergence time is reduced to around 40 time units, whereas with smaller value of β (i.e. β = 2

3 ) the convergence time is significant (> 80 time units). Mean trust value Time units m=0.9, λ=0.8 m=0.9, λ=0.9 m=0.8, λ=0.8 Mean Trust value Time units m=0.9, λ=0.8 m=0.9, λ=0.9 m=0.8, λ=0.8

Effectiveness of our protocol against malicious attacks

After studying the behavior of our protocol in normal circumstances, we evaluate in what follows its effectiveness under malicious attacks. We mainly focus on two kind of attacks : bad-mouthing and ballot-stuffing attacks.

As illustrated in Figure 5.6, the robustness of our protocol against bad-mouthing attacks has been evaluated with respect to the rate of honest nodes (λ). To do so, we vary the rate of honest nodes λ and the parameter m while the other parameters are kept constant and take their default values as shown in Table 3. Overall, we notice that the limit of mean trust value for honest service providers is reduced compared the result obtained in the case where there is no attack. As trivially expected, this limit value decreases with respect to the rate of malicious nodes (1 -λ). However, even with 20% of malicious nodes and m = 0 .9 , our protocol converges to a mean trust value which exceeds 0 .75 . This is due to our strategy of the computation of recommendations which favors trust values coming from honest nodes. Moreover, it is straightforward to see that the limit mean trust value is always bigger than the lower bound obtained in the theoretical analysis (see proposition 1) with a small gap which is up to 4 %.

On the other side, we evaluated the impact of ballot stuffing attacks on our protocol by varying the rate of honest nodes λ. Figure 5.7 illustrates the mean trust value of malicious service providers (evaluated by honest nodes) with respect to different values of λ and m. Despite the presence of significant malicious nodes (1-λ = 20%), we notice that the limit trust value is still small and reflects a correct reputation on these malicious nodes. Moreover, it is worth nothing that the theoretical analysis discussed in proposition 2 (upper bound limit of mean trust value of malicious nodes under ballot-stuffing attacks) are confirmed in the Figure 5.7.

Overall, the above results exhibit that BC-Trust shows its effectiveness and robustness to deal with bad-mouthing and ballot-stuffing attacks.

Effectiveness against cooperative attacks

In order to evaluate the efficiency and robustness of the countermeasure approach of our solution against cooperative attacks, we performed a set of experiments using the following scenarios :

Scenario 1 : we perform a cooperative bad-mouthing attack in which, all the malicious nodes target one service provider Sp j and periodically report bad recommendations about it. The other honest nodes behave naturally, where they choose the service provider Sp j randomly among other service providers and report real recommendations about it.

Scenario 2 : we perform a cooperative ballot-stuffing attack in which all malicious nodes periodically report good recommendations about the target malicious service provider Sp k , whereas honest nodes provide real recommendations about Sp k .

In both scenarios, we vary the rate of malicious nodes (1 -λ) to show the resiliency of our approach.

In figure 5.8, we show the evolution of mean trust value of target service provider Sp j under bad-mouthing attacks. We notice that our online countermeasure algorithm significantly reduces the effect of collaborative attacks compared to the case where there is no countermeasure. Indeed, despite the presence of 1 -λ = 20 % of malicious nodes conducting bad-mouthing attacks, the mean trust value of service provider Sp j reaches the limit value 0 .87 . This last is significantly bigger than the reached limit value in the case where there is no countermeasure (0 .59 ).

Similarly, in Figure 5.9, we show the results of experiments conducted on BC-Trust with the presence of ballot stuffing attacks by varying the rate λ. Our countermeasure algorithm also mitigates the trust computation process performed by fog nodes and it significantly reduces the impact of cooperative ballot-stuffing attacks. Indeed, with a rate 1 -λ = 20 % of malicious nodes, the limit trust value of the target malicious node reaches the value 0 .05 . This value is small comparing to the limit value 0 .27 obtained in the case where there is no countermeasure.

BC-Trust vs Existing solutions

In table 5.4, we show a comparison of our solution and two other solutions (presented in related works section) in terms of storage, computation and communication overhead. We notice that our protocol BC-Trust reduces storage related to trust In this table, we provide comparison in terms of computation, storage and communication. Note that N is the number of devices and F is the average number of friends in the social graph as presented in the work of Nitti et al. [START_REF] Nitti | Trustworthiness management in the social internet of things[END_REF].

values compared to other solutions. Indeed, in our protocol, IoT devices store only trust data related to service providers which are basically its own direct observations. The amount of this data is at most equal to 8 × N which depends linearly on the number of IoT devices N if we assume that trust values are encoded on 4 bytes. However, in other approaches, the storage overhead depends quadratically on the number of IoT devices N since each device must keep the recommendation of other nodes against each service provider. Moreover, contrary to other approaches, BCtrust reduces computation overhead (few additions and multiplication) which is independent of the number of IoT devices. Finally, the communication overhead, measured as the amount of data exchanged during ∆t, is also reduced in our protocol. Indeed, IoT devices need to exchange only with fog nodes to get recommendation about one service provider, whereas in other solutions IoT devices must exchange the recommendations between each others.

Note that to reach the consensus at blockchain layer, the communication complexity of fog nodes and service providers is O(((sp × N + l) * log(sp × N )), where sp is the percentage of service providers, l is the number of fog nodes in the architecture. This communication complexity is better than the complexity of PBFT consenus protocols, which work with O(n 2 ) for each validation event. We believe that this complexity is reasonable when it comes to powerful service providers and fog nodes.

Regarding the storage complexity, the storage of blockchain transactions can be optimized by maintaining only the most recent transactions used in the computation of recommendation values and replace the old blocks by their merkle hash [START_REF] Nakamoto | Bitcoin : A peer-to-peer electronic cash system[END_REF].

We present in Table 5.5 a qualitative comparison of our proposal with some previously presented related works. Our solution is very convenient with high mobility scenarios and resists against node failures. Furthermore, our solution is QoS-aware protocol since it reduces the latency during the computation of trust values and allows IoT devices to filter out service providers with respect to some QoS metrics thanks to fine-grained based service property. Detection rate(%) Malicious rate(%) BC-Trust Chen et al. [START_REF] Alanazi | On resilience of wireless mesh routing protocol against dos attacks in iot-based ambient assisted living applications[END_REF] Figure 5.10 -Successful detection rate under high mobility evaluated using 20 docker nodes, which were created locally in Ubuntu 18.04 machine with 16GB of RAM and Intel(R) Core(TM) i5-6200 CPU. Our evaluation was carried out on 1, 5, 10, 15 and 20 nodes where all of them act as validator nodes. We performed two scenarios of test to see the impact of the transactions rate and the number of validator nodes on transaction validation latency. In the following, we study the performance of BC-Trust with respect to the number of transactions received in parallel. In this scenario, we fixed the number of validators to 1 and we varied the number of transactions between 1 to 1000 transactions. We measured both the validation time of all the transactions and the time needed to compute recommendation values from the trust values stored in the blockchain (query time). As shown in Fig. 10, the latency of validation and request operations increase linearly with respect to the number of transactions and queries respectively. Overall, the results are very satisfactory in terms of scalability, given that the time that takes to validate 1000 transactions is 4s.

Impact of the number of validator nodes

In order to evaluate the impact of the number of validator nodes in our solution, we used the Tendermintâs PBFT implementation as consensus method. In these experiments, we varied the number of validator nodes by creating several docker containers that execute the same ABCI application (our BC-Trust). We fixed the number of parallel transactions by 100 transactions for all the experiments. Fig. 11 shows the validation time with respect to the number of validator nodes.

As expected, the validation latency increases accordingly. The maximum delay is roughly 3.3 seconds for 20 validator nodes. Note that Tendermint uses all validators to validate each block and it is mandatory that at least 2/3 of nodes commit the block to reach the consensus. Therefore, it is straightforward that, if we choose to reduce the number of validator nodes to log(n), n ∈ {5 , 10 , 15 , 20 , ...} as we have discussed in section 5.3.5, we can obtain better performance. This does not affect the security of the protocol as the selection of validator nodes is random and it is based on the trust level of each candidate service provider.

Conclusion

In this chapter, we proposed a new decentralized trust management protocol for IoT in fog computing architecture. Our protocol is distributed and each IoT object can assess trustworthiness of service providers and share it among IoT devices in a scalable way. Based on blockchain technology, our protocol offers a global view on the trustworthiness of each service provider in the architecture. Moreover, contrary to most existing works, our proposal deals efficiently with high mobility scenarios thanks to blockchain technology. Besides, we demonstrated through experiments the resiliency and robustness of our solution in front of malicious attacks. Then, we showed that our solution outperforms the existing ones, especially in terms of saving computation and storage resources. In addition, we confirmed our experimental result through an advanced theoretical analysis about the convergence of trust values under different malicious attacks. Furthermore, we shed the light on cooperative attacks where we proposed an efficient countermeasure based on the analysis of recommendations' history reported by IoT devices to the blockchain.

For future work, we plan to extend our proposed mitigation approach by developing more efficient offline algorithms for malicious nodes detection using machine learning techniques.

Chapitre 6

Conclusions and future directions

The evolution of the Internet, wireless communication technologies, as well as the development of new smart devices allowing the collection of environmental data such as temperature, motion, pressure etc. allows the emergence of the Internet of Things (IoT) paradigm. IoT has a wide variety of applications in many fields such as healthcare, industry, logistics, etc. This technology is considered as enabling technology for Systems of Systems (SoS).

In this thesis, we focused on the security of Internet of Things for Systems of Systems. The aim of our work is to make IoT based SoS more secure, and hence more trusworthy to build and execute sensitive applications. For this purpose, we investigated different security problems that threaten the IoT by using cryptographic techniques and new emerging technologies such as blockchain.

First, we were interested in the first step of the thesis on the study of the state of the art of security solutions In IoT. For this purpose, we surveyed security solutions proposed for IoT applications. We classified the different IoT applications by identifying their security requirements and their inherent challenges. Then, we discussed the IoT solutions dealing with confidentiality, privacy and availability, which are based on traditional cryptographic solutions and new emerging technologies such as Software Defined Networking (SDN) and blockchain.

Next, on the first hand, we focused on the access control and authentication issues in the context of remote control of IoT actuators. We tackled the problem of remote secure control of IoT actuators. For this purpose, we proposed a distributed lightweight fine-grained access control protocol based on Ciphertext Policy Attribute Based Encryption mechanism and one-way hash chain. We demonstrated through formal security analysis based on AVISPA tool that our scheme is secure against various attacks. Moreover, we demonstrated through simulations the scalability and the efficiency of our solution, which saves substantially energy consumption and computation costs.

On the other hand, we focused mainly on the application of blockchain technology to address security problems in the Internet of Things. We combined blockchain and fog computing paradigms to propose new solutions for the authentication and trust management in IoT.

We tackled the problem of authentication in heterogeneous IoI systems. We considered in particular the mutual authentication problem between IoT devices and fog nodes. The main aim is to develop a new efficient protocol that takes into consideration the resource limitation of IoT devices. Moreover, the mutual authentication should be performed only at the edge of the network without referring to external servers and cloud computing layer. To achieve this goal, we have proposed an efficient mutual authentication scheme, named MASFOG, which is based on public blockchain and secret sharing techniques. We use the blockchain, maintained at the fog layer, to allows IoT devices to authenticate fog nodes. In addition, it allows fog nodes to establish mutual authentication with each others. We used also secret sharing technique to authenticate lightweight devices. We showed through experimentations the efficiency of our authentication scheme which provides a low overhead in terms of storage capacity and computation.

We were also interested on the problem of trust management based on the blockchain technology. After studying the existing solutions that deal with trust management in IoT, we found out that they are not scalable enough when it comes to massively distributed systems such as IoT. Moreover, other questions still arise on how trust information is disseminated and shared in a scalable way among different IoT objects in order to speed up the process of trust computation and make it more accurate and secure. To deal with these issues, we have proposed a new scalable trust management protocol, named BCTrust, that allows IoT devices to accurately assess and share trust recommendations about other devices in a scalable way without referring to any pre-trusted entity. We have confirmed the efficiency and scalability of our protocol through theoretical analysis and extensive simulations.

Open Issues and Future Directions

Hereafter, we shed the light on some perspectives and future directions relating to security in IoT :

Regarding our authentication scheme, MASGOG, there are still some important issues concerning the revocation problem in fog computing.

MASFOG is based on the blockchain technology where there is no central entity that can manage the whole system. Therefore, the decentralization nature of MASFOG makes the revocation process very hard to achieve since it is necessary to update the cryptographic keys of the revoked nodes in the whole blockchain. Beside, we need to develop efficient revocation mechanism that should be as less expensive as possible. This task is also very tricky as use in MASFOG design a public blockchain based on Proof of Work (PoW). As future work, we intend to extensively address the problem of revocation in MASFOG.

Regarding BC-Trust, we plan to enhance this protocol by developing more efficient algorithms for malicious node detection (malicious fog nodes or IoT devices) based on trust data maintained on the blockchain and reported by devices. In this direction, it could be interesting to explore and use machine learning approaches to improve the process of malicious node detection. Beside, in future, we will consider other trust models such as Bayesian and probabilistic models to propose more efficient and robust trust management protocols.

The need to develop context-awareness solutions in the environment in which the smart objects and humans evolve is a fundamental approach to address the security in highly distributed and dynamic environments such as IoT. For example, in the context of trust management, it could be interesting to take into account information like : number of surrounding objects, the energy level of service providers and devices, the geographic localization of devices, etc. in order to make relevant decisions about the trustworthiness of service providers. We can exploit the context in order to develop efficient authentication approaches. This goal could be achieved by taking into account the physical locations of devices and their activities to make decisions about the authenticity of devices without referring to credential keys and heavy cryptographic approaches.

As we have shown in this thesis, the blockchain technology can offer a high level of security of IoT transactions in many applications. A lot of researchers believe that this technology could change the world of IoT in terms of security and services. However, this technology is still just in its early stage, and therefore a lot of research must be devoted in order to optimize some of its important features such as consensus mechanisms used to validate transactions. In the context of IoT, it is important to develop a consensus approach that establish a tradeoff between security and efficiency. In addition, blockchain solutions suffer also from some privacy issues and are still vulnerable to anonymity attacks [START_REF] Conoscenti | Blockchain for the internet of things : a systematic literature review[END_REF]. In the Blockchain, pseudonyms are used as users' identifiers to send and receive transactions. In fact, the pseudonym does not ensure the privacy of transactions, it is possible to de-anonymize a user and disclose its identity by analyzing transactions' inputs and outputs. Therefore, it should be interesting to take advantage of the state of art in privacy based blockchain and public ledger solutions and adapt them in the field of IoT.

2. 1

 1 Security services and mechanisms . . . . . . . . . . . . . . . . . . . . . 2.2 Comparison of some IoT security solutions. . . . . . . . . . . . . . . . . 3.1 Table of notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Computation and storage analysis . . . . . . . . . . . . . . . . . . . . . 3.3 Time execution of challenge response . . . . . . . . . . . . . . . . . . . 4.1 Table of notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Transactions' verification and validation time . . . . . . . . . . . . . . . 4.3 Storage and computation cost in our scheme . . . . . . . . . . . . . . . 5.1 Table of notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Table of symbols .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 Test settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 comparison in terms of trust evaluation cost . . . . . . . . . . . . . . . 5.5 Comparison between trust management protocols . . . . . . . . . . . .

Figure 1 . 1 -

 11 Figure 1.1 -The architecture of IoT (source [136]).

Figure 1 . 2 -

 12 Figure 1.2 -Typical architecture of IoT based fog and cloud computing (source []).

Figure 2 . 1 -

 21 Figure 2.1 -IoT security solutions

Figure 2 . 3 -

 23 Figure 2.2 -Key Policy ABE (KP-ABE).

30 CHAPITRE 2 .

 302 INTERNET OF THINGS SECURITY : STATE OF THE ART 2.4.3.1 IoT DoS/DDoS countermeasure approaches IP Traceback methods are powerful mechanisms largely adopted in IP based networks such as Internet to detect DoS and IP flooding attacks in real-time. These methods focus mainly to enhance the security of IP based lightweight protocols basically designed as adaptations of the traditional TCP/IP protocols in the Internet of Things. DTLS 5 (Datagram Transport Layer Security), 6LoWPAN 6 (IPv6 Low power Wireless Personal Area Networks), RPL (IPv6 Routing Protocol for Low-Power and Lossy Networks)) are just examples among other protocols widely adopted in the world of IoT which provide confidentiality and integrity of end-to-end exchanged information between IoT devices

Figure 2 . 4 -

 24 Figure 2.4 -Blockchain structure in bitcoin system

Figure 2 . 5 -

 25 Figure 2.5 -Blockchain : steps of transactions' validation process.

Figure 3 . 1 -

 31 Figure 3.1 -Example of Ciphertext Policy ABE (CP-ABE).

Figure 3 . 2 -

 32 Figure 3.2 -One way hash chain.

Figure 3 . 3 -

 33 Figure 3.3 -Our system model

Figure 3 . 4 -

 34 Figure 3.4 -The main steps of our solution.

Figure 3 . 5 -

 35 Figure 3.5 -Initialization phase.

Figure 3 . 6 -

 36 Figure 3.6 -Token generation phase.

Figure 3 . 7 -

 37 Figure 3.7 -Action execution phase.

Figure 3 . 8 -

 38 Figure 3.8 -Hlpsl specifications of the role P (the gateway)

Figure 3 . 9 -

 39 Figure 3.9 -The hlpsl security goals of our protocol

Figure 3 . 10 -

 310 Figure 3.10 -Results reported by the OFMC back-end

Figure 3 . 11 -

 311 Figure 3.11 -The mean execution time of action execution with respect to λ (|D| = 10).

Figure 3 . 12 -

 312 Figure 3.12 -The mean execution time of action execution with respect to |D| (λ = 0.5).

Figure 4 . 1 -

 41 Figure 4.1 -Fog-computing architecture[START_REF] Ahmed | A survey on mobile edge computing[END_REF]

Figure 4 . 3 -

 43 Figure 4.3 -Edge network mutual authentication

Figure 4 . 4 -

 44 Figure 4.4 -Registration phase

Figure 4 . 5 -

 45 Figure 4.5 -Our solution Vs certificate-based authentication

Figure 5 . 1 -

 51 Figure 5.1 -Our system architecture

Figure 5 .

 5 Figure 5.3 -work-flow of our trust management protocol BC-Trust

  kj n , k, j ∈ {1, ..., N }, and O k , O j ∈ H} λ m = sp + (1 -sp) × λ Démonstration. From equation (5.3), we have :

. 13 )

 13 where : λ m = sp + (1 -sp) × λ Démonstration. Given O i and Sp j are honest. By definition, we have : ∀n ≥ 0,T ij n ≥ T min n. Thus, we only need to study the convergence of the sequence (T min n ) n∈N .

100 Rate of service providers (sp) 20 % 1 3Figure 5 . 4 -Figure 5 . 5 -

 1002015455 Figure 5.4 -Mean trust of honest service providers w.r.t. m.

Figure 5 . 6 -

 56 Figure 5.6 -Mean Trust under badmouthing attacks.

Figure 5 . 7 -

 57 Figure 5.7 -Mean Trust under ballotstuffing attacks.

Figure 5 . 8 -

 58 Figure 5.8 -Trust under cooperative bad-mouthing attacks.

Figure 5 . 9 -

 59 Figure 5.9 -Trust under cooperative ballot-stuffing attacks

Tableau 5 . 4 -

 54 comparison in terms of trust evaluation cost

  Contrary to other approaches, BC-Trust introduces other original properties such as global view of PROTOCOL FOR IOT

Figure 5 . 11 -Figure 5 . 12 -

 511512 Figure 5.11 -Validation latency w.r.t. transactions rate

  1. Djamel Eddine Kouicem, Abdelmadjid Bouabdallah, Hicham Lakhlef. Internet of Things Security : A top down survey. In Journal of Computer Networks, 141(2018),pp.199-221. 2. Djamel Eddine Kouicem, Youcef Imine, Abdelmadjid Bouabdallah, Hicham Lakhlef. Decentralized Trust Management Based Blockchain Protocol for Internet of Things. In IEEE Transactions on Dependable and Secure Computing. Under revision. Resumé l'Internet des objets (IoT) est une nouvelle technologie qui vise à connecter des milliards d'objets physiques à Internet. Les composants de l'IoT communiquent et collaborent dans des environnements distribués et dynamiques, confrontés à plusieurs problèmes de sécurité de grande ampleur. La sécurité est considérée parmi les enjeux majeurs de l'IoT et soulève des défis liés aux contraintes de capacité de calcul et stockage ainsi que le très grand nombre des objets connectés. Dans cette thèse, nous nous intéressons à l'application des outils cryptographiques ainsi que la technologie blockchain pour résoudre les problèmes de sécurité dans l'IoT, à sa-

	International Conference Publications
	In 13th IEEE System of Systems Engineering Conference, JUNE 19-22, 2018,
	Paris, France.
	3. Youcef Imine, Djamel Eddine Kouicem, Ahmed Lounis, Abdelmadjid Bouab-
	dallah. MASFOG : An Efficient Mutual Authentication Scheme For Fog Com-
	puting Architecture. In 17th IEEE International Conference On Trust, Secu-
	rity And Privacy In Computing And Communications, July 31th -August 3rd,
	2018, New York, USA.

1. Djamel Eddine Kouicem, Abdelmadjid Bouabdallah, Hicham Lakhlef. Distributed Fine Grained Secure Control of Smart Actuators in Internet of Things. In 15th IEEE International Symposium on Parallel and Distributed Processing with Applications, Dec 2017, Guangzhou, China. 2. Djamel Eddine Kouicem, Abdelmadjid Bouabdallah, Hicham Lakhlef. An Efficient Architecture for Trust Management in IoE Based Systems of Systems. voir : l'authentification et la gestion de confiance. Dans un premier lieu, nous nous sommes intéressés au problème du contrôle d'accès distant des actionneurs intelligents utilisant des dispositifs IoT. Pour addresser ce problème, nous avons proposé une solution de contrôle d'accès efficace et à granularité fine, basée sur le mécanisme ABE (Attribute Based Encryption) et des chaînes de hachage. À l'aide d'outils formels d'analyse de sécurité, nous avons démontré la sécurité de notre protocole face aux attaques malveillantes. Dans un deuxième lieu, nous avons adressé le problème d'authentification dans les applications IoT basées sur le paradigme du fog computing. Nous avons proposé un nouveau protocole d'authentification mutuelle efficace qui est basé sur la technologie blockchain et la cryptographie à seuil. Dans notre solution, les objets IoT et les serveurs de fog n'ont besoin que de quelques informations à stocker pour vérifier l'authenticité de chaque objet du système. L'authentification est effectuée seulement sur la bordure du réseau sans passer par des entités externes.

  .1 some of those mechanisms.Internet of Things enables to improve several applications in various fields, such as, healthcare, smarts grids, smart cities, smart homes as well as other industrial applications. However, introducing constrained IoT devices and IoT technologies in such sensitive applications leads to new security and privacy challenges. In the following, we highlight the important security challenges of IoT applications :• Heterogeneity : communication standards and information system technologies are heterogenueus. the communication between sensor nodes and servers or CPU units in general are done over Internet where networks, protocols and communication mediums are heterogeneous and have different security configurations. It is necessary to provide security standards that work with differents IoT plateforms and protocols.

	2.2. IOT APPLICATIONS : SECURITY CHALLENGES
	2.2 IoT Applications : security challenges
	Security services	Security mechanisms	Some examples
	Confidentiality	message encryption /	symmetric cryptographic
		sign-encryption	mechanisms (AES, CBC,
			etc) ; asymmetric mechanisms
			(RSA, DSA, IBE, ABE, etc).
	Integrity	hash functions, message	hash functions
		signature	(SHA-256,MD5, etc) ;
			Message Authentication
			Codes (HMAC)
	Authentication	chain of hash, Message	HMAC, CBC-MAC, ECDSA
		Authentication Code
	Non-repudiation	message signature	ECDSA, HMAC
	Availability	pseudo-random frequency	Signature-Based Intrusion
		hopping, Access control,	Detection, Statistical
		Intrusion prevention systems,	anomaly-based intrusion
		firewalls	detection
	Privacy	pseudonymity, unlinkability,	EPID, DAA, Pedersen
		k-anonymity, Zero Knowledge	Commitment
		Proof (ZKP)
	Tableau 2.1 -Security services and mechanisms

  Tableau 2.2 -Comparison of some IoT security solutions.

	Solutions	Challenges	C o m p u t a t i o n	C o m m u n i c a t i o n	M e m o r y	M o b i l i t y	H e t e r o g e n e i t y	S c a l a b i l i t y	Q o S
	Confidentiality	Touati et al. [133] Oualha et al. [110] Guo et al. [60] Yao et al. [140] Su et al. [127] Thatmann et al. [131] Chen et al. [36]	++ + + ++ --++	-+ -+ + + +	+ -++ + + + ++	+ + + + + + -	+ -+ + ---	-+ ---+ -	-+ -+ + + +
		Mao et al. [99]	+	+	+	+	+	-	+
		Evans et al. [52]	+	-	++	+	-	+	+
	Privacy	Zhang et al. [145] Alcaide et al. [7] Huang et al. [70] Skarmeta et al. [124]	++ ++ + ++	-+ -+	++ + -+	+ + + -	+ -++ -	-+ + +	+ + + +
		Tonyali et al. [132]	+	-	+	-	-	+	+
	Availability	Maleh et al. [95] Kasinathan et al. [76] de et al. [48] Machaka et al. [93] Shreenivas et al. [120]	+ + -+ +	+ -+ + +	-+ --+	+ + + -+	+ + + + +	-+ ---	-+ + --
	Blockchain	Hardjono et al. [65] Gaurav et al. [54] Hashemi et al. [66] Kokoris-K et al. [79] Kamanashis et al. [17]	+ ----	--+ + -	+ ----	+ ++ --+	++ + + + +	++ ++ ++ ++ ++	-+ + + +
	SDN	Flauzac et al. [53] Bull et al. [25] Vandana et al. [134]	++ + +	----	+ + +	-+ -	++ + ++	++ -+	-++ +
		Gonzalez et al. [57]	+	-	+	-	+	+	++

  Then, it computes the ciphertext C jk of the challenge M jk encrypted under the policy P jk using the encryption primitive of CP-ABE scheme. All the ciphertexts are also signed by the private key D O i of the owner O i . Finally, the owner makes all the encrypted challenges available by sending them under the form of a set of Fivepet {< SA

j , A jk , M jk , C jk , {C j k } D O i > where SA j ∈ SA, A j k ∈ A j } to

the IoT gateway G that controls smart actuators. The gateway G constructs, for each smart actuator SA j , two columns table that contains, for each action A jk , its corresponding encrypted challenge {C jk } D O i as illustrated in the figure

3

.4.

  .6).By consulting the table related to the actuator SA j , the gateway G generates randomly a nonce value V j ∈ {0 , 1 } l and responds to the smart object D i by sending the challenge < {C jk } Downer , C jk , V j >, where C jk , {C jk } Downer are the ciphertext related to the action A jk and its signature respectively (steps 5 and 6).

	52 CHAPITRE 3. FINE-GRAINED SECURE CONTROL OF SMART ACTUATORS IN IOT
		IoT device Di	Owner O		Gateway G	Actuator SAj
	4	want to execute the action Ajk on the	Request : <SAj, Ajk, SAj>
		actutor SAj
				5	• Lookup the table of SAj • Generate a nonce Vj
		Challenge : <{Cjk}Do, Cjk, Vj>
					6
		• Solve the challenge and cover M' jk
	7	• Generate a symmetric key Sj
	generation	8 • Compute Rjk = H(M'jk || Vj)	Response: {Rjk, Sj}PG
	Token		9	No	Rjk = H(Mjk||Vj) ?
				End
				• Generate Hash Chain CHi = {h1, ..., hn}
				• Generate a random identifier IDi
					entry : <IDi , Ajk , hn>
		Token : {IDi , CHi}Sj		10
					Save the entry in a lookup
	12	Cover the token and save <IDi, CHi>			11	table

The IoT device D i , which holds the private key SK D i generated by the trusted authority, verifies the signature {C jk } Downer using the owner's public key PK owner . If D i holds the private key SK D i generated based on a

Table 1

 1 , defines the most important notations used in this section.

	Notation	Description
	H ( * )	Hash Function
	P (x )	Polynomial of degree m
	(PK X -1 ui	private key related to the public key X ui
	F si	Fog node i 's share
	(FPK i , FSK i )	Fog node i 's public and private keys
	B i	Broker i
	CS	Session key
	H []	The Hash chain
	σ	Cryptographic digital signature
	{M } K	The encryption of the message M with the public key K
		Tableau 4.1 -Table of notations

i , SK i ) Broker B i 's public and private keys respectively

(PK , SK )

Validation public and private keys respectvely, shared between all the brokers n a public parameter which defines the group Z n (X ui , Y ui ) User ui 's coordinates generated by one of the brokers

  t) : is a real number in the range [0 , 1 ] which expresses the trust level of IoT device O i toward IoT service provider Sp j with respect to the service S at instant t. The max value 1 means that the node Sp j (trustee) is full trusted with respect to the node O i (trustor) and 0 indicates that service provider Sp j is a bad or malicious node. : is a real number in the range [0 , 1 ] computed by a fog node based on the trust values, which concern service provider Sp j , reported by IoT devices. This value is sent to IoT device O i . It represents the mean of satisfactions against the service S during the interactions between device O i and service provider Sp j . Figure5.2 illustrates our trust model, in which we define trust parameters used in our protocol. In addition, Table1summarizes the main notations used in this paper. Trust of O i toward Sp j w.r.t. service S k at time t D S k ij (t) Direct observation of O i toward Sp j w.r.t. service S k at time t R S k rj (t) Recommendation of O r toward Sp j w.r.t. service S k at time t S ij Satisfaction level of O i toward Sp j Tx R (O i , Sp j , S k ) Transaction that contains the recommendation of node O i toward node Sp j IoT devices continuously evaluate and update trust information about encountering IoT service providers whenever they request a service. In what follows, we explain the different steps of our protocol BC-Trust.

	Recommendation R S ij (t) Direct Observation D S Provided services Figure 5.2 -Our trust model Provide service S1 Request service S1 Direct observation based on interactions Notation Description O i The IoT device i PK i The public key of IoT device O i Trust value SK i The private key of IoT device O i S k The service k T S k ij (t) α ij Accumulated satisfaction level of O i toward Sp j β ij Accumulated dissatisfaction level of O i toward Sp j α Weight on previous experiences β Weight on direct observation γ Weight on indirect recommendations ∆T R The period of time that separates two transactions Tableau 5.1 -Table of notations ij (t) : is a real number in the range [0 , 1 ]. Recommendation 5.3.3 Our protocol BC-Trust for trust management
	BC-Trust is a real time, evolutionary and encounter-based assessment process,
	which provides trust information about any service provider. Indeed, in our protocol,
	"honest"

  set of criteria C ⊂ C = {C 1 , C 2 , ..., C N } : that represents the criteria on which O i has based its evaluation of service S k . The trust value T S k ij that refers to the level of trustworthiness of the service provider Sp j assessed by the device O i with respect to the service S k and criteria C . The timestamp tsp S k ij of the last updated trust value T S k ij . The previous {R ij , ∆T = [t 1 , t 2 ]} SK FN l signed by FN l and computed based on trust values reported by IoT devices regarding service provider Sp j . The computation of R ij takes in consideration only the reported trust values in the interval ∆T = [t 1 , t 2 ]. Further explanations about the computation of R ij are provided in phase 5.3.3.5.

  ∆t) represents the last trustworthiness of service provider Sp j . D S k ij (t -∆t) represents the direct observation measured till instant t. The last parameter denoted by R S k ij (∆t) refers to the indirect recommendations of the other IoT devices toward Sp j . 2. Case 2 : if the device O i has not interacted previously with the service provider Sp j and it does not dispose of any previous trustworthiness level T S k ij (t -∆t) about Sp j , then it considers only the indirect recommendation R S k ij (∆t) as trustworthiness value T S k ij (t). When a device O i requests one service S k from Sp j , it measures the satisfaction level of the provided service. Let S ij (t) be the current satisfaction level, which is a real number in the range [0 , 1 ]. The direct observation D S k ij (t) is :

	5.3.3.4 Computation of D S k ij (t)

  1 < t 2 < ... < t n = t represent the instants where service S k was requested.n is the number of experiences regarding the service S k .

	Algorithm 1 summarizes the different steps of trust assessment protocol, executed
	by IoT devices.
	Algorithm 1 Trust assessment-IoT devices level
	1: Input : O i : IoT device, Sp j : IoT service provider
	2: procedure ComputeAndReportTrust
	3:	[t]Requests a recommendation about Sp j from the home fog node
	4:

table 19 :

 19 Update the entry (D ij , T ij ) in the loockup Construct and send transaction T x R (O i , Sp j , S k ) Sp k ∈ L S .In fact, each recommendation value T S k kj provided by Sp k is weighted by the ratio of the trust value reported by O i toward Sp k , to the sum of all trust values given by O i toward each service provider in L S . Hence, if trust value T S k ik of O i toward Sp k is high, then the fog node will attribute a high weight to the recommendation T S k kj . For sake of optimization, the fog node only considers the recommendation coming from service providers that device O i grants them a minimum trust value Threshold . As an example, fog node considers the recommendations provided by the service providers if their trust value regarding O i exceed 0.7 (i.e. T S k ik > 0 .7 ). Finally, fog node FN l computes the recommendation R S k ij (∆t) and responds to the device O i by sending {R S k ij (∆t), ∆t = [t 1 , t 2 ]} SK FN l signed by its private key SK FN l . The device O i will integrate this information in the next transaction as explained previously in Section 5.3.3.2. It allows the other fog nodes to detect any misbehavior from fog node FN l during block validation step.

		Threshold then
	11:	Ignore the service provider Sp j
	12:	return false
	13:	else
	14:	Service S k Done
	15:	Evaluate the satisfaction S ij (t) ∈ [0, 1]
	16: 17:	α ij ← α ij + S ij (t) ; n ← n + 1 ; αij D ij ← n
	18:
	20:	return True
	21:	end if
	22: end procedure

Table 1 .

 1 Device Oi requests recommendation from fog node 2. Fog node filters out the transactions produced during the last Dt 3. Fog node computes the recommendation based on algorithm 2 4. fog node sends the recommendation of Spj to Oi 5. Oi requests a service from Spj

	92	CHAPITRE 5. DECENTRALIZED BLOCKCHAIN-BASED TRUST MANAGEMENT
	PROTOCOL FOR IOT
	Algorithm 2 Trust assessment-Fog nodes level
	1: procedure ComputeRecommendation
	2:	Init1 : L S ← {} ; L O ← {}
	3:	[t] Init2 : L ← the T -th most recent recommenders
		that reported transactions in [t -∆T, t]
	4:	if L = ∅ then R S k ij ← 0.5
	5:	if ∃R S k kj (t ) ∈ Blockchain && t < t -∆T then
	6:	R S k ij ← (1 -P nl) × R S k ij (t )
	7:	end if
	8:	Send the recommendation R Sk ij to the device O i
	9:	return R S k ij
	10:	end if
	11:	for O k ∈ L do
	12:	if O k is a service provider then
	13:	L S ← Sp {O k }
	14:	else
	15:	L O ← Sr {O k }
	16:	end if
	17:	end for
	18:	Compute Ro S k ij //recommendation of L O (equation 4)
	19:	Compute Rs S k ij //recommendation of L S (equation 5)
	20:	R S k ij ← Sp × Rs S k ij + (1 -Sp) × Ro S k ij
	21:	Send R S k ij to the device O i
	22:	return R S k ij
	23: end procedure
		Filter out the most fresh transactions
		produced during the last Dt
		Lookup
		#Service provider	Dij	Tij
		PK_Sp1	(aij,n1)	Ti1
		PK_Sp2	(aij,n2)	Ti2
		...	...	...

6. Spj delivers the requested service 7. Oi evaluates satisfaction and updates the lookup table device Oi

  Algorithm 3 Countermeasure against cooperative attacks 1: Input : O i : IoT device, Sp j : IoT service provider 2: procedure Online Countermeasure

	3:	Init : Sp ← {} ; Sr ← {} ; N bocc[T ] ← {0}
	4:	[t] L ← the most recent recommenders
		that reported transactions in [t -∆T, t]
	5:	min j (t) ← min i∈L {T S k ij (t)}
	6:	max j (t) ← max i∈L {T S k ij (t)}
	7:	if max j (t) -min j (t) < T hr then
	8:	History ← transactions produced during [t -n × ∆T, t]
	9:	for O k ∈ T opR do
	10:	for i := 1 to n do
	11:	if T S k kj (t -i∆T ) ∈ History then
	12:	N bocc[k] ← N bocc[k] + 1
	13:	end if
	14:	end for
	15:	end for
	16: 17:	for O k ∈ L do if N bocc[k] n > 0.8 then
	18:	L ← L -{O k }
	19:	end if
	20:	end for
	21:	end if
	22:	R S k ij ← ComputeAndReportTrust(L)
	23:	return R S k

ij 24: end procedure

  Trust values T S k ij are updated each time that device O i requests a service S k from service provider Sp j . We define {t 0 , t 1 , t 2 , ...} as an ordered set of instants when O i requests S k . Hence, each t n refers to the n th service request. For sake of simplicity, we consider only one service in what follows. Thus, we noteT S k ij (t n ) by T ij n .We define the sequence S = (T ij n ) n∈N by the set of trust valuesT ij (t), t ∈ [t n , t n+1 ], n ∈ N.We define the sequence R = (R ij n ) n∈N by the set of recommendation values R ij (t) reported by fog nodes at each instant t ∈ [t n , t n+1 ], n ∈ N.We define the sequence D = (D ij n ) n∈N by the set of direct observations D ij (t), t ∈ [t n , t n+1 ], n ∈ N. 5.4.1 Study of the convergence of S = (T ij n )

	Notation	Description
	N	The number of IoT devices (service providers and service requesters)
	sp	The rate of service providers
	λ	The rate of honest devices
	m	The minimum satisfaction value that can be attributed to one honest
		service provider Sp j by honest device O i
	T ij n	The trust value attributed to service provider Sp j by an honest IoT
		device O i at time n
	H , M	The subsets of honest and malicious devices respectively
	E h (T j )	The mean trust value of honest service provider Sp j , measured by all
		IoT devices
	E m (T j )	The mean trust value of malicious service provider Sp j , measured by all
		IoT devices
		Tableau 5.2 -Table of symbols

n∈N

Given a network of N devices. For each honest device O i and honest service provider

Sp j , we have : ∀i, j ∈ {1, ..., N }, i = j, m ≤ D ij n ≤ 1 (5.6)

Démonstration. From equation (5.2), we have :

https ://www.insee.fr/en/statistiques/1281166

https ://www.insee.fr/fr/statistiques/1906695 ?sommaire=1906743

path composed from a set of successive secure links

embedded, component-based operating system : http ://tinyos.stanford.edu/tinyoswiki/index.php/TinyOS_Documentation_Wiki

properties related to the users in the system, for example : PhD student can be considered as an attribute

An alternative standard of TLS, it is a UDP-based protocol which is less network overloaded

Lightweight based IPv6 protocol to address IoT devices

https ://www.fit.fraunhofer.de/en/fb/ucc/projects/ebbits.html

https ://suricata-ids.org/

The most known SDN protocols, proposed by ONF

http ://acsc.cs.utexas.edu/cpabe/

https ://crypto.stanford.edu/pbc/download.html

In the practice, the gateway can handle several requests simultaneously thanks to multithreading feature

https ://github.com/ethereum/go-ethereum

The fog nodes can also be compromised. They can drop, delay, modify and redirect the received messages.

Tendermint blockchain framework consists of a set of tools for achieving consensus on a distributed network, execution of smart contracts, and creation of blocks

Remerciements

To validate the transaction, the brokers run the proof of stack algorithm, which designates one of the brokers B j to verify and validate the transaction as follows :

Verify the signature of the transaction using the broker's B i public key

If the signature has been successfully verified, solve the mathematical problem defined through the difficulty field in B i 's block.

Fill the solution of the mathematical problem in the nonce field, then sign the transaction using the validation key S k Insert the new block into the blockchain.

We note that the verification in this step has no relation with the certificates' verification that the broker ran before. It only consists of verifying that one of the valid brokers has generated the transaction. Figure 3, shows the structure of our proposed blockchain.

Once the fog node's public key FPK i has been inserted into the blockchain, the broker B i , who verified its certificate, sends to that legitimate fog node the verification parameters that were computed in the setup phase, in order to allow to authenticate the devices without resorting to the cloud.

Devices registration phase

The devices should also perform a first registration in the cloud level. To confirm its identity, a user needs to successfully be authenticated using the already adopted authentication system in the cloud. After that, the cloud broker generates new credentials to that user in order to allow him to perform any eventual authentications at the edge of the network (fog node level) as folllows :

given a transaction block defined as :

Where :

header the block Bc i header in the blockchain state= valid or not valid.

The user computes :

Where : H is a hash function Verify the signature of the block using the validation public key P K, received as part of its credentials as follows :

If H 1 is equal to H 2 , then the fog node transaction is verified. Otherwise, the user notices that the fog node did not provide a block from the valid blockchain since the signature does not match with the public key P K provided by the broker.

User authentication : once the user verifies the transaction presented by the fog node, it starts its authentication process. Therefore, it sends its credentials encrypted with the fog node's public key as :

On the other side, the fog node verifies the user's authenticity as follows :

Decrypt the received verification parameters using the private key F SK i .

Perform a polynomial interpolation in Z p using the values (U s ui , X ui ) provided by the user, and the (X i , Y i ) coordinates provided by the cloud PROTOCOL FOR IOT

As previously explained, our trust assessment is also based on recommendations provided by fog nodes. These recommendations are computed using trust values stored in the blockchain.

To provide indirect recommendation R S k ij (∆t), fog node FN l starts by filtering out the most recent transactions, which have been occurred during the last ∆t time units, available in the blockchain. We denote by L the list of IoT objects which have reported the filtered transactions. Next, from the list L, we distinguish two cases :

where :

sp : the rate of service providers in the list L (0 ≤ sp ≤ 1 )

Rs S k ij (∆t) : the average of the recommendations provided by service providers.

Ro S k ij (∆t) : the weighted average of the recommendations provided by IoT devices.

Overall, in equation (5.3), the computation of R S k ij (∆t) depends upon two different values Rs S k ij (∆t) and Ro S k ij (∆t). Indeed, in our solution, service provider Sp j could be recommended by both IoT devices or other service providers.

Therefore, in the list L, fog node FN l selects the subset L O of IoT devices. Then, it computes Rs S k ij (∆t) as follows :

where :

L O ⊂ L : is a subset of L that contains only service requesters. Equation (5.4) represents the average of all recommendations (T S k kj ) that were reported by all devices O k ∈ L O and stored in the blockchain during the last period ∆T .

Likewise, fog node F N l , selects the subset L S (L S ⊂ L) of IoT devices. Then, it Scalability Mobility Node-failure QoS Convergence time Global view [START_REF] Chen | Trust-based service management for social internet of things systems[END_REF] -

Tableau 5.5 -Comparison between trust management protocols trustworthiness information and scalability support which are very important in IoT.

In addition, we were interested in comparing our approach with the work of chen et al. [START_REF] Chen | Trust-based service management for social internet of things systems[END_REF] in terms of successful detection rate under high mobility scenario with the presence of malicious nodes. For this aim, we adopted the same mobility scenario based on random walk model. In this model, we generated initial random positions for 100 devices in a range of 100x100m. Each round (5 seconds), all devices must change their positions based on the random walk model and try to discover the service providers in their neighborhoods. We considered a communication range equal to 20m for all devices. Each device requests the same service from all its neighbors and performs the trust management protocol. We fixed the number of rounds by 100 rounds. We assume that there are sufficient fog nodes that can cover the whole region. We varied the percentage of malicious nodes from 0% to 30% and we observed the rate of successful detection. Fig. 9 shows that our protocol outperforms the protocol of chen et al. in terms of successful detection rate even with the presence of 30% of malicious nodes. BC-Trust achieves a high performance with 100% of successful detection rate if λ ≤ 0.25 and 90% if λ = 0.3. These results are achieved thanks to our 2-layer architecture that ensures a global view of trustworthiness in the whole network with only few exchanges, and so it deals very efficiently with high mobility scenarios.

Blockchain scalability evaluation

We implemented our protocol using the framework tendermint [START_REF] Buchman | Tendermint : Byzantine fault tolerance in the age of blockchains[END_REF]. Tendermint framework is a tool used to build a private and consortium blockchains based on PBFT consensus protocol. It allows developers to build any application on the top of the underlying PBFT protocol using Application Blockchain Interface (ABCI). We developed our protocol using Python as programming langage. BC-Trust was