Abstract
Keywords
Introduction
The blockchain technology was first described in a 2008 paper titled “Bitcoin: A peer-to-peer electronic cash system.” 1 Blockchain, as the core technology of cryptocurrencies such as Bitcoin and Ethereum, can effectively solve the problem of the Byzantine and dual payments of digital currency. The trust of traditional society is based on trusted third parties, such as banks. Therefore, it is very difficult to directly establish trust between two strange entities without a third-party center. The blockchain can solve the problem of establishing trust among the decentralized system nodes through the verification and consensus mechanism.
Blockchain can not only be applied to the financial field but also be served as an innovative technology framework to establish a distributed and peer-to-peer trust relationship in many fields, such as healthcare, education and logistics. In this article, we focus on the blockchain applications in the Internet of Things (IoT) network to realize device management across organizations.
However, in order to achieve security and privacy-preserving IoT device management, there are still many problems to be solved. Transaction information in the blockchain is publicly stored in the ledger and anyone can see all the transaction information. Although plaintext storage facilitates public verification of transactions, this results in the disclosure of user’s account information. A simple way to address this problem is to encrypt the data stored in the block. But when the data on the blockchain are stored in ciphertext, how to realize the fine-grained access control of data becomes a tough problem.
In this article, we combine attribute-based encryption (ABE) and time-bound key management techniques to achieve privacy-preserving IoT device management–based blockchain.
Contribution
This article presents a scheme of privacy-preserving IoT device management based on blockchain. The scheme uses blockchain technology to achieve the management of IoT devices across organizations. We also combine ABE and time-bound key management to provide fine-grained access control over encrypted data and key automatic revocation. To the best of our knowledge, our scheme is the first blockchain system able to support time-bound and attributes-based access with high efficiency:
First, it achieves the sharing of devices information between multiple organizations and systems. This article takes advantages of the blockchain to make the stored data non-tampered, unforgeable and verifiable.
Second, ABE algorithm can not only protect the confidentiality of data but also provide fine-grained access to data according to the user’s roles and attributes. Another advantage of adopting ABE in the blockchain is that it can loose coupling between user identity information and key pairs, so that user’s identity information can be prevented from being leaked.
Third, our scheme adopts a time-bound key management mechanism to achieve the automatic revocation of user attributes and keys. Specifically, the hash algorithm is used to calculate the time values in different time slices and the key of the current time slice is combined and calculated with the encryption algorithm, so that a user cannot decrypt the data with an expired key.
Finally, we analytically and experimentally show that our scheme not only offers strong security but is also practical and deployable for sharing over encrypted data in the IoT environment.
Organization
The rest of the article is organized as follows. In section “Related work,” we describe the related work of blockchain-based access control technology. Section “Preliminaries” describes the basic principles of several key technologies that need to be used in this article. In section “System model,” we introduce the basic model of the privacy-preserving IoT device management based on blockchain. In section “The scheme,” we introduce the details of the execution of each phase of the system. Section “Security analysis” gives the detailed security analysis from four aspects. Section “Evaluation” provides the experimental evaluation of our scheme. In section “Conclusion,” we conclude the work.
Related work
Blockchain-based access control technology mainly includes transaction-based policy management and access control based on smart contract.
Maesa et al. 2 explored the feasibility of creating, managing, and enforcing access control policies using blockchain-based transactions and implemented it on the Bitcoin platform. This method extends the standard workflow based on the attribute-based access control (ABAC) model, 3 replaces the traditional relational database access control policy with the blockchain, and implements access control policy management by the form of transaction. Since the blockchain is a general ledger system that can only increase data, Maesa implemented the update and revoke of policies by spending policy creation transaction (PCT) output that used to update or revoke policy to form a new PCT, then form a transaction chain to the corresponding policies, and realize the full cycle management of policies. The transfer of policies and permissions is kept in a publicly visible blockchain, enabling distributed, non-tamperable log audit function.
Zyskind’s 4 mechanism implements fine-grained authority management for mobile applications. Each user and service in the blockchain corresponds to a public key address as the identity credential, and the public key (resource owner) and service public key (resource requester) manage the authority together in the form of federation identity. This method expands the connotation of “transaction” in blockchain and realizes access control through “transaction.”
The FairAccess mechanism5–8 stores policies as blockchain transactions in the form of (resource, requester), introduces the concept of wallet in Bitcoin, and installs their own wallet for different IoT devices. The wallet functions as an access control agent. Authority management is performed by sending an authorization token to the authorized access requester account. The authorization token can effectively reduce the overhead of processing access control information of the IoT device with limited computing resources and verify the authorization only by verifying the transaction signature. Like the unspent transaction output (UTXO) mechanism used for Bitcoin, FairAccess uses authorization tokens to represent the UTXO. It implements authorized, obtain authorization, and delegate authorization through three transaction types: GrantAccess Transaction, GetAccess Transaction, and DelegateAccess Transaction. The revocation of authority is controlled by the token’s timestamp and expiration time, and when the token expires, the authority recorded by the token is revoked. Thus, realizing the user-driven transparent access control mechanism.
Dorri et al. 9 made use of smart home as a background to propose lightweight solutions based on private chains. Through the center miner digestion proof of work (PoW) mechanism to reduce block chain maintenance costs, the introduction of storage, access, monitoring, generating equipment, deleting equipment, and other types of transactions are given. At the same time, the scheme extends the traditional blockchain protocol and the policy header storage policy list is added to authorize the device and execute the access control policy.
Managing access control policies or permissions with transactions can effectively protect user resources and enable user-driven, open, and transparent access to resources. Combining the blockchain with the current mainstream access control model can improve compatibility and easy implementation. However, since the current mainstream blockchain consensus mechanism is based on computational power, the computational cost of running the blockchain separately to provide access control services is higher. In addition, block generation takes more time, making implementation of real-time policy updates difficult.
Smart contracts 10 are scripts that can be run automatically on the blockchain. Nick Szabo first proposed the concept of a smart contract in 1994, defining it as a “transactional agreement that executes the terms of a contract via a computer,” that means automatically executing the contract through a code program. 11 Although the concept of smart contracts has long been proposed, but until the publish of the Ethereum platform, it provides the basis for the rapid development of smart contracts. Due to the automatic enforcement of smart contracts, some studies use smart contracts to control access to resources.
The MedRec framework12,13 is the most representative of access control for medical data based on the use of smart contracts in the Ethernet platform. The framework combines smart contract and access control to achieve automatic rights management and realizes the integration and authority management of distributed medical data of different medical institutions. It has the advantage of achieving the decentralized integration of the medical data based on the blockchain technology and makes the medical data controlled by the patients themselves. According to the contract, the medical institution cannot privately use the patient’s medical data without the consent of the patient. This effectively protects patient privacy data. However, the MedRec framework uses the PoW consensus mechanism, so the computational overhead required to maintain blockchain consistency is too large. Based on this, the medical data sharing model framework 14 innovates the consensus mechanism, uses the delegated proof-of-stake (DPoS) consensus mechanism to alleviate the computation pressure of nodes, effectively improves the data sharing efficiency, but it also has the shortcomings of the limited data storage capacity. Document 15 improves FairAccess mechanism based on smart contract and combines access control with reinforcement learning to dynamically optimize the self-adaptive policy. Document16,17 introduces trusted hardware to provide cryptographic protection for smart contracts.
In summary, the blockchain access control has the following advantages: (1) the policies are posted on the blockchain, so it is visible to all the users, and it can avoid the third-party ultra vires; (2) it can easily realize the transfer of access rights without the need for the involvement of resource owners and make the authority management more flexible; (3) access authority can be defined and posted to the blockchain by the resource owner through the transaction. Users have the right to manage resources and it is easy to audit at the same time; and (4) it can achieve the automated access control protection of resources based on smart contracts.
However, there are also some problems to be solved: (1) the access control policy and authority is not easy to update because the blockchain transactions cannot be revoked; (2) the block capacity is limited and a single transaction cannot store large-scale data, so the application is limited; (3) all the transaction information of the policy and authority stored in the blockchain is easily exploited by attackers and poses a security risk. There is a need for effective ways to protect transaction information; and (4) the blockchain transaction confirmation takes time, so it is unable to respond to real-time requests.
ABE is a public-key encryption algorithm in which user keys or ciphertexts are related to attributes. In this cryptosystem, the ciphertext can only be decrypted if the attributes corresponding to the user key satisfy the attributes corresponding to the ciphertext. The concept of ABE was first proposed by Sahai and Waters, 18 and it was further defined by Goyal et al. 19 There are two main types of ABE schemes: key-policy attribute-based encryption (KP-ABE) 19 and ciphertext-policy attribute-based encryption (CP-ABE). 20 In KP-ABE, user keys are generated based on a predefined access control tree and ciphertext is associated with a set of attributes. In CP-ABE, the access tree is used to encrypt data, and the user key is associated with the attribute set. ABE can provide fine-grained access and can protect the user’s identity information by the attributes. However, it is difficult to revoke user’s attributes in ABE. In this article, we implement automatic revocation of user attributes and keys using time-bound key management mechanism to solve this problem.
In October 2017, Rahulamathavan et al. 21 proposed a scheme that combines ABE with blockchain technology and applied it to privacy protection on the IoT ecosystem. Four types of parties are defined in their scheme: cluster head, blockchain miners, attribute authorities, and distributed ledger. The cluster head uses the ABE scheme to encrypt data so that users with specific attributes can access the data, and attribute authorities issue credentials for miners and users. But in ABE scheme, the automatic revocation of user attributes and keys is still a problem to be solved.
In this article, we use the ABE scheme in the IoT device management blockchain to achieve fine-grained access control. At the same time, we use the time-based key management mechanism to automatically recover the user’s attribute key, which solves the key management problem existing in the ABE solution.
Preliminaries
In this part, we simply explain the cryptographic tools used in our constructions.
ABE
In our scenario, we add the time-bound key management mechanism to the basic CP-ABE solution. The CP-ABE solution was proposed by Bethencourt et al. In their scheme, they first define the Access Tree
In the setup phase, the algorithm output the public parameters
and the master key
In the Encrypt phase, input
where
To generate the key, the input of the
At the time of decryption, the algorithm
If
Attribute-based cryptography can automatically achieve fine-grained access control through the cryptographic algorithm and protect the user’s identity information at the same time. These two features make attribute-based cryptography meet the requirement of access control of blockchain data.
Time-bound key management
Although ABE algorithm has the advantages of access control and user identity information protection, user attribute and key revocation is always a difficult problem to be solved based on attribute encryption algorithm. Therefore, our scheme combines the key management and access control mechanism, controls user key generation from time dimension based on time characteristics, and achieves fine-grained access control and user attribute key automatic revocation.
Bertino et al.
22
recently proposed a typical scheme of time-bound key management based on elliptic curve cryptography. In this scheme, define
where
A user can compute
and the user knows
In our system, this time-bound key management mechanism will be used to make up for the difficulty of attribute revocation in attribute encryption and achieve fine-grained access control on the time dimension.
Practical Byzantine fault tolerance
This algorithm was proposed by Castro and Liskov 23 in 1999. It solves the problem of inefficiency of the original Byzantine fault tolerant algorithm, making the Byzantine fault tolerant algorithm feasible in practical system application.
Practical Byzantine fault tolerance (PBFT) is a state machine replication algorithm, that is, the service is modeled as a state machine and the state machine replicates replicas at different nodes in the distributed system. Replicas of each state machine save the state of service and also achieve the operation of the service.
The collection of all replicates is denoted by the letter
First, a master node (primary) is elected from all the nodes. The primary is responsible for generating the new block. Other nodes are backups. The main node is calculated by the formula
The algorithm is then divided into three stages: pre-prepare, prepare, and commit. In the pre-prepare phase, the primary assigns a sequence number
where
During the prepare phase, the node
to all the replica nodes and writes the pre-prepare and prepare messages to its own message log.
If 2
to other replica nodes, and each replicate accepts the commit message when the signature is correct, the view number of the message is the same as the current view number of the node, and the sequence number of the message is between
Finally, if a node receives 2
Elliptic curve digital signature algorithm
Elliptic curve digital signature algorithm (ECDSA) 24 is a simulation of digital signature algorithm (DSA) using elliptic curve cryptography (ECC). ECDSA became ANSI standard in 1999 and became the IEEE and NIST standards in 2000. It was accepted by the ISO in 1998 and some of the other standards that include it are also under ISO’s consideration. Unlike the discrete logarithm problem (DLP) and the integer factorization problem (IFP), the elliptic curve discrete logarithm problem (ECDLP) has no solution to the sub-exponential time. Therefore, the unit bit strength of ECC is higher than that of other public key systems.
This algorithm randomly chooses an odd prime
In the signature stage, choose a random integer
In the verification stage, first verify that
System model
In this section, we will introduce the basic model of the privacy-preserving IoT device management based on blockchain, including the various components of the model.
Attribute-based blockchain
In this section, we will describe the basic attribute-based blockchain model, which includes the block structure, nodes and their attributes, and different block type.
Block structure
The block in our model is divided into two parts: the block header and the main block. In the Bitcoin system, the block header is made up of a version number, a previous block hash, a current block hash, timestamp, nonce, and so on. The main block consists of a series of transactions.
Analogously, the attribute-based blockchain in our scheme has a current block hash, a previous block hash, a timestamp, and a signature in its block header.
In the main block, it stores some information about the IoT device, such as the device identifier, the location, and the user of this device. Some blocks will also store access control policies, and will be discussed later.
Nodes and attributes
In this model, every node has its own identity and a series of attributes. The encrypted information is identified by a set of attributes, which contains
However, we also add the time granule in our scheme. That means every user in the system has his or her own time granule
There are two kinds of nodes in our scheme: primary node and backup node. Primary node is responsible for generating new blocks and putting transactions collected from the network into new blocks. Backup node can create a new transaction and read transaction information in the block if he or she has the appropriate attributes to decrypt the data.
Block types
In the privacy-preserving IoT device management blockchain, there are three different types of blocks: new transaction block (NTB), device maintenance block (DMtB), and device management block (DMgB).
When a new IoT device is traded, an NTB is generated. This kind of block stores transaction information (including transaction date, vendor information, device model, device type, and contract), the unique device identifier, storage location, owner, user, device status, manufacturer information, hardware information (version number), and software information (version number).
A DMtB will be generated when an IoT device needs maintenance. It contains the unique device identifier and some maintenance data such as hardware information (version number), software information (version number), maintenance person, and maintenance date.
The last type of block is DMgB. It stores access control policies for each type of block and other security policies. Because in the access control scheme, using attribute encryption, the user needs to repeatedly try whether his or her attributes can decrypt the current data, which makes decryption inefficient. But in this scheme, users can improve the decryption efficiency by checking the access control policies on the DMgB.
Each block contains more than one transaction, and one transaction stores the information of one device. The information stored in the blocks is stored in the form of ciphertext using ABE, in which the transactions in the DMgB that hold access control policies are decrypted by all users in the system.
Roles
There are different roles in the privacy-preserving IoT device management scheme, as described in Figure 1.

Roles in IoT device management blockchain.
Manufacturer
The manufacturer produces the IoT device and trades the device to the purchaser. The manufacturer also needs to maintain the equipment. And in this scheme, the manufacturer can write message to the NTB and the DMtB.
Seller
The seller can also trade the IoT device to the purchaser and add new message to the NTB.
Purchaser
Purchaser can purchase IoT devices directly from the manufacturer or purchase device from a seller. A purchaser can only write message to the NTB.
Administrator
The administrator manages IoT devices and the system’s access control policies. An administrator can add message to the DMgB.
Authority agency
When users want to join the privacy-preserving IoT device management system, they need to apply to the authority agency (manufacturers, sellers, purchasers, and administrators are all users). When the user applies to the authority agency, the authority agency needs to verify the user’s identity and then distribute the public parameters
Data structure
There are three kinds of messages in the privacy-preserving IoT device management scheme:
Cert
When users apply to join the system, the authority agency will be issued to the user with a
where
Transaction
A transaction is an encrypted message which a user wants to write to the block. Its structure is as follows
where
Block
A block is a collection of transactions, and the primary nodes are put together into the block. It is as follows
Different types of blocks store its corresponding type of transactions.
The scheme
Our scheme mainly contains five phases: system setup phase, user setup phase, proposal phase, verification phase, and access phase.
System setup phase
System setup phase installs the privacy-preserving IoT device management scheme. It needs a security parameter
First, choose a bilinear group
At the same time, choose two partial order class
User setup phase
The user setup phase is for each user who wants to join the system. They apply to the authority agency, and the authority agency will return them a
Through this phase, the user can get the key pair for digital signature
The authority agency will give a set of attributes
In this phase, the authority agency will also give the user a time interval in which the user can access data in blocks,
Finally, the authority agency will put this information with a timestamp and the hash value of this message into the
Proposal phase
In this phase, the system generates new transactions and blocks.
When the backup nodes generate transactions, the user should encrypt the message combined with a nonce with the public key
We will choose two different modulo of
Define a polynomial
where
The ciphertext will be time stamped and signed by the user who created the transaction with the ECDSA signature generation algorithm. Then, he or she can publish this transaction.
At this phase, the primary node may also generate new blocks. The consensus mechanism of this program uses PBFT. When generating a new block, consistency needs to be achieved through PBFT. The new block will have its signature of the primary node. The users in the system submit the new block and its transaction to the local blockchain and database when the protocol is finished.
Verification phase
Our scheme is to encrypt the data in the block first and then sign it. When verifying, all users can verify the integrity of the data, but the users who cannot decrypt the data, do not know the plaintext.
When a user wants to access a transaction in a block, he or she first verifies the block with the verification key of the block generator and then verifies the transaction with the verification key of the user who issued the transaction by the ECDSA signature verification algorithm. If and only if
Access phase
In access phase, users can access the data if they have attributes that the publisher chooses more than the threshold number and in the time between
When
At the time of decryption, the user input the ciphertext
If
When
where
If the access tree
In this case, the user needs to constantly try to decrypt the message to confirm that he or she has access to the data. In order to improve the decryption efficiency, the user can first obtain the access control policy from the DMgB, and the transaction of access control policy could be decrypted by all the users in the system.
Security analysis
This section gives the detailed security analysis from four aspects: anonymity, fine-grained access control, key automatic revocation, and non-repudiation.
Anonymity
This scheme achieves anonymity through the user in the blockchain, who does not use his or her real identity information. In the system, only the authority agency knows the real identity of the user, because when users apply to join the system, they need to verify the identity of the user. After the user applies to the authority agency to join the system, the authority agency will assign the user a series of attributes as well as the key to encrypt and decrypt the data. In addition, it will give the user his or her signature key pair. In all the activities afterwards, the signature key is a symbol of user identity. All transactions of this user need to be signed with his signature key. Other users verify this transaction only through his or her verification key, and they do not know the user’s real identity.
Fine-grained access control
The attribute-based cryptosystem adopted in this article can automatically achieve fine-grained access control through the cryptographic algorithm and at the same time protect the user’s identity information.
The data in the blockchain are encrypted, and after the user has verified the integrity of the data, he or she cannot decrypt all the data. Only when the user has attributes that meet the data access control policy, it can be decrypted. In addition, the scheme also adds the time-bound key management mechanism. The user can access the data in the blockchain only within a certain time range and cannot access beyond the time range.
Automatic revocation of the key
Time-bound key management mechanism can realize automatic revocation of the key. It manages the keys in the time dimension and controls the generation of user keys. When the user applies to the authority agency to join the system, the authority agency will give the user the time range that he or she can access in the blockchain. This management mechanism ensures that the user can only generate the decryption key within the time range. Once it exceeds the time range, the key will be invalid, and the user cannot generate the decryption key and hence cannot decrypt the data.
Non-repudiation
The scheme is non-repudiating because each transaction and every block is digitally signed. The primary node needs to add the user’s digital signature when creating a block. When a backup node posts a transaction in the block, the user also needs to add his or her own digital signature to the message so that other users reading the transaction can confirm the source of the data. When a user visits a transaction in a block, the block’s signature and the signature of the transaction need to be verified. Only after the two signatures have been verified successfully, the user can attempt to decrypt the data.
Evaluation
We implemented our protocols in C++ with MIRACL cryptography software development kit (SDK). The algorithms run by the users were executed on a client machine with Intel i7-4600U 2.70-GHz CPU and 4GB RAM. We also choose secp256k1 (Standards for Efficient Cryptography Group (SECG) curve over a 256-bit prime field) as ECDSA algorithm. We compare the proposed scheme with Rahulamathavan et al.’s 21 scheme. In the following part, we call YRSM scheme for short.
Figure 2 shows the computation overhead of proposal phase, which mainly contains two steps: (1) encryption and (2) signing. Let

Computation overhead of proposal phase.
In the verification phase, the time cost of verifying a transaction is about 2.5 ms. Of course it takes long time to verify a block, which depends on the number of transactions in the block. The time cost of verification of YRSM 21 is almost identical to our scheme, since they both use the ECDSA signature as their signature algorithm.
Figure 3 shows the computation overhead of access phase, which is actually a decryption process. Let

Computation overhead of access phase.
From the preceding experimental results, we can see that our scheme is quite efficient in proposal phase. The time to generate a transaction is less than 100 ms even requiring 10 attributes. The time to access such a transaction is less than 1 s.
Conclusion
In this article, we have proposed privacy-preserving IoT device management based on blockchain. This scheme is novel from three perspectives. (1) It achieves the sharing of device information across organizations and systems and takes advantages of the blockchain to make the stored data non-tampered, unforgeable, and verifiable. (2) We have adopted ABE to protect the confidentiality of data and provide fine-grained access over encrypted data according to the user’s roles and attributes. (3) We have used time-bound key management mechanism to achieve the automatic revoke of user attributes and keys. (4) We have analytically and experimentally showed that our scheme not only offers strong security but is also practical and deployable for sharing over encrypted data in the IoT environment.
