A Blockchain Approach for Negotiating Trust in Iot by Skailer Knezevic
Total Page:16
File Type:pdf, Size:1020Kb
A Blockchain Approach for Negotiating Trust in IoT by Skailer Knezevic Bachelor of Science College of Engineering and Science Florida Institute of Technology 2017 A thesis submitted to the College of Engineering and Science at Florida Institute of Technology in partial fulfillment of the requirements for the degree of Masters of Science in Information Assurance and Cybersecurity Melbourne, Florida May, 2020 ⃝c Copyright 2020 Skailer Knezevic All Rights Reserved The author grants permission to make single copies. We the undersigned committee hereby approve the attached thesis A Blockchain Approach for Negotiating Trust in IoT by Skailer Knezevic Heather Crawford, Ph.D. Assistant Professor Computer Engineering and Sciences Committee Chair Andy Stanfield, Ph.D. Assistant Professor School of Arts and Communication Outside Committee Member Bernard Parenteau, Ph.D. Assistant Professor Computer Engineering and Sciences Committee Member Philip Bernhard, Ph.D. Associate Professor and Department Head Computer Engineering and Sciences ABSTRACT Title: A Blockchain Approach for Negotiating Trust in IoT Author: Skailer Knezevic Major Advisor: Heather Crawford, Ph.D. \The internet is no longer a web that we connect to. Instead, its a computerized, networked, and interconnected world that we live in. This is the future, and what were calling the Internet of Things."- Bruce Schneier, 2019 The Internet of Things is becoming a big part of our lives. Every year there are more devices with the capability to connect on the internet and communicate with each other. Today there are over 400 million IoT devices in the world, and this number is predicted to grow to 1.5 billion devices by 2022 [14]. It is becoming more difficult to manage all IoT devices and to know with which device to connect to request a service. In addition, a device can fail at some point or stop provid- ing a good service. There is a need to find a better way to store data about all transactions between devices to provide the basis for a way to establish the trust between devices. In this thesis, we propose a solution to use a blockchain in order to store transaction data and an algorithm that establishes trust between devices in the same network. iii Table of Contents Abstract iii List of Figures vii List of Tables ix Acknowledgments x 1 Introduction 1 1.1 Problem Statement . 1 1.2 Proposed Solution . 2 1.3 Research Question . 3 1.4 Approach . 3 1.5 Organization of the Thesis . 4 2 Background 5 2.1 What is IoT? . 5 2.2 What is blockchain? . 7 2.2.1 Types . 11 2.2.2 Consensus . 13 2.2.3 Mining . 20 iv 2.3 Cryptographic Algorithms . 23 2.4 Use of Blockchain . 24 2.5 Some Existing Blockchains . 25 2.5.1 IOTA . 25 2.5.2 Ripple . 27 2.5.3 Hyperledger Fabric . 28 2.5.4 Ethereum . 31 2.5.5 Cosmos . 32 2.5.6 Characteristic Comparison . 34 2.6 IoT Blockchain Smart Homes . 34 2.7 Summary . 38 3 Approach 39 3.1 IOTA Tangle . 39 3.2 Hyperledger Fabric . 43 3.2.1 Scenarios . 45 3.2.1.1 Scenario 1 . 45 3.2.1.2 Scenario 2 . 46 3.2.2 Algorithm and Code . 47 3.2.2.1 Blockchain Code . 47 3.2.2.2 Connecting with Hyperledger . 48 3.2.2.3 Algorithm for Establishing Trust . 48 3.2.2.4 Blockchain Structure . 51 3.3 Summary . 53 v 4 Experiments 55 4.1 Experimental Design . 55 4.2 Scenario 1 . 57 4.3 Scenario 2 . 58 4.4 Experiments . 59 4.4.1 What devices can provide a specific service? . 59 4.4.2 Which device is the best? . 60 4.4.3 New devices wants to provide a service? . 61 4.4.4 Service is provided- show transaction . 61 4.5 Summary . 62 5 Conclusion 64 5.1 Findings . 64 5.2 Results . 65 5.3 Future Work . 65 5.4 Revisit . 66 References 68 Appendix Scoring Trust 79 vi List of Figures 2.1 Merkle Tree . 9 2.2 SHA256 Hashing . 10 2.3 Cryptographic Puzzle Target . 14 2.4 Blockchain Attack . 16 2.5 Mining Power Diagram . 22 2.6 Hyperledger Fabric Connections . 29 2.7 Hyperledger Fabric Trade . 30 3.1 IOTA Layer Calculator . 41 3.2 Compass Seed . 42 3.3 Tangle JSON configuration . 42 3.4 IRI Node . 43 3.5 JavaScript File . 48 3.6 Hyperledger Fabric Blockchain . 51 3.7 Hyperledger Fabric Block . 52 4.1 New Device . 56 4.2 Transaction . 57 4.3 Adding New Device . 58 4.4 Service Providers . 59 4.5 Service Providers 2 . 60 vii 4.6 Device Recommendation . 60 4.7 Transaction . 61 viii List of Tables 2.1 Comparison of blockchains . 34 3.1 Connection Points Distribution . 49 3.2 Last Connection Points . 50 3.3 Device Make Points . 50 4.1 Querying Speed . 62 ix Acknowledgements I am extremely grateful to my advisor Dr. H. Crawford for guiding me through the whole process of writing this thesis. Her constructive criticism, insightful sug- gestions, and relentless support helped me to work hard to reach my goals. She motivated me to do better and never give up. I would like to extend my sincere thanks to my committee members Dr. A. Stan- field and Dr. B. Parenteau for their time and insightful comments. I would like to acknowledge the help of my colleague Ghassen Kilani for giving me valuable advice on doing academic research and suggesting a few research pa- pers that were referenced in this thesis. I would like to thank my parents and my brother on encouraging me to pursue my graduate degree. I would also like to extend my gratitude to my friend William Wilson for his profound belief in my abilities and keeping me motivated in moments when I was doubting myself. x Chapter 1 Introduction 1.1 Problem Statement There are around 400 million IoT devices today [9], and even smaller networks can have tens or hundreds of devices. Although the traditional database can store data about IoT devices and their transactions, designing a database to keep track of all transactions can be challenging with a large number of devices. In addition, tra- ditional databases are often susceptible to attacks such as SQL injection, denial of service (DOS), and privilege escalation, where an attacker can permanently change or delete data inside the database [32]. With the invention of Bitcoin blockchain in 2008 [54], the possibility of storing data differently than in the traditional database and making the data immutable emerged. By making the data immutable, Bitcoin has for a goal to preserve the integrity of data. Another issue that emerged with a large number of IoT devices is that it is hard to know which device to trust in the network. It gets increasingly hard to know 1 from which device to request the service or exchange information. There is an assumption that devices that are connecting trust each other, and often when a new device joins the network and tries to request a service, a requester is presented with multiple options, but a little to no information about the device from which it is requesting a service. Usually, a requester can only see the names of other devices that network admin or owners of that device gave to it, and it can be changed. Another issue is when there are multiple devices that provide the same service, it is hard to pick which one to use. Therefore, there is a need for a solution that can store data about every transaction and allow devices to use that data in making a decision from which device to request a service, and the data needs to be resistant to cyber-attacks. 1.2 Proposed Solution Often blockchains that are used for IoT devices have only functionality to record transactions between devices and store them in a blockchain. We propose using a blockchain for storing information about devices and transactions between devices and using the data for negotiation of the trust between devices. Our solution allows the requester to query data from a blockchain about another device such as which devices provide the service that device needs. What device among those devices is most trustworthy? This solution will help devices to decide which device they can trust the most. This will also allow devices to choose between multiple service providers. 2 1.3 Research Question In this thesis, we answer to what degree we can store and retrieve information about IoT devices on a blockchain. Can this information be used to answer such as how frequently does one device provide the requested service? How often that device provides a service to the requester? Can a new device that is entering the IoT space provide or request a service? 1.4 Approach We use a blockchain called Hyperledger Fabric to store device and transaction data on a blockchain. Our algorithm takes into account the number of times that device provided any service as well as how many times that device provided the requested service. The algorithm also checks for the number of times the device provided service to the requester. Furthermore, the last time the device provided this service as well as year when the device was made and hardware requirements checks. All devices are scored based on those parameters, and the device with the highest score is suggested as the recommended device. In case that there is more than one device with the same score, the device with a higher number of transactions is suggested. Thus, our approach provides a method by which devices can search for devices that provide the service that they need.