Next Article in Journal
Fully 3D-Printed Dry EEG Electrodes
Previous Article in Journal
Designing a Private and Secure Personal Health Records Access Management System: A Solution Based on IOTA Distributed Ledger Technology
Previous Article in Special Issue
Toward Trusted IoT by General Proof-of-Work
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Blockchain-Based Data Access Control and Key Agreement System in IoT Environment

1
School of Electronic and Electrical Engineering, Kyungpook National University, Daegu 41566, Republic of Korea
2
Decentralized Network Research Section, Electronics and Telecommunications Research Institute, Daejeon 34129, Republic of Korea
3
Center for Security, Theory and Algorithmic Research, International Institute of Information Technology, Hyderabad 500 032, India
4
School of Electronics Engineering, Kyungpook National University, Daegu 41566, Republic of Korea
*
Author to whom correspondence should be addressed.
Sensors 2023, 23(11), 5173; https://doi.org/10.3390/s23115173
Submission received: 5 April 2023 / Revised: 26 May 2023 / Accepted: 26 May 2023 / Published: 29 May 2023
(This article belongs to the Special Issue Blockchain for IoT Security, Privacy and Intelligence)

Abstract

:
Recently, with the increasing application of the Internet of Things (IoT), various IoT environments such as smart factories, smart homes, and smart grids are being generated. In the IoT environment, a lot of data are generated in real time, and the generated IoT data can be used as source data for various services such as artificial intelligence, remote medical care, and finance, and can also be used for purposes such as electricity bill generation. Therefore, data access control is required to grant access rights to various data users in the IoT environment who need such IoT data. In addition, IoT data contain sensitive information such as personal information, so privacy protection is also essential. Ciphertext-policy attribute-based encryption (CP-ABE) technology has been utilized to address these requirements. Furthermore, system structures applying blockchains with CP-ABE are being studied to prevent bottlenecks and single failures of cloud servers, as well as to support data auditing. However, these systems do not stipulate authentication and key agreement to ensure the security of the data transmission process and data outsourcing. Accordingly, we propose a data access control and key agreement scheme using CP-ABE to ensure data security in a blockchain-based system. In addition, we propose a system that can provide data nonrepudiation, data accountability, and data verification functions by utilizing blockchains. Both formal and informal security verifications are performed to demonstrate the security of the proposed system. We also compare the security, functional aspects, and computational and communication costs of previous systems. Furthermore, we perform cryptographic calculations to analyze the system in practical terms. As a result, our proposed protocol is safer against attacks such as guessing attacks and tracing attacks than other protocols, and can provide mutual authentication and key agreement functions. In addition, the proposed protocol is more efficient than other protocols, so it can be applied to practical IoT environments.

1. Introduction

As IoT devices are deployed in various environments such as houses, farms, factories, and grids, the development and spread of smart cities such as smart homes, smart factories, and smart grids continues. As the amount of data generated and collected by IoT devices increases exponentially, it is predicted that the total amount of data generated annually by 2024 will reach 149 ZB [1]. IoT data are used as source data for services related to finance, medical care, artificial intelligence, and electricity bills.
Data access control technology that can provide IoT data to data users (e.g., managers of smart grids and financial institutions) in an appropriate service environment is required to utilize IoT data as source data for various services. To efficiently utilize IoT data and provide them to data users, the gateway collects IoT data, outsources them to a cloud server, and manages the data through the cloud [2,3]. However, the generated IoT data contain sensitive information such as user personal information, so privacy cannot be guaranteed if the data are indiscriminately viewed by institutions using the data. Moreover, data outsourcing also creates security and privacy concerns because it separates data ownership and data management [4]. Therefore, access control for the data users is necessary to protect personal information and provide only data that meet the attributes of the data user that will use the data. To this end, data access control technology using attribute-based encryption (ABE) [5] has recently attracted attention as a promising technology.
In the case of ciphertext-policy ABE (CP-ABE) [6], each original datum is encrypted in relation to the access control structure set in advance by the encryptor. Data users can only decrypt the ciphertext if the set of attributes he or she uses satisfies the ciphertext access structure. IoT data producers need to be able to provide their data only to organizations that want them through the gateway to ensure privacy. Therefore, since the access structure for IoT data must be determined, using CP-ABE is suitable for the IoT environment.
Additionally, if the cloud server manages the computation and communication of most systems, including outsourced data and access control, it is vulnerable to a single point of failure and data management due to centralization issues [7]. In order to solve this problem, research on the decentralization of cloud servers using blockchains has recently been conducted [8,9]. On the other hand, since IoT data are transmitted and received through open channels, malicious attackers can steal the data to perform attacks such as invasions of privacy, data exfiltration, and data abuse. Therefore, to solve these problems, it is necessary to study the application of ABE and blockchain for data privacy provision and access control. In addition, in order to securely store and provide data, gateways, cloud servers, and data users need to verify that they are valid entities through key agreement.
Therefore, in this paper, we suggest a security system that provides authentication while providing access control. We analyze the trends and problems of systems for secure access control and management of data generated in the IoT environment, and present the direction of blockchain-based access control and key agreement to solve these problems.
The main motivations and contributions of this study based on the problems and challenges mentioned above are as follows:
  • Unlike existing IoT data access control systems using blockchains, the proposed system guarantees data protection through mutual authentication and key agreement. The detailed method is as follows: The proposed system provides mutual authentication based on bilinear pairing and secure key agreement based on the DBDH assumption. In addition, it provides secure data outsourcing and data access control based on CP-ABE by using the session key generated through key agreement.
  • The gateway and the cloud server generate a session key through key agreement and mutual authentication, and the gateway can safely outsource data through the session key. Gateways can also prove data validation through self-signing when uploading data. Data users can request data to the cloud server and verify the received data through the gateway’s signature. Thus, the system can provide data accountability.
  • Since the proposed system utilizes a public permissioned blockchain, only data users, gateways, and cloud servers registered with the TA (trusted authority) can use the blockchain as a participant. By auditing the blockchain through data users, nonrepudiation of data can be avoided.
  • Detailed formal security validation utilizing the widely accepted “AVISPA Software Verification Tool” [10], “indistinguishability game against selective chosen plaintext attack (IND-CPA)”, and “informal (nonmathematical) security analysis” shows that the suggested system guarantees safety against multiple potential attacks on smart city environments utilizing IoT.
  • Testbed experiments with cryptographic primitives in a laptop environment were performed using the popular “Multiprecision Integer and Rational Arithmetic Cryptographic Library (MIRACL)” [11].
The remainder of this paper is organized as follows: Section 2 reviews papers on data access control using CP-ABE and blockchain in IoT environments. Section 3 outlines the proposed system model, blockchain, access structure, bilinear pairing, DBDH assumption, and adversary model. Section 4 describes our proposed data access control system. Section 5 describes the results of formal security validation using AVISPA and IND-CPA, and Section 6 describes the results of informal security analysis. We analyze the efficiency and security features of the protocol in Section 7. Finally, Section 8 concludes the paper.

2. Related Works

Numerous studies on data access control using CP-ABE have been proposed; its application to the IoT environment has also been proposed. In 2007, Ling and Newport [12] proposed a CP-ABE method that can be applied to both positive and negative attributes using an AND gate access structure. They proposed a structure that has been proven to be secure with plaintext selected under the decisional bilinear Diffie–Hellman (DBDH) assumption. Lewko and Waters [13] suggested a CP-ABE method based on multiauthority, and argued that their system does not require collaboration between rapid institutions. However, in the initialization phase, all agencies must set key parameters, so their structure is impractical for large-scale systems.
In order to efficiently store and manage data, systems in which data are outsourced to a cloud server and controlled have been also proposed [14,15,16,17,18]. Yeh et al. [14] proposed a system that can collect patient information from IoT devices and use it for smart healthcare. For data integrity in their system, data are pre-encrypted before uploading to cloud servers, giving patients access control to data. Miao et al. [15] proposed a CP-ABE-based data access control and keyword search system structure in a cloud-enabled mobile crowdsourcing environment. Liu et al. [16] proposed an e-healthcare record system that uploads and shares health data collected from wearable IoT devices to a cloud server and protects the personal information of patients based on CP-ABE. Ding et al. [17] proposed a structure that can ensure data security in IoT systems by using a pairing-free-based CP-ABE in IoT systems. Lu et al. [18] proposed a secure data sharing system in cloud computing that ensures data privacy protection in resource-constrained mobile terminals. However, since these studies are data access control systems based on cloud servers, a centralization problem may occur, which may cause a single-point-of-failure problem.
Therefore, CP-ABE systems have been proposed for access control of IoT data based on blockchains to solve this centralization problem [19,20,21,22,23,24]. In 2018, Zhang et al. [19] proposed a user-controlled data sharing system with privacy protection using fine-grained access control based on a blockchain and CP-ABE. In 2019, Ding et al. [20] also proposed an ABE access control system for IoT. Blockchain technology was used to record the distribution of properties to prevent single-point errors and data tampering. They demonstrated that authentication can ensure strict access control, but there is no algorithm or protocol for this in their system. Guo et al. [21] suggested a multiauthority blockchain-based ABE protocol for telemedicine systems. Unfortunately, Son et al. [25] figured out that Guo et al.’s protocol [21] is not suitable for real-world environments as patients must maintain their own attribute keys. Yang et al. [22] proposed an EHR sharing system utilizing cloud computing based on ABE and blockchains. In 2021, Wei et al. [23] designed an ABE algorithm for multiauthority scenarios with resource-constrained IoT devices in mind, thereby shifting data management to a blockchain instead of a central server. Qin et al. [24] also proposed a blockchain-based CP-ABE system using cloud computing with consideration to the resource limitations of IoT devices. However, the authentication they proposed [19,20,21,22,23,24] is authentication for data, not mutual authentication between entities participating in communication. For secure communication, the session key must be calculated by performing mutual authentication and key agreement.
Blockchain-based CP-ABE access control systems have been proposed in various smart environments using IoT devices. However, most studies do not provide mutual authentication, key agreement, data access control, validation and accountability at the same time. Therefore, we propose a structure that guarantees a secure data outsourcing process through mutual authentication and key agreement and provides data access control using CP-ABE technology. In addition, our proposed structure proposes an access control system that provides functions of data nonrepudiation, data accountability, and data validation based on a blockchain.

3. System Models and Preliminary Work

We present the proposed system model for IoT data access control considering data users in the different IoT environments. We describe blockchain characteristics, ABE, and the adversary model used in our system. Table 1 is an explanation of abbreviations and symbols used in this paper.

3.1. System Model

Our proposed data access control system model is described in Figure 1. The proposed system model consists of the following four entities:
  • Cloud Server (CS): A set of CSs forms a “CS network”, where a distributed ledger is maintained for block additions. CSs are honest but curious entities. Moreover, the CS receives the IoT data and provides the data to the data user when the user’s attribute value matches. In addition, the CS uploads data such as data attributes, signature values, and public keys to the blockchain to solve the centralization problem.
  • Gateway (GW): Gateways are distributed in various smart environments that make up the smart city. The gateway collects IoT data from each environment and uploads them to a cloud server with attribute-based encryption appropriate for each attribute.
  • Data User (DU): Data user refers to a person who charges fees using IoT data or provides services such as artificial intelligence, finance, and medical care using IoT data. The data user requests an attribute key from the TA. After that, the TA can request data matching the attribute from the cloud server, and can obtain the original data by decrypting the received data through the attribute key.
  • Trusted Authority (TA): All data users, gateways, and cloud servers must register with a fully trusted  T A .
  • Blockchain: In the proposed system model, the blockchain is composed of a public permissioned blockchain. To solve the problem of centralization of CSs, the blockchain stores the storage address of data stored in the CS, the public key of each component, hash, data access tree, etc., on behalf of the CS. The “practical Byzantine fault tolerance (PBFT) consensus algorithm” [26] has been applied for adding blocks to existing blockchains, verifying blocks, and voting-based consensus algorithms. Data users audit the blockchain ledger. All blockchain members can read the ledger, but only data users and cloud servers can upload transitions to the blockchain. When the DU requests information from the CS, the CS checks whether the access tree of the requested information and the attributes of the DU match through the blockchain. If the attributes match the access tree, the CS passes the encrypted data to the DU.
In the setup phase,  T A  generates and publishes parameters necessary for the system and tree. During the registration phase,  D U s,  G W s, and  C S  are registered with  T A  through closed channels. Through the attribute key generation phase,  D U  can ask  T A  for a key that matches his attribute, and use the acquired attribute key to decrypt the encrypted data. In the authentication phase,  G W  and  C S  perform authentication and key agreement for data upload. In the data upload phase,  G W  uploads data to the cloud server through the agreed session key. Simultaneously,  G W  uploads the signature as a verification value to verify its own data and the upload time to the blockchain. In addition,  C S  uploads the attribute tree value of the data and the record address value where the data are stored to the blockchain. In the data request and provide phase,  D U  requests data from  C S , and  C S  verifies the  D U ’s request message, checks the attribute value of  D U  through the blockchain, and transmits the corresponding data to  D U D U  downloads the verification value from the blockchain for the transmitted data, verifies that they are valid data, and can decrypt the data with its own attribute key.

3.2. Blockchain

A blockchain is a distributed data storage system that can solve the single-point-of-failure problem that can occur by being concentrated in the cloud server. The decentralized nature of blockchains can provide nonrepudiation of data, accountability, and transparency. In addition, the timestamp recorded on the blockchain allows blockchain participants to know the transaction generation time [27]. In general, four types of blockchain platforms are defined:
  • Public permissionless blockchain: A public permissionless blockchain provides a ’low trust’ environment where anyone can run nodes and participate in the network. A public permissionless blockchain can be accessed by anyone, and any node can participate in the consensus protocol. Moreover, anyone can read the entire ledger of transactions.
  • Public permissioned blockchain: Public permissioned blockchains have rules that determine who can participate in the verification process and launch nodes. They are commonly used by public institutions such as government agencies, businesses, or educational institutions. Whitelisted nodes can participate in the consensus mechanism. Owners create validator nodes that define governance rules for the blockchain, including those who can create new nodes or write to the blockchain. However, read access can be used by anyone who makes the blockchain publicly accessible.
  • Private permissionless blockchain: A private permissionless blockchain has no restrictions on who can participate in the consensus mechanism. However, unlike public permissionless convex chains, there are restrictions on who can read and write content on the blockchain.
  • Private permissioned blockchain: These blockchains are controlled by a unique group of one or several owners who determine the participants in the consensus mechanism. Only selected user groups can read or write to these blockchains. If public verification of records is not required, consider private permissioned blockchains.
In this paper, only cloud servers and data users of smart cities can write to the blockchain. Therefore, in this paper, a public permission-type blockchain is adopted, and the consensus algorithm uses PBFT.

3.3. Access Structure

According to [6], we use the following access tree as an access structure.
Assuming that  T  is an access tree,  T  includes  ( v , n u m v , t h r e s h o l d v , p a r ( v ) , i n d ( v ) ) , where v is a node of  T t h r e s h o l d v  is threshold value of v n u m v  is the number of children nodes of v i n d ( v )  is unique index of v, and  p a r ( v )  is a parent node of v. Assuming v is an internal node, v is the threshold gate denoted by  A N D  and  O R A N D  and  O R  gates are defined as follows: when  0 < t h r e s h o l d v n u m v , it is an  A N D  gate if  t h r e s h o l d v = n u m v  and an  O R  gate if  t h r e s h o l d v = 1 .
Moreover, in the case where v is a leaf node, it is described as the attributes  t h r e s h o l d v = 1 . To fit  T  with attribute set  a t t ( v ) a t t ( v )  have to match the threshold gate at root node  τ  of  T . Here,  a t t ( v )  is defined only if v is a leaf node and represents an attribute related to leaf node v in the tree. In the first case,  τ  is an attribute and its key satisfies the access tree  a t t ( v ) . In the following case, if  τ  is a threshold gate whose child node is an attribute, the access tree is satisfied when  a t t ( v )  holds the threshold gate of  τ . In other cases, such as where  τ  is a threshold gate and the child nodes are also threshold gates, the method in the second case can be applied recursively to solve it.

3.4. Bilinear Pairing

Let  G 1  and  G 2  be recursive groups with large prime q, and let them be addition and multiplication groups, respectively. Then, a map that satisfies the following conditions can be applied to the bilinear map  e : G 1 × G 1 G 2 .
  • Efficiency: For all  P , Q G 1 e ( P , Q )  are able to be computed in polynomial time.
  • Bilinearity: For all  P , Q G 1 , and for all  x , y Z p e ( x P , y Q )  is  e ( P , Q ) x y .
  • Nondegeneracy: Existing  P , Q G 1 , then  e ( P , Q ) 1 G 1 , where  1 G 1  is the identifying element of  G 1 .

3.5. Decisional Bilinear Diffie–Hellman (DBDH) Assumption

Let  G 1  be a group of order q; P be a generator of  G 1 ; and  a , b , c , z Z q  be chosen randomly. The DBDH assumption [28] is that it is difficult for a probabilistic polynomial time adversary  A  to distinguish  ( P a , P b , P c , e ( P , P ) a b c )  from  ( P a , P b , P c , e ( P , P ) z ) . The advantage  ε  of  A  is defined as follows:
| P r [ A ( P a , P b , P c , e ( P , P ) a b c ) = 1 ] P r [ A ( P a , P b , P c , e ( P , P ) z ) = 1 ] | ε
If there is no  A  can decide whether  e ( P , P ) z = e ( P , P ) a b c , that is deciding whether  z = a b c  or  z Z q , with a non-negligible advantage, the DBDH assumption holds.

3.6. Adversary Model

We adopt the widely accepted “Dolev–Yao (DY) threat model” [29] for cryptographic analysis of protocol security. A malicious adversary could, according to the assumptions of the DY model, intercept messages sent over public channels. Attackers can also modify, insert, delete, or eavesdrop on hijacked messages.
  • An adversary takes full control of transmitted messages sent over an open wireless channel and learns from the messages. The attacker can then modify, remove, or insert a legitimate message.
  • In polynomial time, an adversary is able to only guess one value, because guessing more than one value at a time is “computationally infeasible”, for example, guessing an ID and password at the same time.
  • An adversary can steal or obtain a valid smart card. The adversary can perform a power analysis attack [30,31] on a smart card to steal sensitive information stored on the smart card.
In addition, this paper adopts the assumption of the “CK adversary model” [32], which is a more powerful attack model considering the actual environment. The CK attack model is considered the de facto standard for modeling key exchange protocols. Therefore, in the CK model, for the session key agreed upon between the communicating parties to be secure, the key exchange protocol must minimize the impact of persistent (long-term) or temporary (short-term) secret leaks.

4. Proposed Data Access Control System for IoT Environments

In this section, we propose a method of access control for IoT data, which overcomes the limitations and security pitfalls of previous access control methods. In addition, the proposed protocol guarantees stronger security through authentication in the existing access control method.

4.1. Setup Phase

TA generates public parameters for use in the system’s attribute-based encryption and blockchain. The following steps are followed:
Step SP1:  T A  generates  G 1  and  G 2  in the same order q, where  G 1  is an additive cyclic group and  G 2  is a multiplicative cyclic group. Then,  T A  generates a bilinear map  e : G 1 × G 1 T A  chooses the secret keys  k T A  and  ζ  in  Z q , and chooses  P G 1 , where P is a generator. Moreover,  T A  chooses the hash functions  h 1 : { 0 , 1 } Z q  and  h 2 : { 0 , 1 } G 1 .
Step SP2:  T A  computes the public key  P K T A = k T A P , a factor of an attribute key  F = P k T A  and a factor for decryption  e ( P , P ) ζ . Then,  T A  publishes ( G 1 , G 2 , q , e , P , P K T A , F , e ( P , P ) ζ , h 1 , h 2 ).

4.2. Registration Phase

For key agreement and authentication,  G W , of the IoT environment,  C S  and  D U  have to register at  T A . This phase runs through a secure channel.

4.2.1. Cloud Server Registration Phase

This phase is also executed over the secure channel:
Step CSR1: A cloud server  C S  picks its identity  I D c s  and generates a random number  c c s C S  computes  P I D c s = I D c s c c s . Then,  C S  sends  P I D c s , c c s  to the trusted authority  T A  through a closed channel.
Step CSR2: After that,  T A  stores  P I D c s  in a its secure database.  T A  computes  R c s = h ( k t a | | c c s )  as  C S ’s private key. After that,  T A  sends  R c s  to  C S  over a secure channel.
Step CSR3:  C S  computes the public key  P K c s = P R c s .

4.2.2. Data User Registration Phase

When a new data user  D U i  registers with  T A , the following steps are followed:
Step UR1:  D U i  chooses unique identity and password  D U I D i  and  D U P W i D U i  generates random nonces  I U i  and  a i , where they are in  Z q . Then,  D U i  computes  H D U I D i = h 1 ( D U I D i | | I U i )  and  H D U P W i = h 1 ( D U I D i | | I U i | | D U P W i ) . After that,  D U i  sends  H D U I D i H D U P W i a i  to  T A  via closed channels.
Step UR2: After  T A  receives the request message,  T A  computes  T I D i = ( H D U I D i k T A ) P K T A  and  A i = T I D i ( H D U P W i a i ) T A  stores  H D U I D i  with  T I D i  in a its secure memory and stores  A i  in a smart card  S C . Then,  T A  issues  S C  to  D U i . At the same time,  T A  sends  h 1 ( T I D i ) , H D U I D i  to  C S  via closed channels.
Step UR3: After receiving  S C D U i  computes  Z i = h 1 ( D U I D i | | D U P W i ) I U i B i = A i a i = T I D i H D U P W i C i = h 1 ( T I D i | | H D U P W i ) , and  D i = r i H D U P W i . Then,  D U i  stores  Z i B i C i  and  D i  into  S C  and computes a public key as  P K i = r i P .
Step UR4: After receiving message,  C S  computes  M C S i = h 1 ( H M I D i | | R c s )  and stores  M C S i  in its secure database.  C S  also stores  h 1 ( T I D i )  with  H D U I D i .

4.2.3. Gateway Registration Phase

In this phase, the following steps are performed in the closed channel:
Step GWR1: A gateway  G W j  chooses identity  G I D j  and generates a random nonce  b j G W  computes  P G I D j = G I D j b j . Then,  G W  generates a public key  P K j = r j P  and sends  P G I D j  to the trusted authority  T A  via closed channels.
Step GWR2: After that,  T A  computes  T G I D j = ( h 1 ( P G I D j ) k T A ) P K T A  and stores  P G I D j  with  T G I D j  in a its secure database. Then,  T A  sends  T G I D j  to  G W j  over a secure channel. At the same time,  T A  sends  h 1 ( P G I D j ) , T G I D j  through secure channels.
Step GWR3:  C S  computes  G C S j = h 1 ( h 1 ( P G I D j | | R c s ) )  and stores  G C S j  in its secure database.  C S  also stores  T G I D j  with  h 1 ( P G I D j ) .

4.3. Attribute Key Generation Phase

In this phase, the data user with attributes  A T T R I i  requests the attribute key from the  T A  and provides the corresponding key.
Step AKG1:  D U  chooses his/her attributes  A T T R I i  and sends it to  T A  to request the attribute key.
Step AKG2: After that,  T A  generates random nonces  r a i , r b i Z q . In addition,  T A  computes  A t i = F ( ζ + r a i )  for all  s A T T R I i , and also computes  A t i s = r a i P + r b i H ( s )  and  A t i s = r b i P . Then,  T A  computes attribute keys  a t t r i = ( A t i , A t i s , A t i s ). Finally,  T A  sends attribute keys  a t t r i  to  D U i .
Step AKG3: After receiving attribute keys,  D U i  uploads the transaction  T x i = ( P K i , A T T R I i )  to the blockchain.

4.4. Authentication and Key Agreement Phase

For uploading the IoT data to the cloud server,  G W j  and  C S  authenticate each other. They authenticate each other to secure mutual trust, and later, by establishing the session key  S K G W j  and  C S  can configure a secure communication channel. The detailed steps involved in this step are shown below and are summarized in Figure 2.
Step AK1: G W j  generates a random number  β i  and timestamp  T 1 , and computes  E i = ( β i r j ) P A U T H j = ( β i r j ) P K c s F i = h 1 ( P G I D j ) A U T H j M C j c = h 1 ( A U T H j | | h 1 ( P G I D j ) | | T 1 ) , and  T A U T H j = T G I D j M C j c . Then,  G W  sends a request message  E i , F i , P K j T A U H T j T 1  to  C S  over an insecure channel.
Step AK2: After receiving the message,  C S  retrieves  h 1 ( P G I D j )  using  T G I D j  and verifies  h 1 ( h 1 ( P G I D j ) | | R c s ) = ? G C S j . If it corrects,  C S  computes  A U T H j = E i R c s h 1 ( h 1 ( P G I D j ) | | β i ) = F i A U T H j , and  M C j c = h 2 ( A U T H j | | h 1 ( P G I D j ) | | T 1 ) . After that,  C S  checks  e ( T A U T H j , P ) = ? e ( ( h 1 ( P G I D j ) M j c ) P K T A , P K T A ) . If they are the same,  G W j  is authenticated. After that,  C S  generates a  n c s  and timestamp  T 2 . In addition,  C S  computes  P c g = ( n c s R c s ) P V c g = ( n c s R c s ) P K j , and  C S  also computes  G i = V c g n c s S K = h 1 ( n c s | | h 1 ( h 1 ( P G I D j ) | | β i ) )  as a session key, and  M c g = h 1 ( h 1 ( P G I D j ) | | V c g | | T 2 ) . Then,  C S  sends a response message  P c g , G i , M c g , T 2  to  G W j  through public channels.
Step AK3: After that,  G W j  checks the validity of  | T 2 T 2 | < Δ T . If it is valid,  G W j  computes  V c g = P c g r j  and  n c s = G i V c g . Then,  G W j  checks  M c g = ? h 1 ( h 1 ( P G I D j ) | | V c g | | T 2 ) . If it holds,  G W j  considers  C S  as authentic and computes the session key shared with  C S  as  S K = h 1 ( n c s | | h 1 ( h 1 ( P G I D j ) | | β i ) ) .
Finally,  G W j  and  C S  complete mutual authentication to generate the same session key  S K  for IoT data upload.

4.5. Data Upload Phase

G W j  uploads IoT data through the session key agreed with  C S . At this time,  G W j  encrypts data through CP-ABE and uploads them to  C S  so that only  D U i  with appropriate attributes can access data sharing. In addition,  G W j  generates the signature value for data verification of  D U i C S  stores encrypted data and uploads  G W j ’s signature value, public key, attribute tree, and stored server address value to the blockchain. Detailed steps related to this phase are provided below.
Step DU1:  G W j  chooses an access tree  T  and root of tree  τ . Then,  G W j  generates a timestamp  T S j  and selects a random polynomial  q τ ( x )  with degree  d τ = v τ 1 G W j  generates a random number  x j = q τ ( 0 )  for a leaf node x of  T . Thereafter,  G W j  computes  c j 1 = D A T A j e ( P , P ) ζ x j c j 2 = P K T A s j .
For other leaf nodes  l e  of  T G W j  chooses a random point  d l e  of polynomial  q l e ( x ) . Then,  G W j  calculates  C l e = P q n ( 0 )  and  C l e = h 2 ( a t t r ( l e ) ) q l e ( 0 )  for all leaf nodes  l e  of  T . The ciphertext consists of  δ j = ( T , c j 1 , c j 2 , C l e , C l e ) G W j  also computes the signature of data as follows.  G W  computes  s j = h 1 ( P G I D j | | r j | | D A T A j ) S j = s j P , and  S i g j = s j + h 1 ( P K j | | δ j ) r j  as the signature. Finally,  G W j  sends  ( S j , S i g j , δ j , T S j ) S K , h 1 ( P K j | | δ j | | T S j )  to  C S  through a open channel.
Step DU2: After that,  C S  decrypts  ( S i g j , δ j , T S j )  using the session key and checks  h 1 ( P K j | | δ j | | T S j ) . If these values are equal,  C S  stores  δ j  in its database and sets  A D D R j  to the record address. At the end,  C S  uploads the transaction  T x j = ( S j , S i g j , P K j , T , h 1 ( δ j | | P K j ) , A D D R j )  to the blockchain.

4.6. Data Request and Provide Phase

Step DRP1:  D U i  inserts the smartcard  S C  and inputs  D U I D i  and  D U P W i . Then,  S C  computes  I U i = Z i h 1 ( D U I D i | | D U P W i ) H D U P W i = h 1 ( D U I D i | | I U i | | D U P W i ) , and  T I D i = B i H D U P W i S C  checks  C i = ? h 1 ( T I D i | | H D U P W i ) . If it is valid,  D U i  generates random nonce  r d u  and timestamp  T S i , and computes  r i = D i H D U P W i M C i c = h 1 ( A U T H i | | h 1 ( D U I D i | | I U i ) | | T S i ) A I D i = T I D i M C i c . After that,  D U i  obtains the transaction  ( S i g j , P K j , T , h 1 ( δ j | | P K j ) , A D D R j ) D U i  computes  M 1 = ( P K i | | A D D R j | | r d u | | T S i ) + r i P K c s  and sends the data request message  h 1 ( T I D i ) A I D i P K i T S i M 1 .
Step DRP2: After receiving the message,  C S  retrieves  H D U I D i  using  h 1 ( T I D i )  and verifies  h 1 ( H D U I D i | | R c s ) = ? M C S i . If it holds,  C S  computes  A U T H i = P K i R c s  and  M C i c = h 1 ( A U T H i | | H D U I D i | | T S i ) . Then,  C S  checks  e ( A I D i , P ) = ? e ( ( H D U I D i M C i c ) P K T A ) , P K T A ) . If this equality holds,  C S  obtains  ( P K i , A T T R I i )  from the blockchain. Then,  C S  computes  ( P K i | | A D D R j | | r d u | | T S i ) = M 1 R c s P K i  and confirms that  A T T R I i  satisfies tree of  δ j . If it is met,  C S  calculates  M 2 = ( δ j | | T c s ) + R c s P K i . Then,  C S  sends the message  M 2 A I D i T S c s .
Step DRP3: After receiving the message,  D U i  computes  ( δ j | | T S c s ) = M 2 r i P K c s . Then,  D U i  checks  h 1 ( δ j | | P K j ) = ? h 1 ( δ j | | P K j )  acquired on the blockchain. Depending on the type of root node, data decryption proceeds as follows.
  • Case 1: If  τ  is a leaf node,  D U i  calculates  e ( A t i , C l e )  and  e ( A t i , C l e ) . Then,  D U i  computes  A t i s , C l e  and  A t i s , C l e . Then,  D U i  computes  e ( A t i s , C l e ) e ( A t i s , C l e ) = e ( P , P ) r a i q τ ( 0 ) = K  for data decryption. Thereafter,  D U i  can decrypt as follows:
    c j 1 e ( c j 2 , A t i ) / K = D A T A j e ( P , P ) ζ x i e ( x i P K T A , F ( ζ + r a i ) ) / K = D A T A j e ( P , P ) ζ x i e ( P , P ) x i ( ζ + r a i ) / K = D A T A j
  • Case 2: We assume that root node  τ  is a threshold gate and child nodes are attributes. Before we describe the decryption computation, we define the symbols  c τ  and  Δ i n d ( l e ) , c τ ( x ) c τ  is a set of child nodes of the root node, and  Δ i n d ( l e ) , c τ ( x )  is Lagrange coefficient, where  Δ i n d ( l e ) , c τ ( x ) = Π o c τ , i n d ( o ) i n d ( l e ) x i n d ( o ) i n d ( l e ) i n d ( o ) .
    D U i  computes  e ( A t i s , C l e ) e ( A t i s , C l e ) = e ( P , P ) r a i q τ ( 0 ) = K l e  for all leaf nodes  l e . After that,  D U i  computes decrypt key:
    l e K l e i n d ( l e ) , c τ ( 0 ) = l e ( e ( P , P ) r a i q l e ( 0 ) ) i n d ( l e ) , c τ ( 0 ) = l e ( e ( P , P ) r a i q τ ( i n d ( l e ) ) i n d ( l e ) , c τ ( 0 ) = e ( P , P ) r a i q τ ( 0 ) = K
    Then,  D U i  can decrypt the IoT data.

4.7. Data Validation Phase

If the data users want to verify that the gateway information is correct, data verification can be performed during this phase. This data validation ensures that the gateway is accountable for its own data and that the data user can obtain the reliability of the data. A detailed description of this phase is provided bellow:
Step DVP: D U i  obtains  S j S i g j P K j , and  h 1 ( δ j | | P K j )  from the transaction related to the data.  D U i  computes  S i g j P = s j P + h 1 ( P K j | | δ j ) r j P = S j + h 1 ( P K j | | δ j ) P K j . Then,  D U i  checks  S j = S i g j h 1 ( P K j | | δ j ) P K j . If it is valid,  D U i  can be considered as data validation completed.

4.8. Block Formation and Addition Phase

In the key generation phase and data upload phase,  D U i  and  C S  create a transaction and upload it to the blockchain. We describe it in detail in terms of  C S  in this section, and the block construction and addition of  D U i  is similar. The “practical Byzantine fault tolerance (PBFT) consensus algorithm” [26] has been applied for adding blocks to existing blockchains, verifying blocks, and voting-based consensus algorithms. The block structure is depicted in Figure 3, and the entire algorithm of block addition is given in Algorithm 1.
Algorithm 1 PBFT Consensus for Block Addition in Blockchain by Cloud Server
  1:
Input: Block  ( B l o c k m  as shown in Figure 3, transactions pool  ( T x p o l ) , transactions threshold  ( T x t h r e s h = t , number of  C S  nodes:  n c s , minimal approval  ( M i n a p p r o v e = 2 ( n c s 1 ) / 3 + 1 )
  2:
Output: Commitment for block addition ( C M P )
  3:
Assume that a cloud server node ( C S l ) is elected as a leader
  4:
C S l  picks a fresh timestamp and creates a block  B l o c k m  with  T x p o o l
  5:
C S l  sets  C M P = N U L L  and sends  B l o c k m  to follower cloud server nodes ( C S k ( k l | k = 1 , 2 , , n c s ) ) for voting request
  6:
for each follower  C S j  do
  7:
   if (( T x j = v a l i d ) and ( M R = v a l i d ) and ( E C D S A . s i g T x = v a l i d ) and ( C B H a s h = v a l i d )) then
  8:
     Set  C M P = C M P + 1
  9:
   end if
 10:
end for
 11:
if ( C M P M i n a p p r o v e ) then
 12:
   Add  B l o c k m  to the blockchain
 13:
   Broadcast commitment message to  C S
 14:
end if

4.8.1. Block Formation Phase

At the data upload phase of our system, the data generated by  G W j  are uploaded to  C S  using  S K  agreed between  G W j  and  C S  at the authentication and key agreement phase.  C S  safely gathers t counts of data, filters that information, and then generates t counts of transactions  T x j = ( S j , S i g j , P K j , T , h 1 ( δ j | | P K j ) , A D D R j ) , for  j =  1, 2,…, t, to contribute to the transactions pool. To describe this in detail in terms of the data upload phase,  C S  computes the Merkle tree root ( M R ) for transactions  T x j  and calculates “elliptic curve digital signature” for transactions  T x j  as  E C D S A . s i g T x = E C D S A . s i g g e n ( T x m s g ) , where  T x m s g = h 1 ( T x 1 | | T x 2 | | | | T x j | | P K c s | | M R ) .

4.8.2. Block Addition Phase

After block formation phase, the  M R  for the transaction existing in the block is verified. In addition,  C S  conducts a voting-based PBFT consensus algorithm. The  C S  nodes  C S l | l = 1 , 2 , , n c s  ( n c s  represent the number of peers in  C S ) form a distributed P2P network. Here, each  C S  node is considered a peer node that is responsible for adding blocks. After the  C S  peer node receives the  B l o c k m , peer node verifies it with the existing transaction pool. When all transactions in  B l o c k m  are confirmed by the transaction pool, the peer puts a valid vote into the commit message pool.  C S  constantly checks the commit message pool and checks when the minimum approval  ( M i n a p p r o v e )  for block additions on the blockchain is reached; where  M i n a p p r o v e = 2 ( n c s 1 ) / 3 + 1 , the new block  B l o c k m  will be added to the blockchain.

5. Formal Security Validation: AVISPA Simulation Study and IND-CPA

In this section, we utilize the “AVISPA simulation tool” [10] and IND-CPA to verify the security of the proposed system.

5.1. AVISPA Simulation

We use the “AVISPA Simulation Tool” [10] in this section to validate our proposed system security against man-in-the-middle and replay attacks.
In AVISPA, there are four backends: “tree automata based on automatic approximations for analysis of security protocols (TA4SP)”, the “SAT-based model checker (SATMC)”, the “on-the-fly-mode-checker (OFMC)” and the “constraint-logic-based attack Searcher” (CL-AtSe)”. Among these, the SATMC and TA4SP backends can not aid the “bitwise exclusive OR (XOR)”. However, since our system has an XOR operation, two backends are not suitable for analysis. Therefore, we adopt two backends, OFMC and CL-AtSe, which support XOR operation, and use them for analysis. In the proposed system, “High-Level Protocol Specification Language (HLPSL)”, a language supported by AVISPA, is used to implement the basic roles of  C S  and  G W j . Figure 4 shows the HLPSL implementation of the role user.
At transition 1,  G W  sends the request message  { P G I D j } to  T A  using  S N D  operation and  S K g w t a , which means the secure channel. The declaration  s e c r e t ( { B j , R j } , s p 3 , { G W } )  means that the random nonce  B j  and secret key  R j  are only known to  G W .
At transition 2,  G W  receives the  T G I D j  from  T A . In login and authentication phase,  G W  sends the message  { E i , F i , T G I D j , P K j , T A U T H j , T 1 }  to  C S  through insecure channel. The declaration  w i t n e s s ( G W , C S , g w _ c s _ b e i , B e i )  means that  G W  generates a random nonce  β i  for  C S .
At transition 3,  G W  receives the message  { P c g , G i , M c g , T 2 }  from  C S . The declaration  r e q u e s t ( C S , G W , c s _ g w _ n c s , N c s )  specifies that  C S  request to the  G W  for checking the value of  n c s .
HLPSL of cloud server is implemented similarly to gateway’s HLPSL. In addition, it implements “composite roles and goals for sessions and environment” of the proposed system through HLPSL. AVISPA used in this section is a security validation simulation based on the DY model [30]. Figure 5 gives the analysis results performed on the CL-ATse and OFMC backends. The figure clearly shows that the proposed system can be resistant to “replay and man-in-the-middle attacks”.

5.2. IND-CPA Security

We prove the confidentiality property of our system with the game of IND-CPA. In our scheme, the game is defined as follows.
  • Init. The adversary  A  gives a challenge access structure  T .
  • Setup. The simulator  X  executes Setup phase and sends the public parameters to the adversary  A .
  • Phase 1.  A  queries multiple private keys corresponding to  q 1  different sets of attributes  ( A T T R I 1 , , A T T R I q 1 )  where  A T T R I i T .
  • Challenge.  A  submits two plaintext  D A T A 0  and  D A T A 1 , where  | D A T A 0 | = | D A T A 1 |  to the simulator  X  with  T X  flips the coin  b { 0 , 1 } , encrypts  D A T A b  under  T , and sends the ciphertext  C T  to  A .
  • Phase 2.  A  repeats Phase 1 with the attribute sets  ( A T T R I q 1 + 1 , , A T T R I q )  where  A T T R I i T .
  • Guess.  A  outputs a guess  b  of b to the simulator  X . If  b = b A  wins the game.
The adversary  A ’s advantage  ε  in this game is defined as  ε = | P r [ b = b ] 1 2 | . If  A  in probabilistic polynomial time can be played with a non-negligible advantage  ε , then we prove that the problem of the DBDH assumption can be solved with  ε / 2 .
Proof. 
Assume that the adversary  A  wants to take advantage of  ε  to subvert the system. We build a  X  simulator to play the DBDH game with a  ε / 2  advantage. We proceed through the simulation process as follows. The  B  challenger randomly picks  a , b , c , z Z q  and generator  P G 1 B  flips a coin to obtain a random value  μ { 0 , 1 } . If  μ = 1 Z = e ( P , P ) z , which means  ( P a , P b , P c , e ( P , P ) z ) . Otherwise,  Z = e ( P , P ) a b c  means  ( P a , P b , P c , e ( P , P ) a b c ) . After that,  B  transmits the results to  X .
Init. The simulator  X  runs  A  to create access structure  T  that  A  hopes to attack. Then,  A  transmits it to  X .
Setup.  X  computes public parameters  { P K T A = k T A P , F = P k T A , e ( P , P ) ζ } , where  ζ = a b . Then,  X  sends them to  A .
Phase 1.  A  requests multiple private keys  ( a t t r i 1 , , a t t r i q 1 )  corresponding to  q 1  different sets of attributes  ( A T T R I 1 , , A T T R I q 1 )  where  A T T R I i T . The simulator  X  generates random nonces  r a i , r b i Z q X  computes  A t i = F ( ζ + r a i )  for all  s A T T R I i A T i s = r a i P + r b i H ( s ) A t i s = r b i P a t t r i = ( A t i , A t i s , A t i s ) . Then,  X  sends  a t t r i  to  A .
Challenge.  A  submits  T  to the  X  simulator with plain text  D A T A 0  and  D A T A 1  of equal length.  X  randomly tosses a coin to obtain  b { 0 , 1 } . If  μ = 0 , then  Z = e ( P , P ) a b c . In this case, we let  x j = c , then  e ( P , P ) a b c = e ( P , P ) ζ x j  and  c j 1 = D A T A b e ( P , P ) a b c . Otherwise, if  μ = 1 , then  Z = e ( P , P ) z  and  c j 1 = D A T A b e ( P , P ) z X  computes  c j 2 = P K T A s j . Then,  X  chooses a random point  d l e  of polynomial  q l e ( x )  and computes  C l e = P q n ( 0 ) C l e = h 2 ( a t t r ( l e ) ) q l e ( 0 )  for all leaf nodes  l e  of  T . Then,  X  sends  δ j = ( c j 1 , c j 2 , C l e , C l e )  to  A .
Phase 2. The adversary  A  repeats Phase 1 to obtain the private keys that are associated with attribute sets  A T T R I i | q 1 + 1 i q  and  A T T R I i T .
Guess.  A  guesses  b  of b. If  b b X  gives a result 1, otherwise, it gives a result 0. If  X  gives a result 0, then  Z = e ( P , P ) a b c A  can obtain practical ciphertext  δ j . The advantage in this case is  ε , so we obtain  P r [ b = b | Z = e ( P , P ) a b c ] = 1 2 + ε . When  X  gives a result 0, it means  Z = e ( P , P ) z A  obtains the wrong ciphertext, and does not have the advantage of guessing the correct  b , so it is able to obtain  P r [ b b | Z = e ( P , P ) z ] = 1 2 . Therefore, the probability  P r  of a successful game is
P r = 1 2 P r [ A ( P , P a , P b , P c , e ( P , P ) a b c ) = 1 ] + 1 2 P r [ A ( P , P a , P b , P c , e ( P , P ) z ) = 1 ] 1 2 = 1 2 P r [ b = b | Z = ( P , P ) a b c ] + 1 2 P r [ b b | Z = e ( P , P ) z ] 1 2 = 1 2 × ( 1 2 + ε ) + 1 2 × 1 2 1 2 = ε 2
Therefore, our scheme ensures IND-CPA security.

6. Informal Security Analysis

We provide an nonmathematical (informal) security analysis of whether the proposed system can provide various security features and safety against possible attacks.

6.1. Correctness of Data Decryption Key

If the leaf node  l e  is a root node  τ , we check the correctness of the decryption key as follows:
e ( A t i s , C l e ) e ( A t i s , C l e ) = e ( r a i P + r b i h 2 ( a t t r ( τ ) ) , q τ ( 0 ) P ) e ( r b i P , h 2 ( a t t r ( τ ) ) q τ ( 0 ) ) = e ( r a i P , q τ ( 0 ) P ) e ( r b i h 2 ( a t t r ( τ ) ) , q τ ( 0 ) P ) e ( r b i P , h 2 ( a t t r ( τ ) ) q τ ( 0 ) ) = e ( P , P ) r a i q τ ( 0 ) e ( h 2 ( a t t r ( τ ) ) , P ) r b i q τ ( 0 ) e ( P , h 2 ( a t t r ( τ ) ) ) r b i q τ ( 0 ) = e ( P , P ) r a i q τ ( 0 ) = K

6.2. Guessing Attacks

The malicious adversary  A  cannot guess the data user’s  D U I D i  and  D U P W i  in the proposed system.  A  obtains the credentials  { Z i , B i , C i , D i }  stored on the smart card. However, since  { Z i , B i , C i }  is encrypted with random numbers  I U i  and  a i A  cannot obtain sensitive information. Furthermore, these values are protected via “a one-way collision-free hash function  h ( · ) ”. In addition,  D i  is masked by the unknown parameter  H D U P W i  and secret key  r i . As a result, our proposed system can resist guessing attacks.

6.3. Tracing Attacks and Provides Anonymity

The adversary  A  is trying to obtain the real IDs of  D U i  and  G W j  to perform a tracking attack. In our system, the user’s real identity  D U I D i  is hidden by  H D U I D i  masked with a random number  I U i . In addition, the  D U i  sends the message through the public channel using the temporary ID  T I D i  received from  T A  via an insecure channel. Moreover,  G W j  hides its real ID  G I D j  as  P G I D j G W j  sends a message through the public channel with the temporary ID  T G I D j  obtained from  T A . So,  A  cannot know original IDs  D U I D i  and  G I D j . This demonstrates that our system provides anonymity and can resist tracing attacks.

6.4. Impersonation Attacks

A  may attempt to impersonate each entity by calculating legitimate messages to obtain information. In our system, messages sent over public channels are encrypted using random numbers  β i n c s x i , and  r d u  and secret values  r j  and  R c s . Moreover, in the data upload phase, the message is encrypted by the session key  S K A  tries to take out these values, but this cannot be carried out. In addition, each of the entities check  e ( T A U T H j , P ) = ? e ( ( h 1 ( P G I D j ) M j c ) P K T A , P K T A ) M c g = ? h 1 ( h 1 ( P G I D j ) | | V c g | | T 2 ) , and  e ( A I D i , P ) = ? e ( ( H M I D i M C i c ) P K T A ) , P K T A ) . Therefore, the proposed system can provide protection against impersonation attacks.

6.5. Ephemeral Secret Leakage Attacks

In the authentication and key agreement phase,  G W j  and  C S  establish the session key  S K = h 1 ( n c s | | h 1 ( h 1 ( P G I D j ) | | β i ) ) = h 1 ( n c s | | h 1 ( h 1 ( G I D j b j ) | | β i ) )  in our system. The  S K  depends on “ephemeral secrets  n c s  and  β i ” and long-term secret  b j . Even if the attacker “short-term secret  n c s  and  β i ” is compromised for  A , guessing  S K  without long-term secret  b j  is “a computationally difficult problem.” Likewise, even if “long-term secret  b j ” is compromised to  A , deriving  S K  is also “computationally difficult. except for short-term secrets. Since  S K  between the gateway and the cloud server is distinct and unique, leaking  S K  from a session to  A  is “computationally infeasible” as it applies both short-term and long-term secrets without having to compute another session key in another session. Therefore, the proposed system prevents ephemeral secret leakage attacks.

6.6. Mutual Authentication and Key Agreement

At our system,  G W  and  C S  use the  T A U T H j  and  M c g  values to authenticate each other by verifying the message. Every transmitted message is changed with a random number and current timestamps.  G W  and  C S  authenticate each other through an authentication and key agreement phase and compute the same session key  S K  only if the authentication is complete. Therefore, our system provides key agreement through mutual authentication.

6.7. Data Access Control, Validation and Accountability

The proposed system can provide access control to IoT data of  G W j G W j  establishes an access tree for IoT data and uses it to encrypt data and upload them to  C S . Then, only  D U i  with the appropriate set of attributes in the IoT data’s access tree is able to request data from  C S  and decrypt them with the attribute key. In addition,  G W j  uploads the signature value of its own data to the transaction on the blockchain.  D U i  can confirm that the data are uploaded by  G W j  through the signature value of the transaction, which means that  G W j  guarantees accountability for its own data when uploading. Thus, the system can provide data access control, validation, and accountability.

7. Efficiency Features and Security Analysis

The proposed system is compared with existing competitive data access control systems in the smart city area, such as smart health and smart homes [18,24]. The compared schemes are all schemes using attribute-based encryption. We compare different data access control schemes with each other in terms of communication and communication costs, function, and security features.

7.1. Testbed Experiment Using MIRACL

In this section, we apply MIRACL to show an an environment for practical perspective experiments. The MIRACL testbed experiment shows the computation costs of the proposed system. We performed a testbed experiment with cryptographic primitives using the popular “MIRACL” [11] in a laptop environment. Here are the detailed performance details of the laptops we used: “Ubuntu 18.04.4 LTS with memory 8 GiB, processor: Intel Core i7-4790 @ 3.60 GHz × 4, CPU Architecture: 64-bit”. The experiments were run 100 times to determine the time to run “bilinear pairing operation  ( T p a i r ) ”, “ECC signature operation  ( T s i g ) , “ECC scalar point multiplication  ( T m u l ) ”, “ECC point addition  ( T a d d ) ”, “modular exponentiation operation  ( T e x p ) ”, “map-to-point-hash-function  ( T m t p ) ”, “encryption function  ( T e n c ) ”, “decryption function  ( T d e c ) ”, and “one-way-hash-function  ( T h ) ”. Thereafter, the average execution time in milliseconds for these functions or operations over 100 run was recorded: 6.587 ms, 0.546 ms, 2.547 ms, 0.013 ms, 0.164 ms, 7.564 ms, 0.001 ms, 0.001 ms, and 0.003 ms, respectively.

7.2. Security and Function Feature Comparison

This section presents the results of comparison of the proposed system with related existing approaches in terms of security and functionality. Table 2 presents the results of the comparison. Previous studies do not provide data accountability, nor do they provide the functions of mutual authentication and key agreement, whereas the proposed method meets all essential security and functional requirements for data access control in a smart city environment.

7.3. Computation Cost Comparison Analysis

Computational costs are compared, taking into account the data upload and data request and provide phases, and follow the testbed experiment results reported in Section 7.1.
We use the average time required on the platform for the data owner/gateway/IoT device, cloud server, and data user costs, respectively. Table 3 shows the comparison results of the computation costs. In Table 3, n means the number of attributes. We assumed that n is 5 to obtain the total computation costs. It can be observed that the total computational costs of our system are slightly higher than those of the other systems. The proposed system uses traditional CP-ABE, which has proven safety rather than efficiency. Moreover, as shown in Table 2, the proposed system can provide mutual authentication, key agreement, and data accountability that other systems cannot provide, and it is safe against attacks from various security aspects.

7.4. Communication Cost Comparison Analysis

For comparison analysis of the communication costs during the data upload and data request and provide phases between the proposed system and other systems, the l column matrix, encryption data, hash function output value (using SHA-256), public key, identity, ECC value, chain code, index, and timestamp are taken as  32 l  bits, 256 bits, 256 bits, 256 bits, 160 bits, 256 bits, 256 bits, 256 bits, and 32 bits, respectively.
Table 4 indicates that our system requires communication costs of 2112 bits to exchange three messages for data upload and data download. On the other hand, the schemes of Lu et al. [18] and Qin et al. [24] require communication costs of  32 l + 1952 bits for three messages and 2208 bits for three messages.

8. Conclusions

In this paper, we proposed an access control system for IoT data in various IoT environments based on CP-ABE and blockchains. Existing systems do not provide mutual authentication and key agreement for secure communication. However, the proposed system guarantees secure communication through these two properties. In addition, the proposed system can provide data validation and accountability to data users. To verify the safety of our system, formal and unofficial security analysis was performed, and the proposed system was compared and analyzed with existing systems in terms of security and functionality. Through the analysis results, it was found that the proposed system is safe against guessing, tracing, ESL, and session key disclosure attacks, unlike existing systems. In addition, our protocol can be said to be an efficient protocol because it has a computation cost similar to or lower than that of existing systems and a lower communication cost than existing systems.
In the future, we plan to design a more efficient access control system. In this paper, we used the traditional CP-ABE, but we need to design an efficient ABE for a more efficient system design. In traditional CP-ABE, when the number of users or the number of attributes increase, the number of pairing operations increases. This will increase the computational cost of the system, which will make it impossible to provide real-time services to users in the IoT environment. In order to solve this problem, there is a need to study a new method of access control in the future. If we develop an efficient access control method even if the number of users and attributes increases, we will be able to design an access control system that is more suitable for the IoT environment.

Author Contributions

Conceptualization, J.L., K.P. and Y.P.; software, A.B. and A.K.D.; verification, A.B. and A.K.D.; validation, M.K., K.P. and S.N.; formal analysis, J.L. and M.K.; investigation, K.P. and S.N.; writing—original draft preparation, J.L.; writing—review and editing, S.N., A.K.D. and Y.P.; supervision, Y.P.; funding acquisition, K.P. and S.N. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by Electronics and Telecommunications Research Institute(ETRI) grant funded by the Korean government. [23ZR1330, Core Technology Research on Trust Data Connectome].

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Holst, A. Volume of Data/Information Created, Captured, Copied, and Consumed Worldwide from 2010 to 2024. Statista. 2020. Available online: https://www.statista.com/statistics/871513/worldwide-data-created/ (accessed on 30 January 2021).
  2. Juliadotter, N.V.; Choo, K.K.R. Cloud attack and risk assessment taxonomy. IEEE Cloud Comput. 2015, 2, 14–20. [Google Scholar] [CrossRef]
  3. Osanaiye, O.; Choo, K.K.R.; Dlodlo, M. Distributed denial of service (DDoS) resilience in cloud: Review and conceptual cloud DDoS mitigation framework. J. Netw. Comput. Appl. 2016, 67, 147–165. [Google Scholar] [CrossRef]
  4. Chen, X.; Li, J.; Huang, X.; Ma, J.; Lou, W. New publicly verifiable databases with efficient updates. IEEE Trans. Dependable Secur. Comput. 2015, 125, 546–556. [Google Scholar] [CrossRef]
  5. Sahai, A.; Waters, B. Fuzzy identity-based encryption. In Proceedings of the Advances in Cryptology–EUROCRYPT 2005: 24th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Aarhus, Denmark, 22–26 May 2005; pp. 457–473. [Google Scholar]
  6. Bethencourt, J.; Sahai, A.; Waters, B. Ciphertext-policy attribute based encryption. In Proceedings of the 2007 IEEE Symposium on Security and Privacy (SP’07), Berkeley, CA, USA, 20–23 May 2007; pp. 321–334. [Google Scholar]
  7. Xie, S.; Zheng, Z.; Chen, W.; Wu, J.; Dai, H.-N.; Imran, M. Blockchain for cloud exchange: A survey. Comput. Electr. Eng. 2020, 81, 106526. [Google Scholar] [CrossRef]
  8. Nakamoto, S. Bitcoin: A Peer-To-Peer Electronic Cash System. 2008. Available online: http://bitcoin.org/bitcoin.pdf (accessed on 23 January 2023).
  9. Weerapanpisit, P.; Trilles, S.; Huerta, J.; Painho, M. A Decentralized Location-Based Reputation Management System in the IoT Using Blockchain. IEEE Internet Things J. 2022, 9, 15100–15115. [Google Scholar] [CrossRef]
  10. AVISPA. Automated Validation of Internet Security Protocols and Applications. Available online: http://www.avispa-project.org/ (accessed on 23 January 2023).
  11. MIRACL Cryptographic SDK: Multiprecision Integer and Rational Arithmetic Cryptographic Library. Available online: https://github.com/miracl/MIRACLAccessed (accessed on 23 January 2023).
  12. Ling, C.; Newport, C. Provably secure ciphertext policy ABE. In Proceedings of the 14th ACM Conference on Computer and Communications Security, Alexandria, VA, USA, 29 October–2 November 2007; pp. 456–465. [Google Scholar]
  13. Lewko, A.; Waters, B. Decentralizing attribute-based encryption. In Proceedings of the Advances in Cryptology–EUROCRYPT 2011: 30th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Tallinn, Estonia, 15–19 May 2011; pp. 568–588. [Google Scholar]
  14. Yeh, L.Y.; Chiang, P.Y.; Tsai, Y.L.; Huang, J.L. Cloud-based fine-grained health information access control framework for lightweight IoT devices with dynamic auditing and attribute revocation. IEEE Trans. Cloud Comput. 2015, 6, 532–544. [Google Scholar] [CrossRef]
  15. Miao, Y.; Ma, J.; Liu, X.; Li, X.; Liu, Z.; Li, H. Practical attribute-based multi-keyword search scheme in mobile crowdsourcing. IEEE Internet Things J. 2017, 5, 3008–3018. [Google Scholar] [CrossRef]
  16. Liu, Y.; Zhang, Y.; Ling, J.; Liu, Z. Secure and fine-grained access control on e-healthcare records in mobile cloud computing. Future Gener. Comput. Syst. 2018, 78, 1020–1026. [Google Scholar] [CrossRef]
  17. Ding, S.; Li, C.; Li, H. A novel efficient pairing-free CP-ABE based on elliptic curve cryptography for IoT. IEEE Access 2018, 6, 27336–27345. [Google Scholar] [CrossRef]
  18. Lu, X.; Pan, Z.; Xian, H. An efficient and secure data sharing scheme for mobile devices in cloud computing. J. Cloud Comput. 2020, 91, 1–13. [Google Scholar] [CrossRef]
  19. Zhang, Y.; He, D.; Choo, K.K.R. BaDS: Blockchain-based architecture for data sharing with ABS and CP-ABE in IoT. Wirel. Commun. Mob. Comput. 2018, 2018, 1–9. [Google Scholar] [CrossRef]
  20. Ding, S.; Cao, J.; Li, C.; Fan, K.; Li, H. A novel attribute-based access control scheme using blockchain for IoT. IEEE Access 2019, 7, 38431–38441. [Google Scholar] [CrossRef]
  21. Guo, R.; Shi, H.; Zheng, D.; Jing, C.; Zhuang, C.; Wang, Z. Flexible and efficient blockchain-based ABE scheme with multi-authority for medical on demand in telemedicine system. IEEE Access 2019, 7, 88012–88025. [Google Scholar] [CrossRef]
  22. Yang, X.; Li, T.; Pei, X.; Wen, L.; Wang, C. Medical data sharing scheme based on attribute cryptosystem and blockchain technology. IEEE Access 2020, 8, 45468–45476. [Google Scholar] [CrossRef]
  23. Wei, X.; Yan, Y.; Guo, S.; Qiu, X.; Qi, F. Secure Data Sharing: Blockchain enabled Data Access Control Framework for IoT. IEEE Internet Things J. 2021, 9, 8143–8153. [Google Scholar] [CrossRef]
  24. Qin, X.; Huang, Y.; Yang, Z.; Li, X. LBAC: A lightweight blockchain-based access control scheme for the internet of things. Inf. Sci. 2021, 554, 222–235. [Google Scholar] [CrossRef]
  25. Son, S.; Lee, J.; Kim, M.; Yu, S.; Das, A.K.; Park, Y. Design of secure authentication protocol for cloud-assisted telecare medical information system using blockchain. IEEE Access 2020, 8, 192177–192191. [Google Scholar] [CrossRef]
  26. Castro, M.; Liskov, B. Practical Byzantine fault tolerance and proactive recovery. Acm Trans. Comput. Syst. (TOCS) 2002, 204, 398–461. [Google Scholar] [CrossRef]
  27. Macdonald, M.; Liu-Thorrold, L.; Julien, R. The blockchain: A comparison of platforms and their uses beyond bitcoin. Work. Pap. 2017, 1–18. [Google Scholar] [CrossRef]
  28. Goyal, V.; Pandey, O.; Sahai, A.; Waters, B. Attribute-based encryption for fine-grained access control of encrypted data. In Proceedings of the 13th ACM Conference on Computer and Communications Security, Alexandria, VA, USA, 30 October–3 November 2006; pp. 89–98. [Google Scholar]
  29. Dolev, D.; Yao, A.C. On the security of public key protocols. IEEE Trans. Inf. Theory 1983, 29, 198–208. [Google Scholar] [CrossRef]
  30. Kocher, P.; Jaffe, J.; Jun, B. Differential power analysis. In Advances in Cryptology–CRYPTO (Lecture Notes in Computer Science); Springer: Santa Barbara, CA, USA, 1999; Volume 1666, pp. 388–397. [Google Scholar]
  31. Messerges, T.S.; Dabbish, E.A.; Sloan, R.H. Examining smart-card security under the threat of power analysis attacks. IEEE Trans. Comput. 2002, 51, 541–552. [Google Scholar] [CrossRef]
  32. Canetti, R.; Krawczyk, H. Universally Composable Notions of Key Exchange and Secure Channels. In Proceedings of the International Conference on the Theory and Applications of Cryptographic Techniques (EUROCRYPT’02), Amsterdam, The Netherlands, 28 April–2 May 2002; pp. 337–351. [Google Scholar]
Figure 1. Proposed system model (author’s own processing).
Figure 1. Proposed system model (author’s own processing).
Sensors 23 05173 g001
Figure 2. Authentication and key agreement phase (author’s own processing).
Figure 2. Authentication and key agreement phase (author’s own processing).
Sensors 23 05173 g002
Figure 3. Formation of a block on the transactions by CS (author’s own processing).
Figure 3. Formation of a block on the transactions by CS (author’s own processing).
Sensors 23 05173 g003
Figure 4. HLPSL specification for user (Author’s own processing).
Figure 4. HLPSL specification for user (Author’s own processing).
Sensors 23 05173 g004
Figure 5. Simulation results on OFMC and CL-AtSe.
Figure 5. Simulation results on OFMC and CL-AtSe.
Sensors 23 05173 g005
Table 1. Notations (author’s own processing).
Table 1. Notations (author’s own processing).
Notations & AbbreviationsMeanings
IoTInternet of Things
ABEAttribute-based encryption
CP-ABECiphertext-policy ABE
DBDHDecisional bilinear Diffie-Hellman
D U i D U I D i D U P W i ith data user
and his/her identity and password, respectively
G W j G I D i jth gateway and its identity, respectively
C S I D c s Cloud server and its identity, respectively
  H D U I D i , P G I D j , P I D c s The hidden identity of data user,
gateway, and cloud server, respectively
  T A Trusted authority
R c s r i r j k T A The secret key of  C S D U i G W j , and  T A , respectively
P K c s P K i P K j P K T A The public key of  C S D U i G W j , and  T A , respectively
  A T T R I i The attribute of  D U i
  a t t r i The attribute private key of  D U i
T τ Access tree and root of tree
  S K The session key established among  G W j  and  C S
KThe data decryption key
  h 1 , h 2 Hash function and map-to-point hash function
  | | Data concatenation operator
Bitwise exclusive-or operator
Table 2. Security and function properties comparison (Author’s own processing).
Table 2. Security and function properties comparison (Author’s own processing).
Security and Function PropertiesLu et al. [18]Qin et al. [24]Proposed
  S F 1 x-o
  S F 2 x-o
  S F 3 ooo
  S F 4 xoo
  S F 5 --o
  S F 6 --o
  S F 7 xxo
  S F 8 ooo
  S F 9 xxo
o: provide the security property x: does not provide the security property -: does not consider  S F 1 : Guessing attack  S F 2 : Anonymity and tracing attacks  S F 3 : Replay and man-in-the-middle attacks  S F 4 : Impersonation attack  S F 5 : ESL attack  S F 6 : Session key disclosure attack  S F 7 : Mutual authentication and key agreement  S F 8 : Data validation  S F 9 : Data accountability.
Table 3. Computation costs comparison (Author’s own processing).
Table 3. Computation costs comparison (Author’s own processing).
SystemData Owner/GatewayCloud ServerData UserTotal Costs
Lu et al. [18]   ( 1 + n ) T m u l + 2 T e x p + T h   T h + T s i g + ( n ) T e x p   T p a i r + 2 T m u l 110.307 ms
15.613  ms + ( 3 + n ) T m u l + ( 2 n ) T p a i r 83.013  ms 11.681  ms
Qin et al. [24]   5 T m u l + 9 T e x p + T a d d + 4 T h   ( 8 + 6 n ) T m u l + 6 T p a i r   T e x p + 2 T m u l 156.802 ms
14.236  ms 137.308  ms 5.258  ms
Proposed   ( 4 + 2 n ) T m u l + ( n ) T m t p + 2 T h + T p a i r   3 T h + 2 T m u l + 2 T a d d + T p a i r   5 T m u l + ( n ) T p a i r + ( n ) T e x p 138.305 ms
+ T a d d + T e n c 80.081  ms 11.716  ms + 6 T h 46.508  ms
n: number of attribute (assuming that n = 5).
Table 4. Communication costs comparison (Author’s own processing).
Table 4. Communication costs comparison (Author’s own processing).
SystemNumber of MessagesNumber of Bits
Lu et al. [18]3 32 l  + 1952
Qin et al. [24]32208
Proposed32112
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Lee, J.; Kim, M.; Park, K.; Noh, S.; Bisht, A.; Das, A.K.; Park, Y. Blockchain-Based Data Access Control and Key Agreement System in IoT Environment. Sensors 2023, 23, 5173. https://doi.org/10.3390/s23115173

AMA Style

Lee J, Kim M, Park K, Noh S, Bisht A, Das AK, Park Y. Blockchain-Based Data Access Control and Key Agreement System in IoT Environment. Sensors. 2023; 23(11):5173. https://doi.org/10.3390/s23115173

Chicago/Turabian Style

Lee, JoonYoung, MyeongHyun Kim, KiSung Park, SungKee Noh, Abhishek Bisht, Ashok Kumar Das, and Youngho Park. 2023. "Blockchain-Based Data Access Control and Key Agreement System in IoT Environment" Sensors 23, no. 11: 5173. https://doi.org/10.3390/s23115173

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop