scieee AI-readable full text Open interactive document viewer

Secure Proximity-based Mobile-IoT Interaction

Ros Iturgaiz, Ibai

Abstract

In a world where so many interconnected devices are used in our everyday life, security of those devices and their communications becomes a fundamental aspect to keep an eye on. Almost any feature possessed by a device can be exploited for an attack, potentially incurring in economic or moral damage. With that in mind, proximity between devices becomes a potential ally for providing that much-needed level of security. This is the case of, for example, credit cards and radio-frequency identification (RFID) systems, where proving proximity is key for the security of the scheme. In this area, the application of Visible Light Communication has been proved to be beneficial and even optimal, mostly due to its propagation characteristics. However, not many real-life examples have accomplished a successful implementation or have not made it into the market in a massive manner. This Master?s Thesis has the aim of developing a secure method, based on Visible Light Communication, for the interaction between smartphones and IoT devices in a bidirectional way. Moreover, a practical application of this method can be using it as a first-factor authentication method, thus replacing the vulnerable weak authentication mechanisms existing in smart homes and related environments. Therefore, a practical application of the method has been developed as a Proof of Concept. This application consists of a novel form of IoT device commissioning, making use of Visual Light Communication technologies. The security of this scheme will in be provided by the forced proximity intrinsic to the light-based communication, as well as by the use of secure cryptographic primitives. Consequently, this method provides inherent security against various types of attacks other technologies are vulnerable to.

Full text

Master’s Thesis Master in Telecommunications Engineering (MET) Secure Proximity-based Mobile-IoT Interaction June 2020 Author: Ibai Ros Iturgaiz Director: Prof. Dr. Ir. Bruno Crispo Supervisor: Prof. Dr. Ir. Jordi Casademont Serra Assistant: Ir. Mahmoud Ammar Universitat Politècnica de Catalunya Katholieke Universiteit Leuven Preface I would like to thank everybody who kept me busy the last year, especially my promoters and my assistant. I would also like to thank the jury for reading the text. Lastly, I would like to thank my family for the support over the last year, specially in these extraordinary times. 1 Abstract In a world where so many interconnected devices are used in our everyday life, security of those devices and their communications becomes a fundamental aspect to keep an eye on. Almost any feature possessed by a device can be exploited for an attack, potentially incurring in economic or moral damage. With that in mind, proximity between devices becomes a potential ally for providing that much-needed level of security. This is the case of, for example, credit cards and radio-frequency identification (RFID) systems, where proving proximity is key for the security of the scheme. In this area, the application of Visible Light Communication has been proved to be beneficial and even optimal, mostly due to its propagation characteristics. However, not many real-life examples have accomplished a successful implementation or have not made it into the market in a massive manner. This Master’s Thesis has the aim of developing a secure method, based on Visible Light Communication, for the interaction between smartphones and IoT devices in a bidirectional way. Moreover, a practical application of this method can be usingitasafirst-factorauthentication method, thus replacingthe vulnerableweak authentication mechanisms existing in smart homes and related environments. Therefore, a practical application of the method has been developed as a Proof of Concept. This application consists of a novel form of IoT device commissioning, making use of Visual Light Communication technologies. The security of this scheme will in be provided by the forced proximity intrinsic to the light-based communication, as well as by the use of secure cryptographic primitives. Consequently, this method provides inherent security against various types of attacks other technologies are vulnerable to. page 1 page 1 Contents 1 Introduction 8 1.1 ProblemStatement ............................ 8 1.2 Contribution................................ 9 1.3 Outline................................... 10 2 Related Work 12 2.1 Proximity.................................. 12 2.2 Mobilelocalization ............................ 13 2.3 Visible Light Communication . . . . . . . . . . . . . . . . . . . . . . 14 2.3.1 Light-based localization . . . . . . . . . . . . . . . . . . . . . 14 2.3.2 Light-based IoT device commissioning . . . . . . . . . . . . . 16 3 Background 19 3.1 Public Key Cryptography . . . . . . . . . . . . . . . . . . . . . . . . 19 3.1.1 Diffie-Hellman key exchange . . . . . . . . . . . . . . . . . . 21 3.1.2 Elliptic Curve Cryptography . . . . . . . . . . . . . . . . . . 22 3.2 Message Authentication Codes . . . . . . . . . . . . . . . . . . . . . 23 3.3 Galois/CounterMode .......................... 24 3.4 Cyclic Redundancy Check . . . . . . . . . . . . . . . . . . . . . . . . 25 3.5 Error Correcting Codes . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.5.1 Hamming(7,4) .......................... 26 4 Secure Proximity-based Mobile-IoT Interaction 29 4.1 Overview.................................. 29 4.2 Attackermodel .............................. 29 4.3 Commercial smart-light bulb attack . . . . . . . . . . . . . . . . . . 30 4.4 Challenges................................. 32 4.5 Design ................................... 33 4.5.1 Designchoices .......................... 33 4.5.2 VLC data packet structures . . . . . . . . . . . . . . . . . . . 36 4.5.3 Interaction between sender and receiver . . . . . . . . . . . . 37 4.5.4 Commissioning scheme . . . . . . . . . . . . . . . . . . . . . 38 4.6 SecurityAnalysis ............................. 40 5 Implementation and evaluation 44 2 page 3 page 3 5.1 Implementation.............................. 44 5.1.1 Smartphone............................ 44 5.1.2 IoTdevice ............................. 45 5.1.3 Software.............................. 45 5.1.4 Cryptographic primitives . . . . . . . . . . . . . . . . . . . . 47 5.2 Evaluation ................................. 48 5.2.1 Overhead ............................. 48 5.2.2 Power Consumption . . . . . . . . . . . . . . . . . . . . . . . 50 5.2.3 Performance............................ 50 5.2.4 Constraints to the transmission accuracy . . . . . . . . . . . 52 5.2.5 Discussion............................. 54 6 Conclusions and future work 57 Acknowledgements............................... 60 page 4 page 4 List of Figures 1 Symmetric encryption example . . . . . . . . . . . . . . . . . . . . . 20 2 Public Key encryption example . . . . . . . . . . . . . . . . . . . . . 20 3 Public Key signature example . . . . . . . . . . . . . . . . . . . . . . 21 4 Diffie-Hellman key exchange . . . . . . . . . . . . . . . . . . . . . . 22 5 Hamming(7,4) matrices . . . . . . . . . . . . . . . . . . . . . . . . . 27 6 CRCVLCdatapacket........................... 36 7 Hamming(7,4) VLC data packet . . . . . . . . . . . . . . . . . . . . 37 8 VLCsenderalgorithm .......................... 38 9 VLCreceiveralgorithm.......................... 38 10 Cloud-based commissioning scheme . . . . . . . . . . . . . . . . . . 39 11 Local commissioning scheme . . . . . . . . . . . . . . . . . . . . . . 40 12 Experimental IoT schematic . . . . . . . . . . . . . . . . . . . . . . . 45 13 Experimental IoT setup . . . . . . . . . . . . . . . . . . . . . . . . . . 45 14 TestingAndroidapp ........................... 47 15 Implementation Android app . . . . . . . . . . . . . . . . . . . . . . 47 16 IoT-Phone: Distance, Samples/bit & bitrate vs accuracy . . . . . . . 51 17 Phone-IoT: Distance, Samples/bit & bitrate vs accuracy . . . . . . . 51 18 IoT-Phone: Transmission rate vs accuracy . . . . . . . . . . . . . . . 52 19 Phone-IoT: Transmission rate vs accuracy . . . . . . . . . . . . . . . 52 20 IoT-Phone: Distance & Samples/bit vs accuracy . . . . . . . . . . . . 53 21 Phone-IoT: Distance & Samples/bit vs accuracy . . . . . . . . . . . . 53 22 IoT-Phone: Luminosity vs accuracy . . . . . . . . . . . . . . . . . . . 54 23 Phone-IoT: Luminosity vs accuracy . . . . . . . . . . . . . . . . . . . 54 5 Chapter 2 Related Work 2.1 Proximity One of the most difficult features to accomplish in computer security is providing with a proof of proximity. That is, when a device, the prover, needs to convince another device, the verifier, that they are sufficiently close from one another, whatever the distance between them may be. We live in a world where a rapidly growing and diverse number of applications rely on proximity mechanisms for their correct functioning: contact-less credit cards, passive key-less entry systems (used to lock, unlock or start a car depending depending on the distance the key is at) or RFID (using cards for security clearance) are just some of the manifold applications. However, most of these applications can be susceptible to attacks. As explained in [7], relay attacks are one of the most commonly known, where a proxy device is used by an attacker in order to relay the communication between two legitimate entities. This attack does not require any knowledge of the contents of the transmitted data, what makes independent of any cryptography involved in the communication. As a consequence, it would without doubt fool both of the involved legitimate parties into thinking they are in close vicinity. This would mean that, for example, a credit card could be used without the owner’s permission, or that one could start a car even if the key is far from it, as shown in [8]. The above mentioned attack is commonly known as the mafia fraud [9]. One variant of the mafia fraud is the terrorist fraud, where the prover colludes with the attacker in order to deceive the verifier [10]. Some of the most common ways to prove proximity are based on the received signal strength (RSS), received signal phase or time of flight (ToF) [7]. However, all ofthosearesusceptible toattacks. Forexample, many commercialsolutionscanbe bypassed by simply amplifying and relaying the signal between two parties [7]. Other studies have also shown relay attacks on systems relying on the received 12 page 13 page 13 signal phase. These attacks can be performed by leveraging a system’s maximum measurable distance property, resulting in a 50 meter reduction on the effective distance between the legitimate parties [11]. Research over detecting these relay attacks was done in the context of mobile payments, where it was shown that using infrared sensors in both the prover and the verifier showed higher success rate on preventing these attacks than any other existing work [12]. Notwithstanding the success in the detection, smartphones equipped with an IR sensor are a minority, what turns their commercial implementation into a rather challenging task. Although Distance Bounding focuses mostly on proving vicinity, there are some applications where proving that two parties are further than a given distance is needed. As the other methods are susceptible to distance shortening attacks, this method is susceptible to distance enlargement attacks [13]. Some solutions based on Ultra Wideband (UWB) have been shown to be very effective for distance bounding [13,14]. However, UWB is not a widely implemented technology amongst IoT devices or the smartphone market (to date, only the iPhone 11 has UWB capabilities [15]), which makes it difficult to develop a marketable commercial solution. Distance bounding protocols have been evolving since Brands and Chaum proposed the first in 1993 [16], and have evolved in various forms, as we can explore in [17]. All in all, it is shown that all of the discussed protocols are vulnerable to attacks to some extent, what turns the need for addressing provable security of distance bounding into a challenge for future researchers [17]. 2.2 Mobile localization Existing mobile localization and positioning techniques are very diverse, taking into account the different approaches taken and the hardware capabilities used to that end. Some approaches like MoVIPS (Mobile Visual Indoor Positioning System) [18] use the smartphone camera, where they combine an image recognition system along with a distance estimation algorithm. The system claims to offer high-quality positioning services, but the results show that the localization error is in the order of meters. This approach also introduces a considerable amount of overhead, as a pre-collected image database along with other environment information is necessary for the localization. Other approaches like [19] rely on a combination of Virtual Reality (VR) with Augmented Reality (AR) elements for the localization and navigation through an indoor space, achieving highly accurate localization with AR and detailed navigation instructions with VR. Similarly, iMoon [20] is an indoor navigation system that uses the smartphone camera and depends on crowdsorced images. The navigation system is based on 3D models of indoor environments built from crowdsorced 2D photos which, upon localization, provides visual navigation instructions for the user. Using partitions of the 3D models based on the density of 3D points and selecting the partitions for page 14 page 14 image-based localization from WiFi fingerprints, iMoon reduces response delay whilst maintaining localization sharpness. According to the results, localization of a user is performed in less than 4 seconds on average, with an error of less than 2 meters in a building of 1100 square meters. Smartphonelocalizationhasalsobeenusedasasecond-factorauthentication(2FA) method for electronic payments, where the GPS of the device is used for verifying the location where the payment is being performed [21]. The authors claim that the deployment within existing and available platforms could be done with just a small number of software changes and without altering user experience. Nonetheless, the system relies on the smartphone’s GPS sensors which, on paper, can be exploited. Other studies have also used a smartphone’s lightweight sensors for indoor-outdoor detection, using semi-supervised machine learning [22]. Both its energy use and computational costs are said to be lightweight and it has been shown that the system outperforms GPS. All in all, the system is only valid for indoor-outdoor detection, what makes it not suitable for accurate mobile localization. Lastly, and even though HyperSight [23] is not a mobile localization system, it is noticeable that using Commercial-Off-The-Shelf (COTS) smartphones with dual cameras, they can estimate the depth information of objects with a mean depth error of just 6cm at 5 meters of distance. This is accomplished by having the user move the phone in the air and continuously track and estimate the smartphone’s movement using the short-baseline dual-camera. 2.3 Visible Light Communication VisibleLightCommunication(VLC)isanupandcomingtechnologythatpromises to revolutionise the future of wireless communications by modulating the visible light spectrum (400-800 THz) used for illumination [24]. Theoretical and experimental research has envisaged the potential of VLC for serving high-speed data communication along with improved energy efficiency and communication security. 2.3.1 Light-based localization The early attempts to employ the visible light technology in indoor localization can be seen on [25], where interior ambient LED lighting is used for sending data tomobilephonesby either camerasorlightsensors. Theyclaimedademodulation approach that allowed smartphones to detect frequencies up to 8 kHz and receive data about localization landmarks. The localization was performed by discerning which light source had the highest Received Signal Strength (RSS), which meant it was the closest one to the smartphone. In Epsilon [26], they adopted Binary Frequency Shift Keying (BFSK) and channel hopping in order to facilitate location beaconing from various optical sources sharing the same medium to light-sensible page 15 page 15 devices like smartphones. However, as well as with [27], Epsilon would need to receive data from at least 3 locations in order to be able to accurately localize the light sensor. Moreover, Epsilon falls short on considering the reflection coming from the LED lamps’ back plates in their signal strength propagation model as well as the quixotic assumption that light attenuation is equivalent in all directions. All in all, Epsilon’s 90th percentile accuracy is 1.1 meters in the worst-case scenario and 0.4 meters for the best-case scenario. Luxapose [28] explores the possibility of using LED lights modified for allowing swift on-off keying transmission. They process the smartphone camera’s Angle of Arrival(AoA)byusing optimizationtechniquesinaback-end serverwith anopen RF channel with the smartphone. Spotlight [29] is a light-based localization system for Wireless Sensor Networks (WSN). It leverages the spatio-temporal properties of events (on-off light patterns) to obtain the location of the sensor nodes. Despite having achieved a 20cm localization error in a 2500 square meter area, the system is limited by its speed (takes up to 10 minutes for a localization to converge) and its 2D nature. A similar approach was taken in SpinLight [30], where both 2D and 3D localization is tackled by using infrared (IR) LED lamps as transmitters and light sensors as receivers. This is achieved by dividing the space into spatial beams originating from the source, each of which is identified by a unique light sequence. The light sequence is created by a coded shade that covers or uncovers the LED light beam depending on the pattern, which creates an on-off light pattern that is later detected by the receiver, who will refine the location by making use of optimization techniques. SpinLight claims a median location error of 3.8cm with a 95th percentile of 6.8cm. SpinLight’s main drawback is that they can only achieve 3D localization with multiple senders at orthogonal locations. Other localization systems like SmartLight [31] propose a digital 3D indoor localization by using existing LED lighting infrastructures. The fundamental idea of the design is shifting the system’s complexity into the modification of a LED lamp, what will keep minimum complexity at the receiver, which will however need to be equipped with a set of photodiodes. With that, SmartLight exploits the light splitting properties of convex lens with the objective of creating one-to- one mappings between the receiver’s location and the set of orthogonal signals received by it. In order to make the system scalable for big spaces, frequency reuse is proposed, along with parallel localization of multiple sensors. SmartLight accomplishes an average localization of around 10cm and a 90th percentile error of 50cm with an experimental prototype involving a 60Hz projector. Despite the effort to remove complexity from the receiver, SmartLight still needs quite complex hardware, what could make it burdensome for its implementation. Apart from the systems that only use light for localization, there are also some hybrid systems that use light and other technologies in order to achieve better accuracy. For example, the work in [32] combined a LED fingerprinting system and an improved Bluetooth-based spring model. If the fingerprinting approach did not work, the spring model would step in and provide a coarse estimate of the page 16 page 16 location. The results show 6cm accuracy with 5cm grid size of the used fingerprint map. Not much research has been done in the combination of LED positioning with RF signals. Alternatively, a big number of hybrid localization systems use Inertial Measurement Unit (IMU) sensors like the accelerometer [33] and the pedestrian dead reckoning (PDR) [34,35,36]. Research on hybrid systems involving PDR have been particularly prominent in the latest years, mostly due to the fact that PDR can provide very accurate short-term tracking which, combined with LED localization, can form quite potent localization systems. 2.3.2 Light-based IoT device commissioning Despite all the research that has been done in light-based localization, not much exploration has been done on using VLC for establishing a secure communication channel between IoT devices and smartphones. The current state of the art in commercial IoT devices shows that many vulnerabilities can be exploited in order to gain unauthorized access to the devices. For example, a vulnerability from Philips smart light bulbs enabled attackers to install malware on the light bulbs, potentially infecting the whole network [37]. Another example is the one where attackers could obtain the WiFi credentials of a private network by accessing the memory of LIFX smart bulbs [38]. Many of the aforementioned vulnerabilities are exploited in the pairing phase of the communication of the IoT device and the smartphone. Due to the lack of standardization in secure device pairing, [39] created a new system model and terminology in order for all the available scheme to be comparable. The three fundamental components of the system model are: physical channels, human-computer interaction (HCI) channels and application classes. The survey mentions the fact thatVLC haveimproved security propertieswithregard toconfidentialityofphysical mediums. Light-based authentication is also mentioned in [40], where using VLC for proximity-based authentication is proposed, due to its energy-efficient nature and its limited propagation pattern. It mentions the most prominent forms of attacks that can be performed in VLC applications as jamming and shielding, which ranges from natural sources as dust to intentional shielding like placing tape in a sensor. Although our intention is to use the VLC commissioning protocol for first-factor authentication, using light as a second-factor authentication mechanism has already been explored. Pixie [41], where a smartphone camera is used as a secondfactor authentication mechanism, establishes trust on both the knowledge and the possession of an arbitrary physical object, called trinket. Thus, the user only has to take a picture of the trinket when authentication is needed. The results show a false accept rate of less than 0.09% in a brute-force attack with 14.3 million of authentication attempts. Lastly, VLC communications are applied as a first-factor authentication mechanism in [42], where a smartphone screen is used as a modulated light source page 17 page 17 along with a photodetector in an IoT device, so that a one-way VLC channel is established. The BlinkComm [42] differential coding technique is introduced in the paper, which according to the results, reaches 100bps, outperforming other encoding schemes such the Manchester encoding technique. page 18 page 18 Chapter 3 Background 3.1 Public Key Cryptography As stated in the introduction, in order to achieve both a reasonable level of security and a user-friendly experience for our application, strong yet lightweight cryptography is needed. Cryptography provides us with the tools that are behind most security protocols, yet it is notably hard to get right. In order to define Public Key Cryptography, also referred to as asymmetric key cryptography, we first need to describe symmetric key cryptography. On the one hand, symmetric key cryptography refers to systems where the same cryptographic key is used along with the underlying algorithm by the sender and recipient, that is, both communicating parties possess the same key and must keep it secret. The aforementioned key must have been exchanged between both parties in a secure manner before the system is used. An illustration of symmetric encryption can be found in Figure 1. On the other hand, asymmetric key cryptography refers to systems where each party generates a key pair comprised by a public key, which can be shared with anyone, and a private key, which needs to be kept secret. The most popular uses for Public Key Cryptography are public key encryption and digital signatures. Public key encryption is based on encrypting a message with the recipient’s public key which, as we stated above, can be known by anyone. Only the recipient, who is supposed to be the only party in possesion of the matching private key, can decrypt the message with it. This type of cryptography is used with the purpose of establishing confidentiality. A simple example can be seen in Figure 2. Digital signatures are used for verifying the source of a message. With that purpose, the sender signs the message with its private key and it can be verified by anyone in possession of the sender’s public key. Digital signatures also provide proof that the original message has not been tampered with, as the verification would fail if any change was performed to the message. The simple 19 page 20 page 20 Figure 1: Symmetric encryption example Figure 2: Public Key encryption example application of Digital Signatures can be seen in Figure 3. One of the biggest concerns about Public Key Cryptography is obtaining proof that a public key belongs to the entity that the key claims and that it has not been tampered with by a malicious third party. The most used system for verifying the authenticity of those keys is a Public Key Infrastructure (PKI). In a PKI, a number of third parties certify ownership of key pairs. These third parties are often referred to as Certificate Authorities (CA). Certificate Authorities range from commercial organizations to government bodies. Usually, web browsers like Mozilla Firefox [43] or Google Chrome [44] include a list of trusted certificates by default. Firefox and Chrome include over 180 certificates, whist mobile operating systems like Android include more than 130 trusted certificates [45]. This entails a potential security problem, since the system relies on trusting the Certificate Authority blindly and that trust could be violated. For example, in 2015 Symantec was caught issuing certificates without authorization [46]. Another approach for verifying the authenticity of public keys are the so-called webs of trust, which relies on decentralizing authentication via individually endorsing the link between an page 21 page 21 Figure 3: Public Key signature example entity and a public key. The systems that use this approach include Pretty Good Privacy (PGP) and Domain Name System (DNS). 3.1.1 Diffie-Hellman key exchange Diffie-Hellman (DH) key exchange [47] is a method that allows two parties with no prior knowledge of each other to jointly agree on a shared secret over an insecure channel. The basic procedure of the Diffie-Hellman key exchange for two parties, Alice and Bob, and which can be seen illustrated in Figure 4, works in the following way: 1. Before initiating the exchange, both the parties know a public system parameter α. 2. Both the parties generate a random number, xand y, calculate αxand αy, respectively, and send it to the other party. 3. Both parties perform the same operation on the received value in order to obtain the common shared key. That is, Alice and Bob compute the common shared key with k= (αy)xand k= (αx)y, respectively. It is worth mentioning that a malicious third party would not be able to obtain the key by observing the channel. This is because the exchange method relies on the Discrete Logarithm Problem, that is, the fact that it is very hard to obtain xfrom αx. However, Diffie-Hellman isnot usedfor this purpose, as RSA(Rivest–Shamir–Adleman) [48], which is based on almost the same principle, is the leading public key algorithm. page 28 page 28 Chapter 4 Secure Proximity-based Mobile-IoT Interaction 4.1 Overview After having explored some of the security vulnerabilities found in existing technologies such as Radio Frequency (RF) communications, this paper will present a security protocol for secure interaction between smartphones and embedded devices. This protocol is based on the use of Visible Light Communication and therefore, the forced proximity needed in this technology will imply a high level of security against various types of attacks. Moreover, the proposed protocol makes use of CRC codes in order to provide integrity for the exchanged data. A new secure IoT device commissioning scheme that makes use of the aforementioned protocol will also be presented. Through this scheme, any device will be able to be initialized by a smartphone in a secure way. In the next sections, the design for the mentioned protocol and scheme will be thoroughly explained. In section 4.2, the attacker model used for this design will be defined. Afterward, we will detail an attack we performed in a commercial IoT device which uses RF communications in section 4.3. In section 4.4, we will disclose the challenges we faced in the design of the proposed communications protocol and scheme and the actions we took for overcoming them. Next, we will comprehensively describe the design in section 4.5. Lastly, we will perform a security analysis of such design in section 4.6. 4.2 Attacker model Given that the main goal of the commissioning scheme is to offer a high level of security, it is critical to know beforehand the capabilities of the adversaries and which attacks we need to protect against. Consequently, this section will outline 29 page 30 page 30 the attacker model, which will show the assumed attacker types and their capacity. The first and primary type of attacker involves a party that is in vicinity of the legitimate ones. This attacker’s objectives range from the compromise of sensitive information, such as the network’s security credentials, to distance modification attacks, that is, when a party tries to convince another party that it is closer or further than the real distance between them. In this context, as our objective is providing security through proximity, we will focus on distance shortening attacks. These attacks can diverge in different branches, but we will focus on relay attacks, also known as mafia attacks, that is, when an attacker relays messages between two legitimate parties so that they think they are closer to each other than in reality. As explained in section 2.1, another variant of this attack is the terrorist attack. The possible consequences of a successful attack on the proximity mechanisms could for example be that an illegitimate third party is able to gain unauthorized access to the IoT device or even to the wireless network. The second attacker type is the one that is Internet-based, also called external attacker. This attacker will try to obtain information and leverage it in order to, for example, obtain privileged access to the IoT device. This attacker can be passive or active. The first one will only be capable of capturing messages between the IoT device or the smartphone and the Internet. Given weak security measures like transmitting messages in plaintext or using weak encryption, which can be broken by means of brute force or known vulnerabilities, the passive attacker might be able to recover the content of the messages, which could result in an unauthorized access to information. Dissimilarly, the active attacker is the one that, for example, tries to alter the contents of the messages and forward them to the legitimate destination or tries to prevent certain messages from reaching it. Its objective is to introduce illegitimate information in one or various of the involved parties. As happened with the majority of the related work that we analyzed, we will rule out all kinds of physical attacks. Furthermore, denial-of-service (DoS) attacks are out of the scope of this thesis. Additionally, we assume that our code is bug and exploit free and is deployed in the involved devices by a trusted party. Likewise, we also assume that the applications will be running in the Trusted Execution Environments of the running devices, which means that the cryptographic keys are securely stored and thus irretrievable by the attacker. 4.3 Commercial smart-light bulb attack In order to illustrate how vulnerable commercial smart-light bulbs and IoT devices in general are, we purchased a WiFi-based bulb manufactured by Tuya [83] and performed an attack on it. Tuya is a big cloud provider which offers hosting and manufactures millions of devices. This particular smart bulb uses an ESP8285 System on Chip, which includes a WiFi radio, a Tensilica L106 32-bit micro-controller page 31 page 31 unit (MCU) and a 1MB Flash memory unit. Our bulb operates in a cloud-based manner, that is, we will need to communicate with the cloud in order to interact with the bulb. In our case, this interaction with the cloud is performed by a companion app that makes use of an open API [84]. When a smart bulb is registered on the companion app, we will be able to control the former through the latter. Thus, in order for the scenario to be functional, the bulb needs to be connected to the Internet through its WiFi interface. In order to connect the smart bulb to the WiFi network, the bulb should be in the smartconfig mode of operation, where it will listen for incoming packets on a predetermined port, which is the 6669 in this scenario. As the communication between the companion app and the smart bulb is cloud-based, the app will start by asking the cloud for a token and a secret key. Upon the receival of these, the app will send a UDP packet to the previously specified port. The packet contains the received token (which is only valid for a small number of minutes), the received secret key (which will act as local key for the smart bulb), the credentials of the WiFi network (comprised of its SSID and password), and a CRC code for checking the integrity of the packet on the receiver side. Once the smart bulb receives this packet and validates its integrity through the CRC code, it will extract the necessary information and connect to the WiFi network, through which the bulb will be registered in the Tuya cloud. The Tuya cloud will then verify the received token and register the bulb to the list of devices controllable by the companion app. Henceforth, the app and the smart bulb will be able to communicate securely through the cloud and by encrypting messages with the shared secret key. Undoubtedly, the used protocol has a number of security flaws. We were able to retrieve the secret key, smart device ID and other sensitive data without performing any physical attack by solely setting another device in the range of transmission of the smartphone with the app and passively eavesdropping on the communication. This procedure for reading the packets is also referred to as a passive man-in-the-middle attack. Other approaches involving the compromise of the companion app have already been reported to let the attacker to upload its own firmware to the lamp [85]. As previously stated, all Tuya devices can be interacted with by means of an open API [84]. Once in the possession of sensitive credentials such as the device ID and its secret key, an attacker could for instance be able to communicate secretly with the smart bulb and potentially destroy its flash memory, as illustrated in [86]. Furthermore, the leak of other highly sensitive data like the password for the used WiFi network can lead to countless attacks on any device connected to the network. To this purpose, we have proposed a different protocol and scheme that will solve the security vulnerabilities found in this system. page 32 page 32 4.4 Challenges In the path of designing a protocol and a scheme that would serve our purpose, a considerableamountofdifficultiesandroadblockshave been encountered. Throughout this section, will explain the most prominent ones and how we have decided to act in order to overcome them. The first hardship we faced was the lack of rigorous standardization for Visible Light Communication applications. There only exists one standard involving VLC, IEEE 802.15.7 [87]. However, such standard does not apply for communications involving cameras, for example. Consequently, the information available in thatstandard did notreally applytothe communication we were trying toachieve. This is probably due to the fact that VLC is not yet a mature enough technology. That being said, the approach taken in our case was to first theoretically evaluate the most suitable candidates for each aspect of the communication (integrity, error correction, encryption, etc.) and then use the trial-and-error method to show which were the ones that offered the best results. For example, we evaluated the use of Hamming(7,4) codes in order to provide error detection and correction in our transmissions by implementing the technique in our communications protocol. In this particular case and as we will show in chapter 5, we discarded using Hamming codes due to the fact that the incurred overhead was bigger than the increase in the maximum bitrate obtained by reducing the errors. In other cases, we based our choices on theoretical data and assumptions about other mature technologies. This is the case of the approach used for providing data integrity. After evaluating the effectiveness of using CRC codes, we decided to use CRC32 owing to the fact that a mature technology like Ethernet uses it. The currently available tools for implementing it conveniently also played a major role in its choosing. Lastly, other decisions were based on the assumptions for our needs and the effectiveness of the solution. This is the case of the decision to use Galois/Counter Mode for encrypting and authenticating our data. The main reasons to choose this mode of operation were that it would provide both encryption and message authentication in a quite resource-constrained operation. Anothertroublesomeissuewe encounteredwastomaintainsynchronizationamongst our devices when they were communicating. Due to the lack of a common clock through which the parties could agree on, we decided to design a protocol in which no common clock was needed, as we will explain in section 4.5. Nonetheless, the approach taken assumes that the clocks on the devices advance at the same time, that is, whatever the time offset there may be between both parties, we assume that both the clocks function correctly. Lastly, the heterogeneity of devices was one of the most challenging obstacles that we have encountered. This involves both the IoT and smartphone parties. In the case of the first one, we worked with the fact that different embedded devices have differentcomputing capacities, whichmeantthatforexample, the timetogenerate a key pair or process a bit would be different depending on the computing power page 33 page 33 of a specific device. What that implies is that we either adapted our approach to each embedded device’s capabilities or engineered a common solution that would work on all devices, assuming some minimum requirements. This last one is the approach we took in the case of the embedded devices. Regarding smartphones, we also assumed that different smartphones would have different computing capabilities and camera quality. Once more, we were faced with the same predicament, and chose the same solution. The reason for the aforementioned choices is that the complexity that the process of agreeing in common communication parameters, such as the transmission rate, would incur, would be higher than the possible increase in the performance. 4.5 Design In the description of the design, we will first explain certain design choices we made and the reasons for doing so. Afterward, we will comment on the VLC data packet structures that we used in our design implementation. Following that, we will explain the interaction between the sender and receiver of a VLC data transmission. Lastly, we will present the proposed IoT device commissioning scheme for both cloud-based and local approaches. 4.5.1 Design choices Error Correcting Codes vs Error Detecting Codes When deciding between which technique we should use for our design, both ErrorCorrectingCodes (ECC),suchasthe Hamming(7,4)code, andErrorDetection Codes, such as the CRC32 code mentioned in section 3.4, were taken into consideration. As explained in subsection 3.5.1, the ECCs do not perform well in situations or channels where burst errors are relatively common. As we were unsure about the nature of Visible Light Communication channels, we decided to implement the Hamming(7,4) encoding and apply it to a data packet in its entirety before being sent. The results showed a slightly more robust connection, as it can be seen in chapter 5. We also tested that stronger channels can support higher bitrates. However, such increase in channel reliability did not affect in a way that the bitrate could be increased dramatically. As we know that using the Hamming(7,4) code incurs in a 75% (7/4) of overhead, we did not deem appropriate applying the code for increasing the effective bitrate. As for providing integrity to the communication, we decided that once applying Hamming codes was not convenient, the CRC32 code was the most fitting technique for serving that purpose. As mentioned in section 3.4, mature technologies as Ethernet make use of CRC32, what, added to the range of libraries and resources available for implementing it in our tests, made us opt for it in order to provide integrity to our communications. Furthermore, the small amount of page 34 page 34 overhead that CRC32 incurs (4 bytes) helped with the choice. On-Off Keying vs Averaging technique Inside the light-based communication that we used, we considered two different ways of detecting if a bit was set at the receiver side. The main logic behind the detection is equivalent in the IoT device and the smartphone. The main difference is that the smartphone processes a camera frame, crops a predetermined region (inordertobeabletopointtothe light source) and extractsthe luminosity valuein it, whereas the IoT device simply parses the luminosity value from a photoresistor. Both of the parties have a setup phase in which they record the luminosity value before starting the reception, so that they have a reference value of what a logical 0is. Afterward, whenever a luminosity value needs to be evaluated, it will be compared with the initial value and if their ratio is bigger than a given threshold α, the bit will be considered to be a logical 1. It is also worth mentioning that α is chosen from a predefined table depending on the recorded initial luminosity value. This is due to the fact that luminosity changes in a bright environment are more complicated to detect than in dark environments. Bit_is_set =Luminosity_value Initial_luminosity > α However, we did not deem appropriate to only use one sample in order to determine if a bit was set, so we decided to record various luminosity samples before evaluating a given bit. That way, the detection is more robust and trustworthy. This is where the two methods we decided to compare diverge. The first method is on-off keying (OOK), which is based on evaluating the samples independently and deciding based on a majority. In order be able to obtain such majority, the sample size needs to be an odd number. The second method, which we called the averaging method, is based on calculating the average luminosity value of the samples and evaluate that single value against the initial luminosity. Let x1, .., xnbe the collected luminosity samples. The two evaluation functions can be expressed in the following way: Bit_is_set_averaging =Bit_is_set(1 n n P i=1 xi) Bit_is_set_ook = n P i=1 Bit_is_set(xi)> n P i=1 Bit_is_set(xi) After having evaluated both methods by their accuracy in chapter 5, we decided that the most accurate method was the On-Off Keying technique. More specifically, we evaluated different sample sizes for the chosen technique in order to calculate the right one. Our results, which can also be seen in chapter 5, show that 3 samples per bit, the minimum number with which majorities can be obtained, was the ideal choice. Moreover, the theoretically maximum attainable bitrate with a lossless channel can be calculated with the following formula: page 35 page 35 Max_bitrate(bps) = Min(camera_frame_rate(fps),1 frame_processing_time(s)) samples_per_bit Where frame_processing_time refers to the upper bound on the time the receiver device takes to process a given frame, whatever the stage of the communication is. As we will show in chapter 5, the practical value for the bitrate obtained in our implementation is lower than that reference. However the comparison between the chosen techniques may have gone, we are aware that if combined with Pulse Width Modulation (PWM) techniques, the onoff keying technique can achieve significantly higher bitrates, as shown in [88]. We leave its implementation in our protocol as a possible future upgrade that will not be tackled in this thesis. Cryptographic primitives As we are explaining the design choices we made for our protocol and scheme, we need to mention the reasons for choosing the cryptographic primitives that are used in various steps of our IoT device commissioning scheme. Although the steps themselves will be explained in upcoming subsections, the choices can be explained here. If we take into account that our scheme involves that both parties need to have a key pair, we needed to choose a cryptographic primitive that would provide that feature. Thus, we chose Elliptic Curve Cryptography for those key pairs, mostly duetothefactthatellipticcurvekeystakemuchlessspacewhilstofferingthe same security level compared to other public key primitives, as we can see in Table 1. In particular, we chose to use 256-bit-long keys from the secp256r1 elliptic curve. At some point in our commissioning scheme, we need to combine both our key pairs in order to generate a common secret. Elliptic Curve Diffie Hellman (ECDH) will be the key agreement scheme used in this case. The decision is based on the fact that we are already using Elliptic Curve Cryptography for our keys, apart from the benefits of using a key agreement scheme that is based in Diffie-Hellman. Lastly, at some point in our communication, we will need to encrypt and authenticate our data. We chose the Galois/Counter Mode block cipher on the grounds that it offers both the features with a single pass of the data through the cipher, what results in an increase in speed. Lastly, we decided to use AES (Advanced Encryption Standard) as the cryptographic primitive for the symmetric key derived from the aforementioned ECDH key agreement. This election was made due to its inherent strong security and to the great support that the combination AES-GCM had in order to build the solution at hand. page 36 page 36 Figure 6: CRC VLC data packet Rolling shutter vs global shutter When designing a communications protocol that would employ the camera for detecting binary data, we faced the decision of whether to use the rolling shutter or the global shutter mode in our camera. These modes describe two distinct ways through which we can read or capture an image from a CMOS sensor. In the rolling shutter mode, the sensor reads the image as a wave: the horizontal lines of the image array are captured in increasing order and times. Contrarily, in the global shutter mode each pixel is exposed at the same time, achieving homogeneous capture times throughout the frame. Previous research that shows that the rolling shutter effect can be leveraged for transmitting multiple bits in a single frame [28], which can potentially result in a dramatic increase in the bitrate obtained in the communication. However, this technique requires low noise and the light source to be extremely close to the camera, so that the light source covers a large portion of the captured frame. We realized that real-life environments introduce a substantial amount of noise in the form of camera motion, dynamic focus adjustment and ambient light, which render the application of this technique unfeasible. Knowing that we could not leverage the rolling shutter effect for achieving higher bitrates, we decided to employ the global shutter mode, that is, only extracting one bit from each frame. 4.5.2 VLC data packet structures As mentioned in subsection 4.5.1, both the use of CRC and Hamming(7,4) codes were taken into consideration. That is why two different data packet structures were needed. Broadly, the packet used for the implementation of the latter was the one used for the former encoded with Hamming(7,4). Therefore, every 4 bits of the original packet were spread to 7 bits at the output of the encoder. As a consequence, the length of the fields of the Hamming(7,4) data packet are expressed in bits whereas the length of the CRC VLC packet fields are expressed in bytes. Hence, both the packets have the same structure. Firstly, a 1-byte-long length field, which expresses the number of remaining bytes until the end of the packet. Afterward, the variable-length data field. Lastly, we have the CRC code used for verifying integrity of the packet. Thus, the length of the CRC VLC data packet can be up to 256 bytes long, while the Hamming(7,4) VLC data packet can reach 448 bytes. Both packet structures are illustrated in Figure 6 and Figure 7, respectively. page 37 page 37 Figure 7: Hamming(7,4) VLC data packet 4.5.3 Interaction between sender and receiver In order to describe our communications protocol, we will explain the interaction between the party that transmits the data and the one that receives such data. Our implementation of such protocol is based on state-based algorithms, which, apart from providing a clear view of the state of the transmission at any time, are a very efficient way to manage programs that do not execute in a sequential way, which is the case of our VLC receiver. As mentioned in previous subsections, the same logic is behind both the IoT device and smartphone for which we developed the protocol. The algorithm used for the VLC sender is a rather simple one. Since we do not use any feedback channel for the communication, the sender will act in a rather unilateral and sequential way. The algorithm will start in the INIT state, which will be used for initializing the variables needed for the transmission. When this job is done, the program will go to the TX_STARTING state, where it will transmit the start sequence, an 8-bit-long sequence full of logical 1’s, which will be used for notifying the receiver that the transmission is starting. After that, the program will advance to the TX_STARTED state. In it, the whole VLC data packet, which is explained in the previous subsection, will be transmitted in chunks of 1 byte. Once finished, the program will progress to the TX_ENDED state, in which it will notify the application about the end of the transmission. Lastly, the algorithm ends and progresses to the EXIT state. A representation of the described statebased algorithm can be seen in Figure 8. The logic behind the VLC receiver side is a more complicated one, as its execution is non-sequential. After the initialization performed in the INIT state, the algorithm advances to the LOADING state. In such state, the receiver will start collecting a fixed amount of luminosity values, which will be used for calculating the initial luminosity value once that number is reached (remember that such luminosity value is later used for detecting if a bit is set to 1 or 0). After that, the algorithm will progress to the WAITING state, where it will process bits until it detects a logical 1, meaning that it has started to receive some data. After that, the algorithm will advance to the TX_STARING state. In such state, the program will process bits until an 8-bit sequence has been processed. At that point, the receiver will compare the received sequence with the start sequence mentioned in the above paragraph. If the sequence matches, it means that the transmission has started and the algorithm will continue onto the TX_STARTED state. If not, the algorithm will return to the WAITING state to once more try and receive the initial sequence. Once the transmission has started, the receiver will first parse the sequence length, which is located in the first byte of the VLC data packet, and Chapter 5 Implementation and evaluation 5.1 Implementation In order to evaluate the feasibility and performance of our design, certain experiments needed to be performed. This section explains the experimental setup that was put in place for that. In order to do so, we will first describe the equipment we used in both the smartphone and the IoT side and its specifications. We will also illustrate the experimental setup we adopted. Lastly, we will explain the software we used for the design implementation. 5.1.1 Smartphone We used a Xiaomi Redmi Note 7 Pro [91] Android smartphone in our setup. The specs of the smartphone are the following: •Operating system: MIUI 11.0.8 (based on Android 10). •Chipset: Qualcomm SDM675 Snapdragon 675 (11 nm). •CPU: Octa-core (2x2.0 GHz Kryo 460 Gold & 6x1.7 GHz Kryo 460 Silver). •Main camera: 48 MP, f/1.8, Video 1080p@30/60/120fps. The main takeaway from these specs is that we used a mid-range smartphone and camera for the experiments, so that we did not have extremely high or low results and so these could be expandable to other devices. We leave learning about the Android Activity Lifecycle [92] to the discretion of the reader, as it could gain a better understanding of how an Android application works. Nonetheless, this knowledge is not considered to be fundamental in order to interpret our findings. 44 page 45 page 45 5.1.2 IoT device We used a Raspberry Pi 3 Model B [93] platform for mimicking the IoT party of the communication. Its specs are the following: •Operating system: Raspbian 10 (Buster). •CPU: Quad Core 1.2GHz Broadcom BCM2837 64bit CPU. We chose this platform due to its high support for software development as well as the flexibility its GPIO (General Purpose Input/Output) pins provided for the setup in the initial stages of our experiments. However, we are aware that almost the same functionality can be attained with more power-constrained devices such as the Arduino Uno Rev2 [94]. Nevertheless, we decided that as we did not have any energy constraints when testing the design, we could continue with the platform we already possessed and expand the results to similar devices. Aside from the aforementioned Raspberry Pi platform, we implemented a setup with a LED light for transmitting data and a RC circuit, containing a photoresistor and a capacitor, for receiving data. These components were at the same time connected to the above-mentioned GPIO pins. Such design schematic can be seen in Figure 12. Similarly, the actual setup used in our experiments can be viewed in Figure 13. Figure 12: Experimental IoT schematic Figure 13: Experimental IoT setup 5.1.3 Software In order to test the accuracy and feasibility of both our communications protocol and commissioning scheme, as well as for testing the different communication features we were studying, we implemented two different software setups in both parties. The setups were comprised of an Android application, some Python code to be run at the IoT device and a Firebase Realtime Database [95], a common database through which both parties could communicate if needed. page 46 page 46 Testing setup The first setup, also called the testing setup, was used for testing and evaluating the different communication features and parameters that would or would not be used in our final protocol. The look of the programmed Android application can be contemplated in Figure 14. As it can be seen, the user could modify the following fields: •A random string that would be encoded in UTF-8 and transmitted. •The bitrate and the number of samples per bit of the communication to test. •The distance between both parties, for logging purposes. •The direction of the communication, as the test was a one way communication. •Whether the data packet should be encoded with Hamming codes. •Whether the technique used for detecting bits in reception should be On-Off Keying or the Averaging technique mentioned in subsection 4.5.1. The application also showed the result and accuracy of such transmission. This accuracy was based on the Levenshtein Distance [96] between the binary value of the strings in the transmitted and received data. We decided to choose this metric due to the fact that it can detect bit shifts, so that the results were not misleading if a single bit was shifted, for example. Lastly, the application showed a view with the output of the main smartphone camera and a tool that lets the user to zoom the view. Inside it, we can also find a rectangle that we must to point to the target LED light when receiving data. Since it was very problematic to evaluate the state of the LED if we processed the whole frame, we decided to only process that small portion, which led to more accurate evaluation. The main logic in this software setup was carried out in the smartphone, which would notify the IoT device of the transmission parameters through the common database and log the results once finished. Implementation setup The second setup, also called the implementation setup, was developed for proving the feasibility of the cloud-based IoT device commissioning scheme we propose. Such scheme was tested successfully until the point where the IoT device connects to the WiFi network. The look of the Android application developed for this purpose can be contemplated in Figure 15. The application only has one input, the WiFi password, which cannot be obtained page 47 page 47 otherwise in modern Android versions. Apart from that, the application shows a camera view, which is equal to the previously mentioned. Figure 14: Testing Android app Figure 15: Implementation Android app 5.1.4 Cryptographic primitives In order to implement our design, we needed to make use of the cryptographic primitives we established in subsection 4.5.1. Though cryptography offers in theory resilience against numberless threats, it could not serve its purpose if not implemented correctly. In our implementation, we first generated an elliptic curve key pair at each side of the communication. As specified in the design, we chose the SECP256R1 elliptic curve, which provided us with 256-bit-long keys. Normally, when transmitting or storing such keys, it is done so by encoding them in a secure format, which usually extends their size in memory. However, we knew that as Elliptic Curve public keys can be represented by a point in a curve, which we could transmit and reconstruct at reception in order to obtain such public key. That way, the amount of information to transmit would be smaller. Con- page 48 page 48 sequently, we encoded the compressed version of such points in the ANSI X9.62 format, which resulted in a 33 byte data field we needed to transmit. Upon transmission and correct decoding of both parties’ public keys, both sides used the Elliptic Curve Diffie-Hellman key agreement protocol in order to generate a 128-bit-long AES key. That key would later be used by the Android party in order to encrypt sensitive information such as the credentials of the WiFi network to which the IoT device would connect. The above-mentioned sensitive data was encrypted using a GCM block cipher. Suchcipher’s inputs were: the encodedinformation, a randomly generated12 byte initialization vector and the AES key. At the output, we obtained the ciphertext along with its 16-byte-long authentication tag. Thus, the transmitted information would be composed by the initialization vector, the ciphertext and the authentication tag, in that order. Such information was encoded in Base64 prior to transmission in order to avoid encoding issues. Upon correct receival of such information, the IoT device would simply enter the aforementioned three fields to its GCM block cipher along with the common key, in order to decrypt and authenticate the information. 5.2 Evaluation In pursuance of obtaining valid and tangible results that can be interpreted with the objective of obtaining insight on the effectiveness of our approach, we needed to analyze various aspects of our implementation. First, we dove into the overhead incurred on the communication. Subsequently, we did a study on the power consumption of our implementation in order to analyze its feasibility. Following that, we evaluated the obtained performance. Later, we considered the different constraints that we encountered in order to implement the protocol correctly and the impact they have on the communication. Last, we discussed the results and their implications for a real-life implementation. 5.2.1 Overhead Communications overhead When evaluating the overhead incurred in our communications, we focused on the given overhead a data packet has comparing to the quantity of actual data it is carrying. In order to do so, we analyzed the data packets we described in subsection 4.5.2 and compared the original data length to the final length of the packet. As we did when testing Hamming codes with CRC codes, we considered both packet structures separately. Moreover, we interpreted such overhead depending on the initial data length, as the incurred overhead depends inversely proportionally on it. As stated above, we calculated the overhead in the following way: page 49 page 49 Overhead(%) = 100 ×(1 −original_data_length transmitted_packet_length ) The calculations for both packet structures can be found below: •TheCRC packet, illustratedin Figure 6, adds1 byte for stating the length and 4 bytes for the CRC code, making a total of 5 bytes. Below is the comparison of the overhead with different data lengths. –10 bytes (ACK message): 33.33% of overhead. –33 bytes (Compressed EC public key): 13.16% of overhead. –53 bytes (GCM encrypted WiFi credentials): 8.62% overhead. •The case for the Hamming(7,4) packet, illustrated in Figure 7, is different. It initially adds the same overhead bytes than the CRC packet, but its size is increased by a factor of 1.75 due to the redundancy of the Hamming(7,4) code. Thus, the comparison with different data lengths is below. –10 bytes (ACK message): 61.90% of overhead. –33 bytes (Compressed EC public key): 49.62% of overhead. –53 bytes (GCM encrypted WiFi credentials): 47.78% overhead. As it can be appreciated in the above results, the overhead introduced by the Hamming(7,4) packet structure is a big burden that, as we will show in the following subsections, was not outweighed by its strength. That is the main reason behind our decision to discard its implementation. About the overhead introduced by the CRC packet, we consider it very tolerable considering the functionality that it offers. Memory overhead The most resource-constrained device in this type of communication will always be the IoT side, so we needed to make sure that ours would fit in devices with smaller memory sizes. In our implementation, the set of Python scripts used for running the code use 24.2 KB in total. That size would perfectly fit in a 32 KB Flash memory of an Arduino board, for example. It is also worth mentioning that should the space requirements be more constrained, the code could be compressed even further. As for the smartphone side, the size of the Android APK that we obtained was 21 MB. Although modern smartphones do not usually have memory constraints at that level, it is worth noting that the Firebase SDK we used for the common database [95] occupies the largest part of such space. page 50 page 50 5.2.2 Power Consumption In order to analyze the power consumption derived from our scheme, we separated the calculation in two parties, IoT device and smartphone, and calculated the power consumed by each of them in the two roles we defined for the transmission, receiver and transmitter. Although the scheme was designed focusing on smart home applications, where the IoT devices are usually connected to the power grid, it is still useful to calculate the power that these devices would draw. The power consumed by the IoT device acting as a transmitter can be separated in two parts: the power to light up the transmitter LED and the power to run the code itself. Given a single LED, we measured its power consumption to be 10mA, and considering a duty cycle of 50% if transmitting logical 0s or 1s is equiprobable, we got an average power consumption of 5mA. The idle power consumption of the Raspberry Pi is 260mA, reaching up to 730mA with a full CPU load [97]. We measured the consumption for running our protocol to be negligible comparing to an idle state, so we used that first value for the calculations. As for the IoT device acting as a receiver, we measured the average power consumed by the photoresistor to be 10mA and the computational power to be approximately the same as for the transmitter role. Thus, the IoT device would consume 265mA in transmitter mode and 270mA in receiver mode. About the smartphone consumption, we quantified the computational cost of both the transmission modes to be negligible as running such code would not impact its normal power drainage in a noticeable manner. Hence, we only took into account the power consumed by using the camera and flashlight. In the transmission mode, we measured the LED flashlight consumption to be around 200mA when on, so for a 50% duty cycle, that number would be reduced to 100mA. As for the receiver mode, we calculated the power consumption of the camera to be around 350mA, according to previous studies [98]. Thus, the transmitter and receiver modes of the smartphone would consume 100mA and 350mA, respectively. 5.2.3 Performance In order to analyze the performance, we explained the tests we completed and the results we extracted in order to establish the transmission parameters for our protocol. We subsequently quantified the resulting speed of our protocol and the future possibilities for enhancing it. When trying to determine which was the maximum empirical bitrate we could obtain from our protocol, we performed different tests that varied the transmission parameters and scenarios so that we could discover where the limit was. Among those variables, we had: the number of samples, the bitrate, the luminosity conditions, the distance, the redundancy bits (Hamming vs CRC) and the method for detecting the bits (On-Off Keying vs Averaging technique). As mentioned in section 5.1, the tests extracted an accuracy value, which we consider to be the main page 51 page 51 reason for considering a communication to be feasible. All of the results from the tests can be seen in figs. 16 to 23. Considering we were using the on-off keying technique to detect bits, the transmission parameters that needed to be stated were the bitrate and the number of samples per bit, which as a recall, needs to be an odd number that is greater than 2. Intuitively, a higher number of samples per bit offers more redundancy, resulting in better accuracy, which allows communications between further distances. However, as the number of frames that can be processed in a given time is limited, increasing such redundancy will decrease the effective bitrate. In Figure 16 and Figure 16, we performed experiments with different combinations of samples per bit, bitrates and distances, reducing bitrate when adding redundancy. As it can be observed, we confirmed such theory: increasing redundancy allows communications from further distances at the cost of communication speed. Nevertheless, such trade-off does not favor us, as our objective is to force proximity and achieve higher bitrates. Hence, we chose the minimum number of samples per bit (3) for our communication. Figure 16: IoT-Phone: Distance, Samples/bit & bitrate vs accuracy Figure 17: Phone-IoT: Distance, Samples/bit & bitrate vs accuracy Having defined the first parameter, we were left with finding which was the maximum bitrate we could get. In Figure 18 and Figure 19, we performed various tests varying the bitrate while fixing the number of samples per bit to 3 and maintaining a distance of 30 cm between the parties. It is also worth mentioning that we performed the tests with our two previously discussed bit detection techniques and with different error detection and correction techniques. As the takeaway in terms of maximum feasible bitrate, the results showed that 5bps and 4bps, for the IoT-Smartphone and Smartphone-IoT links, respectively, were the maximum rates at which we could preserve perfect accuracy if we used the CRC packet encoding. We also confirmed that using Hamming codes did not offer enough increase in the accuracy so that its overhead would not be a burden. Lastly, it should be pointed out that although the IoT device does not need to make as many calculations as the smartphone in order to parse a luminosity value, its bit-detection capability is also more limited. As a result, the maximum feasible bitrate of the smartphone is better than the IoT device’s. page 52 page 52 Figure 18: IoT-Phone: Transmission rate vs accuracy Figure 19: Phone-IoT: Transmission rate vs accuracy Runtime We calculated the runtime of our scheme based on the packet sizes and the speed of the communication. As we explained, our implementation was comprised of three packet transmissions: the transmission of both the public keys andthe transmission of the encrypted and encoded WiFi credentials. Thus, taking into account the packet structures in subsection 4.5.2 and that the transmitted key data was 33 bytes long, the size of both the first and second packet was 38 bytes. For the third packet, if we took a 16-byte-long sequence for the credentials, we would get a 44 byte-long sequence after encryption and 59 bytes after Base64 encoding. Thus, the packet size of the third packet in our case was 64 bytes. With those packet lengths, and assuming no delay between communications, we get a transmission time of 60.8 and 76 seconds for the first two packets and 128 seconds for the last transmission, which gives us a total runtime of 264.8 seconds if we used the above stated bitrates. We are aware that this number is particularly high, but we are confident that future versions of the protocol can lower it by even an order of magnitude, greatly contributing to the usability of our scheme. 5.2.4 Constraints to the transmission accuracy When analyzing the transmission accuracy we obtained with different parameters, we found out certain constraints that limited it to a greater or lesser extent. Frame processing time One of the most notorious limits on the effective bitrate that we can obtain from a communication is the time we take to process a given frame at the smartphone side. Even though we possess cameras that can reach up to 64 frames per second in video mode, that number will not serve the purpose if we have a bottleneck elsewhere. As we expressed in subsection 4.5.1, the maximum theoretical bitrate we can obtain with the applied On-Off Keying technique depends on the frame page 53 page 53 processing time. If a smartphone provides frames every 10 milliseconds, but we take 30 milliseconds to process them, we will not be able to keep up and the communication will not be feasible at those rates. In the experiments we performed, we calculated that the frames were taking 16 milliseconds in average to process, but the main issue was that there were some spikes on that processing time, as we found some frames that were taking up to 37 milliseconds to process. The reality was that such number was our actual constraint when achieving higher bitrates, since, according to the formula in subsection 4.5.1, the maximum theoretical bitrate was now approximately 9bps with 3 samples per bit, instead of the 21.3 (64/3) from the camera specifications. Likewise, the time we take to process luminosity values at the IoT side showed also to be a limit on the aforementioned bitrate. The effect of that reduction of the practical bit rate can be seen in figs. 20 and 21, where we can see that if we fixed the bitrate to the maximum ones calculated in subsection 5.2.3 and increased the samples per bit of a communication (thus increasing the demand for a higher frame rate) the connection was degraded highly from the start, due to the synchronization errors that occurred as the smartphone could not keep up with the frame rate demand. The obvious solution to this issue would be further reducing such processing time, although we decided to leave that task to future iterations of our algorithm. Figure 20: IoT-Phone: Distance & Samples/bit vs accuracy Figure 21: Phone-IoT: Distance & Samples/bit vs accuracy Distance The same way the connection degraded with higher frame rate demands, it also did with increasing the distance between the communicating parties. We can clearly appreciate in figs. 16, 17, 20 and 21 that when the distance exceeded 40cm, the communication between the parties turned very complicated and noisy. It is worth mentioning that the aforesaid maximum distance varied with the link direction (a camera can detect changes further away if it is pointed in the right direction). Accordingly, the limit for a half-duplex communication would be stated by the link with the smaller range. Acknowledgements This Master’s Thesis was written in the DistriNet department of the Katholieke Universiteit Leuven. 60 page 61 page 61 Bibliography [1] Oracle. What is IoT? url:https://www.oracle.com/internet-of-things/ what-is-iot.html. [2] Xiaomi. Mi Smart Band 4.url:https://www.mi.com/global/mi-smart- band-4. [3] Amazon. Amazon Alexa.url:https://www.alexa.com/. [4] Google. Google Home.url:https://store.google.com/product/google_ home. [5] Icontrol. State of the Smart Home.url:https : / / 1stdirectory . co . uk / _assets/files_comp/0211249d-217b-423e-9420-d9a57395b1cc.pdf. [6] Forbes. Hackers Made Tesla Cars Autonomously Accelerate Up To 85 In A 35 Zone.url:https://www.forbes.com/sites/daveywinder/2020/02/19/ hackers-made-tesla-cars-autonomously-accelerate-up-to-85-in-a- 35-zone/. [7] A. Ranganathan and S. Capkun. “Are We Really Close? Verifying Proximity in Wireless Systems”. In: IEEE Security Privacy 15.3 (2017), pp. 52–58. [8] S. Rizvi et al. “Securing PKES against Relay Attacks using Coordinate Tracing and Multi-Factor Authentication”. In: 2019 53rd Annual Conference on Information Sciences and Systems (CISS). 2019, pp. 1–6. [9] Uriel Feige, Amos Fiat, and Adi Shamir. “Zero-knowledge proofs of identity”.In: Journal of Cryptology 1 (June1988),pp.77–94.doi:10.1007/BF02351717. [10] Samy Bengio et al. “Secure Implementation of Identification Systems”. In: J. Cryptol. 4.3 (Jan. 1991), pp. 175–183.issn: 0933-2790. doi:10.1007/BF00196726. url:https://doi.org/10.1007/BF00196726. [11] Hildur Ólafsdóttir, Aanjhan Ranganathan, and Srdjan Capkun. “On the Security of Carrier Phase-Based Ranging”. In: Cryptographic Hardware and Embedded Systems – CHES 2017. Ed. by Wieland Fischer and Naofumi Homma. Cham: Springer International Publishing, 2017, pp. 490–509. isbn: 978-3- 319-66787-4. [12] Iakovos Gurulian et al. “Preventing Relay Attacks in Mobile Transactions UsingInfraredLight”. In: Proceedings of the Symposium on Applied Computing. SAC’17. Marrakech, Morocco: Association forComputingMachinery, 2017, pp. 1724–1731. isbn: 9781450344869. doi:10.1145/3019612.3019794.url: https://doi.org/10.1145/3019612.3019794. [13] Mridula Singh et al. UWB-ED: Distance Enlargement Attack Detection in Ultra- Wideband. Nov. 2019. 62 page 63 page 63 [14] Nils Ole Tippenhauer et al. “UWB Rapid-Bit-Exchange System for Distance Bounding”. In: Proceedings of the 8th ACM Conference on Security & Privacy in Wireless and Mobile Networks. WiSec ’15. New York, New York: Association for Computing Machinery, 2015. isbn: 9781450336239. doi:10.1145/ 2766498.2766504.url:https://doi.org/10.1145/2766498.2766504. [15] Apple. iPhone 11 specs.url:https://www.apple.com/iphone-11/specs. [16] Stefan Brands and David Chaum. “Distance-Bounding Protocols”. In: Advances in Cryptology — EUROCRYPT ’93. Ed. by Tor Helleseth. Berlin, Heidelberg: Springer Berlin Heidelberg, 1994, pp. 344–359. [17] Gildas Avoine et al. “Security of Distance-Bounding: A Survey”. In: ACM Comput. Surv. 51.5 (Sept. 2018). issn: 0360-0300. doi:10.1145/3264628.url: https://doi.org/10.1145/3264628. [18] M. Werner, M. Kessel, and C. Marouane. “Indoor positioning using smartphone camera”. In: 2011 International Conference on Indoor Positioning and Indoor Navigation. 2011, pp. 1–6. [19] AndreasMöller et al. “A Mobile Indoor NavigationSystemInterfaceAdapted to Vision-Based Localization”. In: Proceedings of the 11th International Conference on Mobile and Ubiquitous Multimedia. MUM ’12. Ulm, Germany: Association for Computing Machinery, 2012. isbn: 9781450318150. doi:10.1145/ 2406367.2406372.url:https://doi.org/10.1145/2406367.2406372. [20] Jiang Dong et al. “IMoon: Using Smartphones for Image-Based Indoor Navigation”. In: Proceedings of the 13th ACM Conference on Embedded Networked Sensor Systems. SenSys ’15. Seoul, South Korea: Association for Computing Machinery, 2015, pp. 85–97. isbn: 9781450336314. doi:10.1145/2809695. 2809722.url:https://doi.org/10.1145/2809695.2809722. [21] Claudio Marforio et al. “Smartphones as Practical and Secure Location Verification Tokens for Payments”. In: Jan. 2014. isbn: 1-891562-35-5. doi:10. 14722/ndss.2014.23165. [22] Valentin Radu et al. “A Semi-Supervised Learning Approach for Robust Indoor-Outdoor Detection with Smartphones”. In: Proceedings of the 12th ACM Conference on Embedded Network Sensor Systems. SenSys ’14. Memphis, Tennessee: Association for Computing Machinery, 2014, pp. 280–294. isbn: 9781450331432. doi:10.1145/2668332.2668347.url:https://doi.org/ 10.1145/2668332.2668347. [23] Zifan Liu et al. “HyperSight: Boosting Distant 3D Vision on a Single Dual- Camera Smartphone”. In: Proceedings of the 17th Conference on Embedded Networked Sensor Systems. SenSys ’19. New York, New York: Association for Computing Machinery, 2019, pp. 43–54. isbn: 9781450369503. doi:10.1145/ 3356250.3360029.url:https://doi.org/10.1145/3356250.3360029. [24] Saeed Rehman et al. “Visible Light Communication: A System Perspective—Overview and Challenges”. In: Sensors 19.5 (Mar. 2019), p. 1153. issn: 1424-8220. doi:10.3390/s19051153.url:http://dx.doi.org/10.3390/ s19051153. [25] N. Rajagopal, P. Lazik, and A. Rowe. “Visual light landmarks for mobile devices”. In: IPSN-14 Proceedings of the 13th International Symposium on Information Processing in Sensor Networks. 2014, pp. 249–260. page 64 page 64 [26] Liqun Li et al. “Epsilon: A Visible Light Based Positioning System”. In: Proceedings of the 11th USENIX Conference on Networked Systems Design and Implementation. NSDI’14. Seattle, WA: USENIX Association, 2014, pp. 331–343. isbn: 9781931971096. [27] S.-H. Yang et al. “Indoor three-dimensional location estimation based on LED visible light communication”. English. In: Electronics Letters 49 (1 Jan. 2013), 54–56(2). issn: 0013-5194. url:https://digital-library.theiet. org/content/journals/10.1049/el.2012.3167. [28] Ye-Sheng Kuo et al. “Luxapose: Indoor Positioning with Mobile Phones and Visible Light”. In: Proceedings of the 20th Annual International Conference on Mobile Computing and Networking. MobiCom ’14. Maui, Hawaii, USA: Association for Computing Machinery, 2014, pp. 447–458. isbn: 9781450327831. doi:10.1145/2639108.2639109.url:https://doi.org/10.1145/2639108. 2639109. [29] Radu Stoleru et al. “A High-Accuracy, Low-Cost Localization System for Wireless Sensor Networks”. In: Proceedings of the 3rd International Conference on Embedded Networked Sensor Systems. SenSys ’05. San Diego, California, USA: Association for Computing Machinery, 2005, pp. 13–26. isbn: 159593054X. doi:10.1145/1098918.1098921.url:https://doi.org/10. 1145/1098918.1098921. [30] Bo Xie, Guang Tan, and Tian He. “SpinLight: A High Accuracy and Robust Light Positioning System for Indoor Applications”. In: Proceedings of the 13th ACM Conference on Embedded Networked Sensor Systems. SenSys ’15. Seoul, South Korea: Association for Computing Machinery, 2015, pp. 211– 223. isbn: 9781450336314. doi:10.1145/2809695.2809713.url:https:// doi.org/10.1145/2809695.2809713. [31] Song Liu and Tian He. “SmartLight: Light-Weight 3D Indoor Localization Using a Single LED Lamp”. In: Proceedings of the 15th ACM Conference on Embedded Network Sensor Systems. SenSys ’17. Delft, Netherlands: Association for Computing Machinery, 2017. isbn: 9781450354592. doi:10.1145/ 3131672.3131677.url:https://doi.org/10.1145/3131672.3131677. [32] Zhijie Luo, WeiNan Zhang, and GuoFu Zhou. “Improved spring modelbased collaborative indoor visible light positioning”. In: Optical Review 23 (Mar. 2016). doi:10.1007/s10043-016-0204-z. [33] Muhammad Yasir, Siu-Wai Ho, and Badri Vellambi. “Indoor Positioning System Using Visible Light and Accelerometer”. In: Journal of Lightwave Technology 32 (Oct. 2014). doi:10.1109/JLT.2014.2344772. [34] Seungwoo Hyun et al. “Indoor positioning using optical camera communication & pedestrian dead reckoning”. In: July 2015, pp. 64–65. doi:10. 1109/ICUFN.2015.7182499. [35] Qiang Xu, Rong Zheng, and Steve Hranilovic. “IDyLL: Indoor Localization using Inertial and Light Sensors on Smartphones”. In: Sept. 2015. doi:10. 1145/2750858.2807540. [36] S. Hyun et al. “Indoor positioning using optical camera communication pedestriandead reckoning”.In:2015 Seventh International Conference on Ubiquitous and Future Networks. 2015, pp. 64–65. page 65 page 65 [37] The Hacker News. Flaw in Philips Smart Light Bulbs Exposes Your WiFi Network to Hackers.url:https ://thehackernews. com / 2020 / 02 / philipssmart-light-bulb-hacking.html. [38] Vice. This Hacker Showed How a Smart Lightbulb Could Leak Your Wi-Fi Password.url:https://www.vice.com/en_us/article/kzdwp9/this-hacker- showed-how-a-smart-lightbulb-could-leak-your-wi-fi-password. [39] M. Fomichev et al. “Survey and Systematization of Secure Device Pairing”. In: IEEE Communications Surveys Tutorials 20.1 (2018), pp. 517–550. [40] U. M. Qureshi et al. “Survey of Proximity Based Authentication Mechanisms for the Industrial Internet of Things”. In: IECON 2018 - 44th Annual Conference of the IEEE Industrial Electronics Society. 2018, pp. 5246–5251. [41] Mozhgan Azimpourkivi, Umut Topkara, and Bogdan Carbunar. “Camera Based Two Factor Authentication Through Mobile and Wearable Devices”. In: Proc. ACM Interact. Mob. Wearable Ubiquitous Technol. 1.3 (Sept. 2017). doi: 10.1145/3131904.url:https://doi.org/10.1145/3131904. [42] Toni Perković, Tonko Kovacevic, and Mario Cagalj. “BlinkComm: Initialization of IoT Devices Using Visible Light Communication”. In: Wireless Communications and Mobile Computing 2018 (June 2018), pp. 1–16. doi:10.1155/ 2018/8523078. [43] Mozilla. Firefox.url:https://www.mozilla.org/firefox/. [44] Google. Chrome.url:https://www.google.com/chrome/. [45] DigiCert. Official List of Trusted Root Certificates on Android.url:https:// www.digicert.com/blog/official-list-trusted-root-certificates- android/. [46] PC World. Google threatens action against Symantec-issued SSL certificates following botched investigation. 2015. url:https://www.pcworld.com/article/ 2999146/google-threatens-action-against-symantec-issued-certificates- following-botched-investigation.html. [47] W.DiffieandM.Hellman. “New directions incryptography”. In: IEEE Transactions on Information Theory 22.6 (1976), pp. 644–654. [48] R. L. Rivest, A. Shamir, and L. Adleman. “A method for obtaining digital signatures and public-key cryptosystems”. In: Communications of the ACM (1978). [49] Neal Koblitz. “Elliptic curve cryptosystems”. In: Mathematics of computation 48.177 (1987), pp. 203–209. [50] Victor S. Miller. “Use of Elliptic Curves in Cryptography”. In: Advances in Cryptology — CRYPTO ’85 Proceedings. Ed. by Hugh C. Williams. Berlin, Heidelberg: Springer Berlin Heidelberg, 1986, pp. 417–426. [51] Elaine B Barker, Don Johnson, and Miles E Smid. SP 800-56A. recommendation for pair-wise key establishment schemes using discrete logarithm cryptography (revised). 2007. [52] D Brown. “Standards for efficient cryptography, SEC 1: elliptic curve cryptography”. In: Released Standard Version 1 (2009). [53] Don Johnson, Alfred Menezes, and Scott Vanstone. “The elliptic curve digital signature algorithm (ECDSA)”. In: International journal of information security 1.1 (2001), pp. 36–63. page 66 page 66 [54] Víctor Gayoso Martínez, Luis Hernández Encinas, and Carmen Sánchez Ávila. “A survey of the elliptic curve integrated encryption scheme”. In: (2010). [55] CKerryandPGallagher.“FIPS PUB 186-4: DigitalSignatureStandard(DSS)”. In: Federal Information Processing Standards Publication. National Institute of Standards and Technology (2013). [56] National Institute of Standards and Technology.url:https://www.nist.gov/. [57] Elaine Barker. Suite b cryptography. 2006. [58] National Security Agency.url:https://www.nsa.gov/. [59] Hugo Krawczyk, Mihir Bellare, and Ran Canetti. RFC2104: HMAC: Keyedhashing for message authentication. 1997. [60] Tetsu Iwata and Kaoru Kurosawa. “OMAC: One-Key CBC MAC”. In: Fast Software Encryption. Ed. by Thomas Johansson. Berlin, Heidelberg: Springer Berlin Heidelberg, 2003, pp. 129–153. [61] Mihir Bellare, Joe Kilian, and Phillip Rogaway. “The security of the cipher block chaining message authentication code”. In: Journal of Computer and System Sciences 61.3 (2000), pp. 362–399. [62] John Black and Phillip Rogaway. “A block-cipher mode of operation for parallelizable message authentication”. In: International Conference on the Theory and Applications of Cryptographic Techniques. Springer. 2002, pp. 384–397. [63] Douglas R. Stinson. “Universal hashing and authentication codes”. In: Designs, Codes and Cryptography 4.3 (1994), pp. 369–380. [64] Daniel J Bernstein. “The Poly1305-AES message-authentication code”. In: International Workshop on Fast Software Encryption. Springer. 2005, pp. 32–49. [65] Eric Rescorla and Tim Dierks. “The transport layer security (TLS) protocol version 1.3”. In: (2018). [66] David McGrew and John Viega. “The Galois/counter mode of operation (GCM)”. In: submission to NIST Modes of Operation Process 20 (2004). [67] William F Ehrsam et al. Message verification and transmission error detection by block chaining. US Patent 4,074,066. Feb. 1978. [68] Daemen Joan and Rijmen Vincent. “AES proposal: Rijndael”. In: National Institute of Standards and Technology (2003), p. 1. [69] IEEE. 802.1AE: MAC Security (MACsec).url:https://1.ieee802.org/ security/802-1ae/. [70] Randall Atkinson and Stephen Kent. Security architecture for the internet protocol. Tech. rep. RFC 1825, August, 1995. [71] Randall Atkinson and S Kent. IP authentication header. Tech. rep. RfC 1826, August, 1995. [72] Randall Atkinson and Stephen Kent. IP encapsulating security payload (ESP). Tech. rep. RfC 1827, August, 1995. [73] NSA Fact Sheet. “Suite B cryptography”. In: NSA, URL: http://www. nsa. gov/ia/industry/crypto_suite_b. cfm (2008). [74] William Wesley Peterson and Daniel T Brown. “Cyclic codes for error detection”. In: Proceedings of the IRE 49.1 (1961), pp. 228–235. [75] Greg Cook. Catalogue of parametrised CRC algorithms. Mar. 2020. url:http: //reveng.sourceforge.net/crc-catalogue/all.htm. page 67 page 67 [76] Vladimir Oksman and Stefano Galli. “G. hn: The new ITU-T home networking standard”. In: IEEE Communications Magazine 47.10 (2009), pp. 138–145. [77] Y Le. “Schema Validation with Intel Streaming SIMD Extensions 4 (Intel SSE4)”. In: Intel Corporation (2008). [78] GNU Gzip.url:https://www.gnu.org/software/gzip/. [79] BZIP2.url:https://sourceware.org/git/bzip2.git. [80] RobertM.MetcalfeandDavidR. Boggs. “Ethernet: DistributedPacketSwitching for Local Computer Networks”. In: Commun. ACM 19.7 (July 1976), pp. 395–404. issn: 0001-0782. doi:10. 1145 / 360248 . 360253.url:https : //doi.org/10.1145/360248.360253. [81] GlennRanders-Pehrson,ThomasBoutell,etal.PNG (Portable Network Graphics) Specification, Version 1.2. 1999. [82] R. W. Hamming. “Error detecting and error correcting codes”. In: The Bell System Technical Journal 29.2 (1950), pp. 147–160. [83] url:https://en.tuya.com/. [84] url:https://github.com/codetheweb/tuyapi. [85] Heise. No-Name-Smart-Home: Security flaw allows easy firmware upload.url: https://www.heise.de/newsticker/meldung/No- Name- Smart- Home- Security-flaw-allows-easy-firmware-upload-4285085.html. [86] Emekcan Aras et al. “MicroVault: Reliable Storage Unit for IoT Devices”. In: [87] Sridhar Rajagopal, Richard D Roberts, and Sang-Kyu Lim. “IEEE 802.15.7 visible light communication: modulation schemes and dimming support”. In: IEEE Communications Magazine 50.3 (2012), pp. 72–82. [88] Y. Yang, J. Hao, and J. Luo. “CeilingTalk: Lightweight Indoor Broadcast ThroughLED-CameraCommunication”. In: IEEE Transactions on Mobile Computing 16.12 (2017), pp. 3308–3319. [89] Alfred J Menezes et al. Handbook of applied cryptography. CRC press, 1996. [90] Jean-Karim Zinzindohoué et al. “HACL*: A verified modern cryptographic library”. In: Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security. 2017, pp. 1789–1806. [91] Xiaomi.Xiaomi Redmi Note 7 Pro specs.url:https://www.mi.com/in/redminote-7-pro/. [92] Android. Android Activity Lifecycle.url:https://developer.android.com/ guide/components/activities/activity-lifecycle. [93] Raspberry Pi Foundation. Raspberry Pi 3 Model B specs.url:https://www. raspberrypi.org/products/raspberry-pi-3-model-b/. [94] Arduino.Arduino Uno Wifi Rev2.url:https://store.arduino.cc/arduinouno-wifi-rev2. [95] Google. Firebase Realtime Database.url:https://firebase.google.com/ docs/database/. [96] Vladimir I Levenshtein. “Binary codes capable of correcting deletions, insertions, and reversals”. In: Soviet physics doklady. Vol. 10. 8. 1966, pp. 707– 710. [97] Raspberry Pi Dramble. Power Consumption.url:https://www.pidramble. com/wiki/benchmarks/power-consumption. page 68 page 68 [98] X. Chen, K. W. Nixon, and Y. Chen. “Practical power consumption analysis with current smartphones”. In: 2016 29th IEEE International System-on-Chip Conference (SOCC). 2016, pp. 333–337. [99] Android. CameraX.url:https : / / developer . android . com / training / camerax.