(IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 10, No. 3, 2019 59 | Page www.ijacsa.thesai.org Applying Diffie-Hellman Algorithm to Solve the Key Agreement Problem in Mobile Blockchain-based Sensing Applications Nsikak Pius Owoh 1 , Manmeet Mahinderjit Singh 2 School of Computer Sciences, Universiti Sains Malaysia, USM 11800, Penang, Malaysia Abstract—Mobile blockchain has achieved huge success with the integration of edge computing services. This concept, when applied in mobile crowd sensing, enables transfer of sensor data from blockchain clients to edge nodes. Edge nodes perform proof-of-work on sensor data from blockchain clients and append validated data to the chain. With this approach, blockchain can be performed pervasively. However, securing sensitive sensor data in a mobile blockchain (client/edge node architecture) becomes imperative. To this end, this paper proposes an integrated framework for mobile blockchain which ensures key agreement between clients and edge nodes using Elliptic Curve Diffie-Hellman algorithm. Also, the framework provides efficient encryption of sensor data using the Advanced Encryption Standard algorithm. Finally, key agreement processes in the framework were analyzed and results show that key pairing between the blockchain client and the edge node is a non-trivial process. Keywords—Internet of Things; mobile crowd sensing; edge computing; sensor data encryption; mining; smart contract I. INTRODUCTION Mobile crowd sensing (MCS) has become an attractive method of gathering personal and environmental data [1]. It takes advantage of sensors (accelerometer, gyroscope, GPS, camera, etc.) and the communication capability of smart devices such as smartphones to collect and transmit large scale sensor data at low cost [2]. These sensors acquire useful data in several domains, including but not limited to environmental monitoring [3], healthcare [4], traffic monitoring [5]. Basically, a crowd sensing platform consists of a cloud-based system and a group of sensing devices (mobile users). The platform publishes a set of sensing task with various purposes, while the mobile users participate in the sensing task [6]. Mobile crowd sensing also plays a key role in the actualization of smart cities [7]. Cities are considered “smart” when they have among other things: intelligent versatility, smart administration, smart citizens, intelligent economics and intelligent life [8]. Most importantly, such cities should also be able to share data using information and communication technology (ICT) [9]. Despite the benefits of MCS, challenges such as incentivizing participants [10, 11], quality and reliability of sensed data [12], energy usage of mobile sensing devices [5], sensor data annotation [13], security and privacy [14, 15] still exist. Due to the sensitive information of users gathered and transmitted by sensing devices, different mechanisms have been proposed to ensure secure sensing in MCS applications [16]. Unfortunately, security and privacy still remain a pressing issue as an active attacker can intercept and modify transmitted sensor data (data in motion) from a mobile sensing device like the smartphone [17] and/or can alter stored data (data at rest). Recently, the inherent attributes of blockchain technology have been harnessed to provide security and privacy in IoT [18] and specifically MCS applications [19]. The adoption of this technology for these purposes is not surprising, as its previous application in cryptocurrency has recorded some success. The gains of blockchain based cryptocurrency technology include; transformed payments, as middlemen are taken out of the loop and reduce merchant payment fees to below 1%, as well as the removal of delays, as users receive transferred funds instantly without having to wait for days [20]. Apart from its use in cryptocurrencies and smart contracts, blockchains have been applied in social services [21], smart living applications [22], supply chain management [23], intelligent transportation systems [24], data storage [25], identity management [26], smart cities [2]. Blockchain is a technology that reads, stores and validates transactions in a distributed database system [27]. The stored data can be cryptocurrency (Bitcoin) [28], a contract [29] or even personal data [30]. Another definition of blockchain is that, it is a security mechanism that ensures immutability, anonymity and auditability of electronic transactions [16]. It acts as a distributed ledger (a virtual book that stores previous transactions) allowing data to be shared among a network of peers by implementing a chain of timestamped blocks that are connected by cryptographic hashes. With this mechanism, untrustworthy participants (such as those in mobile crowd sensing) can reach a consensus and perform transactions without the involvement of third-parties. Blockchain can either be public (permissionless), private (permissioned), or consortium. Any user with internet access can join the network by taking part in block validation and smart contracts creation in public blockchains. Private blockchains on the other hand, controls users‟ right to validate block transactions and develop smart contracts [31]. Private blockchain offers privacy and efficiency of transactions. Consortium blockchains are somewhat private and grant selected nodes full access. However, before using a blockchain, a peer-to-peer network with all interested nodes must be created. All