# Blockchain-Aided Searchable Encryption-Based Two-Way Attribute Access Control Research

Authors: Zhigang Xu; Shiguang Zhang; Hongmu Han; Xinhua Dong; Zhiqiang Zheng; Haitao Wang; Wenlong Tian
Journal: Security and Communication Networks
 (2022)

---

## Abstract

In the Internet of Things (IoT), data sharing security is important to social security. It is a huge challenge to enable more accurate and secure access to data by authorized users. Blockchain access control schemes are mostly one-way access control, which cannot meet the need for ciphertext search, two-way confirmation of users and data, and secure data transmission. Thus, this paper proposes a blockchain-aided searchable encryption-based two-way attribute access control scheme (STW-ABE). The scheme combines ciphertext attribute access control, key attribute access control, and ciphertext search. In particular, two-way access control meets the requirement of mutual confirmation between users and data. The ciphertext search avoids information leakage during transmission, thus improving overall efficiency and security during data sharing. Moreover, user keys are generated by the coalition blockchain. Besides, the ciphertext search and pre-decryption are outsourced to cloud servers, reducing the computing pressure on users and adapting to the needs of lightweight users in the IoT. Security analysis proves that our scheme is secure under a chosen-plaintext attack and a chosen keyword attack. Simulations show that the cost of encryption and decryption, keyword token generation, and ciphertext search of our scheme are preferable.


---

## Body

## 1. Introduction

In Industry 4.0, the IoT is commonly used in industrial environments and often requires processing large amounts of data. Due to the limited resources of IoT devices, we often store large amounts of data from IoT devices on cloud servers. However, this outsourced storage approach may cause many privacy and security problems, such as identity leakage, illegal access to private data, and data tampering. The solution to these problems is to store the ciphertext in the cloud server. Symmetric encryption can guarantee data confidentiality but cannot achieve fine-grained access control and secure data sharing.Attribute access control is an access control mechanism proposed by Sahai and Waters [1] to ensure effective and secure data sharing and fine-grained access. Technically, attribute access control is mainly divided into two types: ciphertext-policy attribute-based encryption (CP-ABE) [2] and key-policy attribute-based encryption (KP-ABE) [3]. In the CP-ABE scheme, each data user obtains the corresponding attribute secret key from the authorization agency according to their attributes, and the access structure of the file is determined by the data owner. Only when the attribute set in the secret attribute key of the data acquirer meets the access structure of the file can the file be viewed correctly. In the KP-ABE, by contrast, files can only be viewed when the access structure of the identity key satisfies the ciphertext properties. However, these two methods of attribute access control are only a single method of authentication. They address the need for one-way control of data sharing but do not meet the need for two-way confirmation of users and data. For this reason, Attrapadung and Imai [4] proposed a two-policy attribute access control scheme whose core idea is to combine ciphertext access control with key access control. On the one hand, the ciphertext is obtained by associating the plaintext with the corresponding user access structure and plaintext attributes. On the other hand, the user’s private key is computed by associating its attribute set with the ciphertext access control structure. The plaintext can only be decryption if both the ciphertext access control and the key access control match. However, this solution is a centrally authorized agent prone to a single point of failure. Han et al. [5] proposed a distributed bidirectional attribute access control strategy. However, the scheme does not consider users’ security requirements for personal data queries and transmissions in the IoT environment.Blockchain is increasingly used in non-transactional scenarios such as supply chains, the IoT, smart healthcare, and public security, where data often contain users’ private data. The data cannot be fully disclosed to everyone as a transaction and can only be shared to a limited extent. Through blockchain research, the use of blockchain to manage users’ keys ensures secure data sharing for the development of the Industrial Internet of Things (IIoT).In this paper, we propose a blockchain-aided searchable encryption-based two-way attribute access control scheme (STW-ABE) to manage massive IoT data and meet people’s demand for data access control of private data. The main contributions of our scheme can be summarized as follows:(1)
Blockchain-Aided Key Generation. Blockchain consensus nodes jointly execute the DKG to generate the secret key. It avoids the problem of secret key leakage caused by a single point of failure.(2)
Blockchain-Cloud-Aided Keyword Search. The combination of attribute encryption technology and searchable encryption achieves fine-grained two-way access control of transaction ciphertexts in the blockchain. The blockchain sends a token containing a single keyword to the CS. The CS uses the token to perform a ciphertext search to avoid leakage of private data during transmission.(3)
Cloud-Aided Pre-Decryption. The CS provides the pre-decryption service for users with access permission, and the user only needs to perform one exponential operation to decrypt the ciphertext. It reduces computational pressure for users and meets the needs of resource-constrained IoT devices.The rest of this article is organized as follows. Section2 reports the most related work. Section 3 introduces relevant knowledge, including linear secret-sharing schemes, distributed key generation protocols, searchable encryption, and blockchain technology. Section 4 presents the system definition, including the system model, the STW-ABE scheme, and the security model. In Section 5, we reveal the detailed construction of the STW-ABE scheme. Section 6 analyzes the security of our scheme and compares the time cost with other schemes in encryption, decryption, and ciphertext search. Finally, we conclude in Section 7.


## 2. Related Work

In Industry 4.0, access control technology is essential to build trust and sustainability in a distributed context of the IoT. Leng et al. [6] proposed a blockchain model with chemical signature access under a distributed context, Makerchain, which binds unique signature data to the blockchain and automatically executes smart contracts set between manufacturers to achieve service trust between manufacturers. Rahman et al. [7] proposed a distributed multi-signature technology based on blockchain to realize multi-party identity authentication and guarantee the trust between multiple parties in the Industry 4.0 system. However, it does not consider the resource limitation of IoT terminal devices. Most data encryption techniques in use today are based on bilinear mapping encryption, which means that the computational cost of decryption is high. Most lightweight devices do not adapt to attribute-based access control. Therefore, many attribute access control schemes propose the method of outsourcing decryption. Li et al. [8] proposed an outsourcing ABE scheme search based on keyword search. However, the search method used in this scheme is a common public key encryption of keywords, which cannot achieve a fine-grained searchable encryption scheme. Ziegler et al. [9] proposed an outsourcing decryption scheme based on a prime order group to bridge the gap between the highly dynamic IIoT environment and resource-constrained devices. The IoT includes a core network and an edge network, and data security problems will be encountered in data sharing. Liu et al. [10] proposed a privacy-protecting multi-keyword searchable encryption scheme in a distributed system. Through a multi-server architecture, authorized servers can jointly search whether the token matches the ciphertext, thus improving the search efficiency. Miao et al. [11] put forward a multi-keyword search scheme based on attributes and transformed attributes into 0 and 1 codes for attribute judgment comparison, thus improving the efficiency of strategy judgment.In the IIoT, blockchain is a new generation of security technology with immutability and traceability characteristics. Leng et al. [12] discussed how blockchain promotes the sustainable development of manufacturing and product life management in Industry 4.0. Mehta et al. [13] proposed a blockchain-based copyright contract transaction scheme for the Industry 4.0 supply chain, which ensured the security of copyright transactions for different stakeholders in the industry. But the blockchain has its potential security problems. Leng et al. [14] proposed the PDI model and divided blockchain security issues into process level, data level, and infrastructure level. This paper mainly studies data access control to solve the data-level security sharing problem to improve blockchain systems’ data security. In Industry 4.0, blockchain provides key technology for the secure intelligent manufacturing of IIoT, but distributed Industry 4.0 needs to realize collaborative trust. Leng et al. [15] put forward eight network security obstacles in the intelligent manufacturing of blockchain. The cybersecurity barriers include device deception, false authentication, and trust in data sharing among participants. Therefore, implementing blockchain identity authentication in the IIoT is of great significance for the multi-party trust and sustainability of Industry 4.0. Li et al. [16] proposed a multi-keyword encrypted search scheme applicable for blockchain, which implements ciphertext information search and data access control through smart contracts. Before ciphertext search, the smart contract automatically determines data access permission to enhance trust among IoT users. Feng et al. [17] proposed a data privacy protection scheme based on blockchain searchable attribute access control. The user’s permission authentication is implemented by the user’s local server, avoiding the security risk of submitting the user’s private key and access structure to the blockchain network. Gao et al. [18] proposed a trusted secure ciphertext policy and attributed a hiding access control scheme based on blockchain. The scheme hides the ciphertext policy and attribute information and reduces accidental leakage of data information. Therefore, Liu et al. [19] proposed a searchable attribute-based encryption scheme in which a coalition blockchain replaces the traditional centralized server to be responsible for the generation and storage. Qin et al. [20] proposed a lightweight IoT access control scheme based on attribute encryption and blockchain to verify the accuracy of outsourced decrypted data in IoT through a smart contract. In addition, some schemes use the distributed feature of blockchain to distribute secret keys as the authority. Lewko and Waters [21] proposed a multi-authority attribute-based encryption scheme. In this scheme, the secret user key consists of multiple components, each from a different organization, to prevent collusion attacks among users. Qin et al. [22] proposed a blockchain multi-attribute access control scheme for cloud data sharing. Smart contracts on blockchain manage attribute tokens across domains to solve the trust problem between multiple users. Shi et al. [23] proposed a blockchain-based distributed access control scheme for IoT. The solution uses blockchain nodes as the addresses of IoT devices. It uses blockchain to complete the data authorization, cancelation, access control, and auditing process to ensure data security in the distributed IoT system.The access control scheme mentioned above compensates for the deficiency of the blockchain access control mechanism in the IIoT environment. However, combining the existing access control scheme with blockchain is not enough to meet users’ demand for secure sharing access control of private data. Currently, most blockchain access control solutions only implement user access policy settings for the data and do not address the need for two-way policy confirmation between the user and the data. Furthermore, the security of the data during sharing and the usability of users of lightweight devices were not considered. Therefore, this paper proposes a blockchain-aided searchable encryption-based two-way attribute access control scheme (STW-ABE).


## 3. Preliminaries

### 3.1. Linear Secret-Sharing Schemes (LSSS)

The linear secret-sharing scheme [24] is defined as follows.Definition 1.
Let P be a set of parties. LetM be a l×k matrix. Let ρ:1,…,l⟶P be a function that maps a row to a party for labelling. Let M,ρ represent a linear secret-sharing scheme with access structure A, which usually consists of two polynomial-time algorithms:(1)
Forx=1,…,l, the x-th row of matrix M is labeled by a party ρi, where ρ:1,…,l⟶P is a function that maps a row to a party for labelling. The algorithm takes as input the secret value s∈Zp that is shared. y2,…,yk∈Zp are randomly chosen, and v⟶=s,y2,s∈Zp…,ykT. The share λpi=Mi⋅v⟶ belongs to party ρi.(2)
LetS∈A be input. Let I=i|ρi∈S, and randomly select ci∈ZP∗. The output is a constant with linear reconstruction characteristics: ∑i∈Iciσi=s.


### 3.2. Distributed Key Generation (DKG) Protocol

Traditional key generation is performed by the central server. This centralized management approach is prone to a single point of failure problem. To solve this problem, researchers proposed the distributed key generation (DKG) protocol [25]. In the DKG protocol, the generation of secret values is done by multiple parties, not by an authoritative center, and does not rely on trusted third parties. Multiple nodes jointly generate a secret value α, and each node has a corresponding secret value α to share. The secret value can be restored only when the sharing rule t,n is met, where t is the number of nodes authorized by participants and n is the threshold. The secret value generated by t nodes must be shared by at least n participants to complete the sharing of secret value α.


### 3.3. Searchable Encryption

Song et al. [26] proposed the practical technology of encrypted data search. In this technique, the scheme for searching the encrypted data is described, and the security of the generated encryption system is proved. The third-party server can only obtain the matching ciphertext results if only the ciphertext data are provided. Nevertheless, it cannot obtain the data information in plaintext, which implements query isolation. In addition, a hidden query is supported. Data users only need to send the search token containing the query keyword to the third-party server for ciphertext search without disclosing the detailed information of the keyword to the server.


### 3.4. Blockchain Technology

Generally, there are three types of blockchain: public blockchain, private blockchain, and coalition blockchain. A public blockchain allows any node to generate transaction information and view all information in the block. In a private blockchain, all nodes on the network are controlled by a single organization, and only a small number of authorized nodes have access to the data information. In the coalition blockchain, authorized nodes can join the blockchain network and participate in transactions and information synchronization with strong controllability and high privacy.This paper uses a coalition blockchain. The blockchain is controlled by a group of trusted nodes that control the consensus protocol. Other authorized nodes can generate data and send them to the blockchain for storage. Then, the consensus node runs the consensus protocol to complete the ledger update in the coalition blockchain so that all nodes keep the whole state consistent. In this paper, the specific functions of the coalition blockchain are as follows. (1) The consensus node in the blockchain initializes system parameters using the distributed secret key generation protocol. (2) The consensus node is responsible for generating, storing, and distributing global public keys, public and private key pairs of users, and user identity keys. (3) The consensus node responds to the keyword searched by the user, generates a ciphertext index through the blockchain, and sends it to the cloud server.


## 3.1. Linear Secret-Sharing Schemes (LSSS)

The linear secret-sharing scheme [24] is defined as follows.Definition 1.
Let P be a set of parties. LetM be a l×k matrix. Let ρ:1,…,l⟶P be a function that maps a row to a party for labelling. Let M,ρ represent a linear secret-sharing scheme with access structure A, which usually consists of two polynomial-time algorithms:(1)
Forx=1,…,l, the x-th row of matrix M is labeled by a party ρi, where ρ:1,…,l⟶P is a function that maps a row to a party for labelling. The algorithm takes as input the secret value s∈Zp that is shared. y2,…,yk∈Zp are randomly chosen, and v⟶=s,y2,s∈Zp…,ykT. The share λpi=Mi⋅v⟶ belongs to party ρi.(2)
LetS∈A be input. Let I=i|ρi∈S, and randomly select ci∈ZP∗. The output is a constant with linear reconstruction characteristics: ∑i∈Iciσi=s.


## 3.2. Distributed Key Generation (DKG) Protocol

Traditional key generation is performed by the central server. This centralized management approach is prone to a single point of failure problem. To solve this problem, researchers proposed the distributed key generation (DKG) protocol [25]. In the DKG protocol, the generation of secret values is done by multiple parties, not by an authoritative center, and does not rely on trusted third parties. Multiple nodes jointly generate a secret value α, and each node has a corresponding secret value α to share. The secret value can be restored only when the sharing rule t,n is met, where t is the number of nodes authorized by participants and n is the threshold. The secret value generated by t nodes must be shared by at least n participants to complete the sharing of secret value α.


## 3.3. Searchable Encryption

Song et al. [26] proposed the practical technology of encrypted data search. In this technique, the scheme for searching the encrypted data is described, and the security of the generated encryption system is proved. The third-party server can only obtain the matching ciphertext results if only the ciphertext data are provided. Nevertheless, it cannot obtain the data information in plaintext, which implements query isolation. In addition, a hidden query is supported. Data users only need to send the search token containing the query keyword to the third-party server for ciphertext search without disclosing the detailed information of the keyword to the server.


## 3.4. Blockchain Technology

Generally, there are three types of blockchain: public blockchain, private blockchain, and coalition blockchain. A public blockchain allows any node to generate transaction information and view all information in the block. In a private blockchain, all nodes on the network are controlled by a single organization, and only a small number of authorized nodes have access to the data information. In the coalition blockchain, authorized nodes can join the blockchain network and participate in transactions and information synchronization with strong controllability and high privacy.This paper uses a coalition blockchain. The blockchain is controlled by a group of trusted nodes that control the consensus protocol. Other authorized nodes can generate data and send them to the blockchain for storage. Then, the consensus node runs the consensus protocol to complete the ledger update in the coalition blockchain so that all nodes keep the whole state consistent. In this paper, the specific functions of the coalition blockchain are as follows. (1) The consensus node in the blockchain initializes system parameters using the distributed secret key generation protocol. (2) The consensus node is responsible for generating, storing, and distributing global public keys, public and private key pairs of users, and user identity keys. (3) The consensus node responds to the keyword searched by the user, generates a ciphertext index through the blockchain, and sends it to the cloud server.


## 4. System Definition

### 4.1. System Model

The STW-ABE scheme contains four participants presented as follows. The detailed structural components of the scheme are shown in Figure1.(1)
Data Publisher (DP). Any IoT device can generate data. The plaintext data containing ciphertext attributes and user access structure are encrypted on the local service. Then, the ciphertext and ciphertext index are uploaded to the cloud server. Data publishers can be people and any IoT device.(2)
Data Acquirer (DA). The data acquirer receives the user identity key from the blockchain, which contains the user attributes and the ciphertext access structure. The DA can only capture the ciphertext if the DA attribute meets the user access structure of the DP and the ciphertext attribute meets the ciphertext access structure of the DA. The DA obtains the ciphertext that meets the individual’s conditions and decrypts it with its user identity key.(3)
Blockchain (BC). A coalition blockchain comprises trusted consensus nodes. The blockchain is responsible for initializing the global public key and generating users’ public and private key pairs, user identity secret keys, and tokens.(4)
Cloud Server (CS). Cloud servers are used to store large amounts of ciphertext and ciphertext indexes that are uploaded by DP. In addition, CS responds to users’ search requests, verifies access control permission, provides pre-decryption services for DA who meets the permission, and returns the pre-decrypted intermediate ciphertext to the DA.Figure 1
Scheme structure. The structure contains a specific implementation process for access control.The STW-ABE scheme is divided into three parts. The first part is encryption. First, the DP obtains the global public key and users’ public and private key pairs from the blockchain. Then, the DP encrypts the plaintext data through the ciphertext attribute set and user access structure. The DP then sends the ciphertext and ciphertext index to CS. The second part is the ciphertext search. DA searches for ciphertext information by keyword. First, DA sends a keyword to the blockchain network. Second, the blockchain network encrypts a keyword into a token and sends the token to CS, which conducts a ciphertext search through the ciphertext index and search tokens. Finally, the retrieved ciphertext is stored. The third part is decryption. The CS verifies the access control permissions of the set of users, that is, whether the user attributes meets the user access structure and whether the ciphertext attribute set meets the ciphertext access structures. The CS provides a pre-decryption service to generate intermediate ciphertext for the DA, satisfying the two-way access structure. When the DA receives the intermediate ciphertext from CS, the DA uses the user identity key to decrypt the intermediate ciphertext into plaintext.


### 4.2. System Procedure

The composition of the STW-ABE scheme is as follows.


#### 4.2.1. Initialization

Setupλ⟶GP. Setup: the process runs on blockchain consensus nodes participating in authorization and outputs global public key GP.Authority SetupGP⟶SK,PK. User public key and private key generation: the process runs in the blockchain consensus nodes, with global public key GP as input, and outputs user public key PK and user private key SK.


#### 4.2.2. User Identity Key Generation

KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. User identity key generation: the process is run consensus nodes in blockchain that execute the distributed key generation protocol, taking the global public key GP, the user public key PK, the user private keySK, the user attributes set K, the ciphertext access structure P,η, and user’s identity UID as input, and outputs the user identity keyUKUID.


#### 4.2.3. Encryption

EncryptGP,SK,PK,UID,F,ρ,Λ,M⟶D,KW. Encryption: this process is run by the DP, taking the global public key GP, the user public key PK, the user private key SK, the user’s identity UID, the user access structure F,ρ, ciphertext attribute set Λ, and plaintext M as input, and outputs ciphertext D and keywords of ciphertext KW.


#### 4.2.4. Index Generation

IndexGenGP,PK,KW⟶Index. Index generation: this process is run by the DP, with the global public key GP, the user public key PK, and the keywords of ciphertext KW as input, and outputs the ciphertext index Index.


#### 4.2.5. Token Generation

TokenGenGP,UKUID,kw⟶Tok. Token generation: this process is run by the blockchain consensus nodes, with the global public key GP, the user identity key UKUID, and the keywords of the data user kw as input, and outputs user search token Tok.


#### 4.2.6. Search

CipherTextSearchGP,Tok,Index⟶D. Search: this process is run by the CS, taking the global public key GP, the user search token Tok, and the ciphertext index Index as input to output the matching ciphertext D.


#### 4.2.7. Decryption

ProxyDecryptGP,D,UKUID⟶D′. Proxy decryption: this process is run by the CS, taking the global public key GP, the ciphertext D, and the user identity key UKUID as input. If the ciphertext attribute set Λ satisfies the ciphertext access structure P,η and the user attribute set K satisfies the user access structure F,ρ, the ciphertext is pre-decrypted and sends the intermediate ciphertext D′ returned to the DA.userDecryptGP,D,D′,UKUID⟶M. User decryption: this process is run by the DA, taking the global public key GP, the ciphertext D, the intermediate ciphertext D′, and the user identity key UKUID as input, and outputs plaintext M.The notations used in our scheme are summarized in Table1.Table 1
Notations.
NotationMeaningλA security parameterGPThe global public keySKUser’s private keyPKUser’s public keyUIDUser’s identityKUser’s attribute setP,ηThe ciphertext access structureUKUIDUser’s identity keyF,ρThe user access structureΛThe ciphertext attribute setKWThe keywords of ciphertextIndexThe ciphertext indexkwUser search keywordsTokSearch tokenD/D′Ciphertext of the data/pre-decrypted ciphertext


### 4.3. Security Model

#### 4.3.1. Ciphertext Indistinguishability

The indistinguishability security under chosen-plaintext attack (IND-CPA) of an STW-ABE scheme is defined by the following game between a challengerC and a probabilistic polynomial-time (PPT) adversary A. Let Au be the authority universe of size t. We define adversary A as a t,n adversary who can compromise at most t−1 authority. This security model adopts the t,n key generation protocol. The description of the game is as follows:(1)
Initialization:C runs the Initialization of STW-ABE and returns the global public key GP, user public key PK, and user private key SK to A.(2)
Query phase I: adversaryA queries the following oracles adaptively.(a)
User Identity Key Oracle. A submits an identity UID to C. C runs the KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. Finally, it returns UKUID to A.(b)
Encryption Oracle. A sends F,ρ,Λ,M to C. C runs the EncryptGP,SK,PK,F,ρ,Λ,M⟶D,KW to generate the ciphertext D. Notice that the user access structure F,ρ does not satisfy the challenge user attribute set K, and the ciphertext attribute set Λ does not satisfy the challenge ciphertext access structure P,η.(3)
Challenge:A submits two plaintexts of equal length M0, M1 and sends them to C. C selects a random number ∂∈0,1 and encrypts the selected plaintext with user access structure F∗,ρ∗ and ciphertext attribute set Λ∗. The final ciphertext will be generated (D∗) and sent to A.(4)
Query phase II:A still can make queries adaptively as in Query Phase I.(5)
Guess:A outputs a guess b′ for b.The advantage ofA in this game is defined as follows:(1)AdvAD=Prb,=b−12.Definition 2.
An STW-ABE scheme is IND-CPA secure if the advantage defined above for anyt,n PPT adversary A is negligible.


#### 4.3.2. Index Indistinguishability

Index indistinguishable security (IND-CKA) under chosen access structure and chosen keyword attack is defined as the security game of challengerC and a probabilistic polynomial-time (PPT) adversary A for the STW-ABE scheme. In this scheme, only single keyword ciphertext retrieval is considered. The description of the game is as follows:(1)
Initialization:A defines a user access structure F∗,ρ∗ and ciphertext attribute set Λ∗.(2)
Setup:C runs the Initialization of STW-ABE and returns the global public key GP, user public key PK, and user private key SK to A.(3)
Query phase I: adversaryA queries the following oracles adaptively.(a)
User Identity Key Oracle. A submits an identity UID to C. C runs the KeyGenGP,SK,PK,UID,θ,P,η⟶UKUID. Finally, it returns UKUID to A.(b)
Token Oracle. A send kw to C. C runs the TokenGenGP,SK,kw⟶Tok to generate the token Tok. Notice that the user access structure F,ρ does not satisfy the challenge user attribute set K, and ciphertext attribute set Λ does not satisfy the challenge ciphertext access structure P,η. We assume that all query results (Tok) have at least one matched index that can be searched out.(c)
Index Oracle. A submits UKUID,KW to C, and C runs the IndexGenGP,PK,UKUID,KW⟶Index to generate the index.(4)
Challenge:A submits two keywords of equal length kw0, and kw1 to C. C chooses randomly number b∈0,1 and runs the IndexGenGP,PK,UKUID,KW⟶Index with the challenge user access structure F∗,ρ∗ and ciphertext attribute set Λ∗ to return Index∗ to A.(5)
Query phase II:A still can make queries adaptively as in Query Phase I after receiving the challenge index. Similarly, A cannot query on the user access structure, which satisfies the challenge user attribute set, and ciphertext attribute set, which satisfies the ciphertext access structure.(6)
Guess:A outputs a guess b′ for b.The advantage ofA in this game is defined as follows:(2)AdvAkw=Prb,=b−12.Definition 3.
An STW-ABE scheme is IND-CKA secure if the advantage defined above for any PPT adversaryA is negligible.


## 4.1. System Model

The STW-ABE scheme contains four participants presented as follows. The detailed structural components of the scheme are shown in Figure1.(1)
Data Publisher (DP). Any IoT device can generate data. The plaintext data containing ciphertext attributes and user access structure are encrypted on the local service. Then, the ciphertext and ciphertext index are uploaded to the cloud server. Data publishers can be people and any IoT device.(2)
Data Acquirer (DA). The data acquirer receives the user identity key from the blockchain, which contains the user attributes and the ciphertext access structure. The DA can only capture the ciphertext if the DA attribute meets the user access structure of the DP and the ciphertext attribute meets the ciphertext access structure of the DA. The DA obtains the ciphertext that meets the individual’s conditions and decrypts it with its user identity key.(3)
Blockchain (BC). A coalition blockchain comprises trusted consensus nodes. The blockchain is responsible for initializing the global public key and generating users’ public and private key pairs, user identity secret keys, and tokens.(4)
Cloud Server (CS). Cloud servers are used to store large amounts of ciphertext and ciphertext indexes that are uploaded by DP. In addition, CS responds to users’ search requests, verifies access control permission, provides pre-decryption services for DA who meets the permission, and returns the pre-decrypted intermediate ciphertext to the DA.Figure 1
Scheme structure. The structure contains a specific implementation process for access control.The STW-ABE scheme is divided into three parts. The first part is encryption. First, the DP obtains the global public key and users’ public and private key pairs from the blockchain. Then, the DP encrypts the plaintext data through the ciphertext attribute set and user access structure. The DP then sends the ciphertext and ciphertext index to CS. The second part is the ciphertext search. DA searches for ciphertext information by keyword. First, DA sends a keyword to the blockchain network. Second, the blockchain network encrypts a keyword into a token and sends the token to CS, which conducts a ciphertext search through the ciphertext index and search tokens. Finally, the retrieved ciphertext is stored. The third part is decryption. The CS verifies the access control permissions of the set of users, that is, whether the user attributes meets the user access structure and whether the ciphertext attribute set meets the ciphertext access structures. The CS provides a pre-decryption service to generate intermediate ciphertext for the DA, satisfying the two-way access structure. When the DA receives the intermediate ciphertext from CS, the DA uses the user identity key to decrypt the intermediate ciphertext into plaintext.


## 4.2. System Procedure

The composition of the STW-ABE scheme is as follows.


### 4.2.1. Initialization

Setupλ⟶GP. Setup: the process runs on blockchain consensus nodes participating in authorization and outputs global public key GP.Authority SetupGP⟶SK,PK. User public key and private key generation: the process runs in the blockchain consensus nodes, with global public key GP as input, and outputs user public key PK and user private key SK.


### 4.2.2. User Identity Key Generation

KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. User identity key generation: the process is run consensus nodes in blockchain that execute the distributed key generation protocol, taking the global public key GP, the user public key PK, the user private keySK, the user attributes set K, the ciphertext access structure P,η, and user’s identity UID as input, and outputs the user identity keyUKUID.


### 4.2.3. Encryption

EncryptGP,SK,PK,UID,F,ρ,Λ,M⟶D,KW. Encryption: this process is run by the DP, taking the global public key GP, the user public key PK, the user private key SK, the user’s identity UID, the user access structure F,ρ, ciphertext attribute set Λ, and plaintext M as input, and outputs ciphertext D and keywords of ciphertext KW.


### 4.2.4. Index Generation

IndexGenGP,PK,KW⟶Index. Index generation: this process is run by the DP, with the global public key GP, the user public key PK, and the keywords of ciphertext KW as input, and outputs the ciphertext index Index.


### 4.2.5. Token Generation

TokenGenGP,UKUID,kw⟶Tok. Token generation: this process is run by the blockchain consensus nodes, with the global public key GP, the user identity key UKUID, and the keywords of the data user kw as input, and outputs user search token Tok.


### 4.2.6. Search

CipherTextSearchGP,Tok,Index⟶D. Search: this process is run by the CS, taking the global public key GP, the user search token Tok, and the ciphertext index Index as input to output the matching ciphertext D.


### 4.2.7. Decryption

ProxyDecryptGP,D,UKUID⟶D′. Proxy decryption: this process is run by the CS, taking the global public key GP, the ciphertext D, and the user identity key UKUID as input. If the ciphertext attribute set Λ satisfies the ciphertext access structure P,η and the user attribute set K satisfies the user access structure F,ρ, the ciphertext is pre-decrypted and sends the intermediate ciphertext D′ returned to the DA.userDecryptGP,D,D′,UKUID⟶M. User decryption: this process is run by the DA, taking the global public key GP, the ciphertext D, the intermediate ciphertext D′, and the user identity key UKUID as input, and outputs plaintext M.The notations used in our scheme are summarized in Table1.Table 1
Notations.
NotationMeaningλA security parameterGPThe global public keySKUser’s private keyPKUser’s public keyUIDUser’s identityKUser’s attribute setP,ηThe ciphertext access structureUKUIDUser’s identity keyF,ρThe user access structureΛThe ciphertext attribute setKWThe keywords of ciphertextIndexThe ciphertext indexkwUser search keywordsTokSearch tokenD/D′Ciphertext of the data/pre-decrypted ciphertext


## 4.2.1. Initialization

Setupλ⟶GP. Setup: the process runs on blockchain consensus nodes participating in authorization and outputs global public key GP.Authority SetupGP⟶SK,PK. User public key and private key generation: the process runs in the blockchain consensus nodes, with global public key GP as input, and outputs user public key PK and user private key SK.


## 4.2.2. User Identity Key Generation

KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. User identity key generation: the process is run consensus nodes in blockchain that execute the distributed key generation protocol, taking the global public key GP, the user public key PK, the user private keySK, the user attributes set K, the ciphertext access structure P,η, and user’s identity UID as input, and outputs the user identity keyUKUID.


## 4.2.3. Encryption

EncryptGP,SK,PK,UID,F,ρ,Λ,M⟶D,KW. Encryption: this process is run by the DP, taking the global public key GP, the user public key PK, the user private key SK, the user’s identity UID, the user access structure F,ρ, ciphertext attribute set Λ, and plaintext M as input, and outputs ciphertext D and keywords of ciphertext KW.


## 4.2.4. Index Generation

IndexGenGP,PK,KW⟶Index. Index generation: this process is run by the DP, with the global public key GP, the user public key PK, and the keywords of ciphertext KW as input, and outputs the ciphertext index Index.


## 4.2.5. Token Generation

TokenGenGP,UKUID,kw⟶Tok. Token generation: this process is run by the blockchain consensus nodes, with the global public key GP, the user identity key UKUID, and the keywords of the data user kw as input, and outputs user search token Tok.


## 4.2.6. Search

CipherTextSearchGP,Tok,Index⟶D. Search: this process is run by the CS, taking the global public key GP, the user search token Tok, and the ciphertext index Index as input to output the matching ciphertext D.


## 4.2.7. Decryption

ProxyDecryptGP,D,UKUID⟶D′. Proxy decryption: this process is run by the CS, taking the global public key GP, the ciphertext D, and the user identity key UKUID as input. If the ciphertext attribute set Λ satisfies the ciphertext access structure P,η and the user attribute set K satisfies the user access structure F,ρ, the ciphertext is pre-decrypted and sends the intermediate ciphertext D′ returned to the DA.userDecryptGP,D,D′,UKUID⟶M. User decryption: this process is run by the DA, taking the global public key GP, the ciphertext D, the intermediate ciphertext D′, and the user identity key UKUID as input, and outputs plaintext M.The notations used in our scheme are summarized in Table1.Table 1
Notations.
NotationMeaningλA security parameterGPThe global public keySKUser’s private keyPKUser’s public keyUIDUser’s identityKUser’s attribute setP,ηThe ciphertext access structureUKUIDUser’s identity keyF,ρThe user access structureΛThe ciphertext attribute setKWThe keywords of ciphertextIndexThe ciphertext indexkwUser search keywordsTokSearch tokenD/D′Ciphertext of the data/pre-decrypted ciphertext


## 4.3. Security Model

### 4.3.1. Ciphertext Indistinguishability

The indistinguishability security under chosen-plaintext attack (IND-CPA) of an STW-ABE scheme is defined by the following game between a challengerC and a probabilistic polynomial-time (PPT) adversary A. Let Au be the authority universe of size t. We define adversary A as a t,n adversary who can compromise at most t−1 authority. This security model adopts the t,n key generation protocol. The description of the game is as follows:(1)
Initialization:C runs the Initialization of STW-ABE and returns the global public key GP, user public key PK, and user private key SK to A.(2)
Query phase I: adversaryA queries the following oracles adaptively.(a)
User Identity Key Oracle. A submits an identity UID to C. C runs the KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. Finally, it returns UKUID to A.(b)
Encryption Oracle. A sends F,ρ,Λ,M to C. C runs the EncryptGP,SK,PK,F,ρ,Λ,M⟶D,KW to generate the ciphertext D. Notice that the user access structure F,ρ does not satisfy the challenge user attribute set K, and the ciphertext attribute set Λ does not satisfy the challenge ciphertext access structure P,η.(3)
Challenge:A submits two plaintexts of equal length M0, M1 and sends them to C. C selects a random number ∂∈0,1 and encrypts the selected plaintext with user access structure F∗,ρ∗ and ciphertext attribute set Λ∗. The final ciphertext will be generated (D∗) and sent to A.(4)
Query phase II:A still can make queries adaptively as in Query Phase I.(5)
Guess:A outputs a guess b′ for b.The advantage ofA in this game is defined as follows:(1)AdvAD=Prb,=b−12.Definition 2.
An STW-ABE scheme is IND-CPA secure if the advantage defined above for anyt,n PPT adversary A is negligible.


### 4.3.2. Index Indistinguishability

Index indistinguishable security (IND-CKA) under chosen access structure and chosen keyword attack is defined as the security game of challengerC and a probabilistic polynomial-time (PPT) adversary A for the STW-ABE scheme. In this scheme, only single keyword ciphertext retrieval is considered. The description of the game is as follows:(1)
Initialization:A defines a user access structure F∗,ρ∗ and ciphertext attribute set Λ∗.(2)
Setup:C runs the Initialization of STW-ABE and returns the global public key GP, user public key PK, and user private key SK to A.(3)
Query phase I: adversaryA queries the following oracles adaptively.(a)
User Identity Key Oracle. A submits an identity UID to C. C runs the KeyGenGP,SK,PK,UID,θ,P,η⟶UKUID. Finally, it returns UKUID to A.(b)
Token Oracle. A send kw to C. C runs the TokenGenGP,SK,kw⟶Tok to generate the token Tok. Notice that the user access structure F,ρ does not satisfy the challenge user attribute set K, and ciphertext attribute set Λ does not satisfy the challenge ciphertext access structure P,η. We assume that all query results (Tok) have at least one matched index that can be searched out.(c)
Index Oracle. A submits UKUID,KW to C, and C runs the IndexGenGP,PK,UKUID,KW⟶Index to generate the index.(4)
Challenge:A submits two keywords of equal length kw0, and kw1 to C. C chooses randomly number b∈0,1 and runs the IndexGenGP,PK,UKUID,KW⟶Index with the challenge user access structure F∗,ρ∗ and ciphertext attribute set Λ∗ to return Index∗ to A.(5)
Query phase II:A still can make queries adaptively as in Query Phase I after receiving the challenge index. Similarly, A cannot query on the user access structure, which satisfies the challenge user attribute set, and ciphertext attribute set, which satisfies the ciphertext access structure.(6)
Guess:A outputs a guess b′ for b.The advantage ofA in this game is defined as follows:(2)AdvAkw=Prb,=b−12.Definition 3.
An STW-ABE scheme is IND-CKA secure if the advantage defined above for any PPT adversaryA is negligible.


## 4.3.1. Ciphertext Indistinguishability

The indistinguishability security under chosen-plaintext attack (IND-CPA) of an STW-ABE scheme is defined by the following game between a challengerC and a probabilistic polynomial-time (PPT) adversary A. Let Au be the authority universe of size t. We define adversary A as a t,n adversary who can compromise at most t−1 authority. This security model adopts the t,n key generation protocol. The description of the game is as follows:(1)
Initialization:C runs the Initialization of STW-ABE and returns the global public key GP, user public key PK, and user private key SK to A.(2)
Query phase I: adversaryA queries the following oracles adaptively.(a)
User Identity Key Oracle. A submits an identity UID to C. C runs the KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. Finally, it returns UKUID to A.(b)
Encryption Oracle. A sends F,ρ,Λ,M to C. C runs the EncryptGP,SK,PK,F,ρ,Λ,M⟶D,KW to generate the ciphertext D. Notice that the user access structure F,ρ does not satisfy the challenge user attribute set K, and the ciphertext attribute set Λ does not satisfy the challenge ciphertext access structure P,η.(3)
Challenge:A submits two plaintexts of equal length M0, M1 and sends them to C. C selects a random number ∂∈0,1 and encrypts the selected plaintext with user access structure F∗,ρ∗ and ciphertext attribute set Λ∗. The final ciphertext will be generated (D∗) and sent to A.(4)
Query phase II:A still can make queries adaptively as in Query Phase I.(5)
Guess:A outputs a guess b′ for b.The advantage ofA in this game is defined as follows:(1)AdvAD=Prb,=b−12.Definition 2.
An STW-ABE scheme is IND-CPA secure if the advantage defined above for anyt,n PPT adversary A is negligible.


## 4.3.2. Index Indistinguishability

Index indistinguishable security (IND-CKA) under chosen access structure and chosen keyword attack is defined as the security game of challengerC and a probabilistic polynomial-time (PPT) adversary A for the STW-ABE scheme. In this scheme, only single keyword ciphertext retrieval is considered. The description of the game is as follows:(1)
Initialization:A defines a user access structure F∗,ρ∗ and ciphertext attribute set Λ∗.(2)
Setup:C runs the Initialization of STW-ABE and returns the global public key GP, user public key PK, and user private key SK to A.(3)
Query phase I: adversaryA queries the following oracles adaptively.(a)
User Identity Key Oracle. A submits an identity UID to C. C runs the KeyGenGP,SK,PK,UID,θ,P,η⟶UKUID. Finally, it returns UKUID to A.(b)
Token Oracle. A send kw to C. C runs the TokenGenGP,SK,kw⟶Tok to generate the token Tok. Notice that the user access structure F,ρ does not satisfy the challenge user attribute set K, and ciphertext attribute set Λ does not satisfy the challenge ciphertext access structure P,η. We assume that all query results (Tok) have at least one matched index that can be searched out.(c)
Index Oracle. A submits UKUID,KW to C, and C runs the IndexGenGP,PK,UKUID,KW⟶Index to generate the index.(4)
Challenge:A submits two keywords of equal length kw0, and kw1 to C. C chooses randomly number b∈0,1 and runs the IndexGenGP,PK,UKUID,KW⟶Index with the challenge user access structure F∗,ρ∗ and ciphertext attribute set Λ∗ to return Index∗ to A.(5)
Query phase II:A still can make queries adaptively as in Query Phase I after receiving the challenge index. Similarly, A cannot query on the user access structure, which satisfies the challenge user attribute set, and ciphertext attribute set, which satisfies the ciphertext access structure.(6)
Guess:A outputs a guess b′ for b.The advantage ofA in this game is defined as follows:(2)AdvAkw=Prb,=b−12.Definition 3.
An STW-ABE scheme is IND-CKA secure if the advantage defined above for any PPT adversaryA is negligible.


## 5. Construction

This section presents a detailed construction of our STW-ABE scheme, including initialization, user identity key generation, encryption, decryption, token generation, and search.


### 5.1. Initialization

This stage is divided into two parts. First, the blockchain consensus node executes the distributed key generation protocol to generate the global public key. Then, the blockchain consensus nodes generate user public and private keys.Part One. Setupλ⟶GP. First, the q-order bilinear group G0 with generator g and bilinear mapping G0×G0⟶GT is selected in the setup. In addition, the description of a hash function H༚0,1∗⟶G0 that maps user identity UID to elements of G0 is published. Finally, the global public key is generated.(3)GP=g,H.Part Two. Authority SetupGP⟶SK,PK. The authorization center CNii=1,2,…,n manages the set of user attributes U˜i and ciphertext attributes U^i of all users. CNirandom selection of parameters αq∈ZP∗q∈U¯i, βd∈ZP∗d∈U^i according to the attribute set. Then, blockchain consensus nodes generate user public key PK=eg,gαi,gβi and user private key SK=αi,βi.


### 5.2. User Identity Key Generation

KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. This KeyGen is run by the consensus nodes that execute the distributed key generation protocol, taking the global public key GP, the user public key PK, the user private key SK, the user attributes set K, the ciphertext access structure P,η, and user’s identity UID as inputs to output the user identity key UKUID.(1)
LetP be a lo×ko matrix. The process randomly selects φ∈ZP∗, yi∈ZP∗i=2,…,ko and constructs the vector v⟶ko=φ,y2,…,ykoT and vector w⟶ko=0,y2,…,ykoT. φ is the secret value to be shared.(2)
LetPx be the x-th row of the matrix P, and calculate σx=Px⋅v⟶ko, τx=Px⋅w⟶ko.(3)
Selectμx∈ZP∗,x=1,2,…,lo for each Px to calculate the following equation:(4)U=eg,gφ,Ux,1=eg,gσxeg,gαηxμx,Ux,2=gμx,Ux,3=gβηxμxgτx.(4)
Create a key that belongs to a primary attributett∈K for the user identity UID and do the following calculation: Ut=gαtHUIDβt.(5)
Finally, the user identity key is generated (UKUID=P,η,U,Ux,1,Ux,2,Ux,3x=1,2,…,lo,Utt∈K) and sent to the DA.


### 5.3. Encryption

The encryption consists of two processes, namely, encryptionEncryptGP,SK,PK,UID,F,ρ,Λ,M⟶D,KW and the index generation IndexGenGP,SK,PK,KW⟶Index.EncryptGP,SK,PK,UID,F,ρ,Λ,M⟶D,KW. This process is run by the DP, taking the global public key GP, the user public key PK, the user private key SK, the user identity UID, the user access structure F,ρ, ciphertext attribute set Λ, and plaintext M as input.(1)
LetF be a le×ke matrix. The process first randomly selects s∈ZP∗, tj∈ZP∗j=2,…,ke. Let vector v⟶ke=s,t2,…,tkeT, w⟶ke=0,t2,…,tkeT, and s be the secret value to be shared.(2)
LetFx be the x-th row of the matrix F, and λx=Fx⋅v⟶ke, μx=Fx⋅w⟶ke.(3)
Selectrx∈ZP∗,x=1,2,…,le for each Fx to calculate the following equation:(5)D=Meg,gs,Dx,1=eg,gλxeg,gαρxrx,Dx,2=grx,Dx,3=gβρxrxgμx.(4)
Create a key that belongs to the corresponding subattributeii∈Λ for the encrypted file, and the following calculation is performed:(6)Dk=gαkHUIDβk.(5)
Finally, the ciphertext is generated:(7)D=F,ρ,D,Dx,1,Dx,2,Dx,3x=1,2,…,le,Dkk∈Λ,and sent to the CS.IndexGenGP,PK,KW⟶Index. This process was conducted by DP on local devices, with the global public key GP, the user public key PK, and the keywords of ciphertext KW as inputs. Uw is the number of data keywords. The following calculations are performed to encrypt each keyword into a ciphertext index.(8)Idx1,ω=eg,gαω⋅φ⋅Hkwk,Idx2,i=gβi⋅φ.Finally, the ciphertext indexIndex=Idx1,ωω∈Uw,Idx2,i is obtained and sent to the CS.


### 5.4. Token Generation

TokenGenGP,UKUID,kw⟶Tok. This process is run by the consensus nodes that execute the distributed key generation protocol, with the global public key GP, the user identity key UKUID, and the keywords of the data users kw as input. The following calculations are performed.(9)toki=gαiβiHkw.Finally, the user tokens are generated (Tok=toki) and sent to the CS.


### 5.5. Search

CipherTextSearchGP,Tok,Index⟶D. The search is conducted by the CS. This process takes the global public key GP, the user search token Tok, and the ciphertext index Index as input. Suppose the ciphertext search is successful, output the ciphertext. Otherwise, the process is terminated.(1)
Judge if the following equation holds:(10)Idx1,ω=∏i∈UieIdx2,i,toki.(2)
If yes, output the storage ciphertextD; else, abort.


### 5.6. Decryption

The decryption consists of two processes, namely, the proxy decryption processProxyDecryptGP,D,UKUID⟶D′ and the user decryption process userDecryptGP,D,D′,UKUID⟶M.ProxyDecryptGP,D,UKUID⟶D′. Proxy decryption is run by the CS, taking the global public key GP, the ciphertext D, and the user identity key UKUID as input. Determine whether the user attributes satisfy the file access permission, whether the ciphertext attribute set Λ satisfies the ciphertext access structure P,η, and whether the user attribute set K satisfies the user access structure F,ρ.Verify that the user attribute set satisfies the user access structure; randomly selectedcx∈ZP∗ makes ∑x∈θcxλx=s,∑x∈θcxμx=0. Similarly, verify that the ciphertext attribute set satisfies the ciphertext access structure; randomly selected dy∈ZP∗ makes ∑y∈ωdyσy=φ,∑y∈ωdyτy=0. If the authentication succeeds, perform the following calculation for the ciphertext pre-decryption.Pre-decryption equation:(11)D′=∏x∈KDx,1⋅eHUID,Dx,3/eKˇρx,Dx,2cx∏y∈ΛUy,1⋅eHUID,Uy,3/eCˇηy,Uy,2dy=∏x∈Keg,gσxeHUID,gτxcx∏y∈Λeg,gλyeHUID,gμydy=eg,gseg,gφ.userDecryptGP,D,D′,UKUID⟶M. The user decryption is run by DA, taking the global public key GP, the ciphertext D, the intermediate ciphertext D′, and the user identity key UKUID as input.Decryption equation:(12)M=DD′⋅U.


## 5.1. Initialization

This stage is divided into two parts. First, the blockchain consensus node executes the distributed key generation protocol to generate the global public key. Then, the blockchain consensus nodes generate user public and private keys.Part One. Setupλ⟶GP. First, the q-order bilinear group G0 with generator g and bilinear mapping G0×G0⟶GT is selected in the setup. In addition, the description of a hash function H༚0,1∗⟶G0 that maps user identity UID to elements of G0 is published. Finally, the global public key is generated.(3)GP=g,H.Part Two. Authority SetupGP⟶SK,PK. The authorization center CNii=1,2,…,n manages the set of user attributes U˜i and ciphertext attributes U^i of all users. CNirandom selection of parameters αq∈ZP∗q∈U¯i, βd∈ZP∗d∈U^i according to the attribute set. Then, blockchain consensus nodes generate user public key PK=eg,gαi,gβi and user private key SK=αi,βi.


## 5.2. User Identity Key Generation

KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. This KeyGen is run by the consensus nodes that execute the distributed key generation protocol, taking the global public key GP, the user public key PK, the user private key SK, the user attributes set K, the ciphertext access structure P,η, and user’s identity UID as inputs to output the user identity key UKUID.(1)
LetP be a lo×ko matrix. The process randomly selects φ∈ZP∗, yi∈ZP∗i=2,…,ko and constructs the vector v⟶ko=φ,y2,…,ykoT and vector w⟶ko=0,y2,…,ykoT. φ is the secret value to be shared.(2)
LetPx be the x-th row of the matrix P, and calculate σx=Px⋅v⟶ko, τx=Px⋅w⟶ko.(3)
Selectμx∈ZP∗,x=1,2,…,lo for each Px to calculate the following equation:(4)U=eg,gφ,Ux,1=eg,gσxeg,gαηxμx,Ux,2=gμx,Ux,3=gβηxμxgτx.(4)
Create a key that belongs to a primary attributett∈K for the user identity UID and do the following calculation: Ut=gαtHUIDβt.(5)
Finally, the user identity key is generated (UKUID=P,η,U,Ux,1,Ux,2,Ux,3x=1,2,…,lo,Utt∈K) and sent to the DA.


## 5.3. Encryption

The encryption consists of two processes, namely, encryptionEncryptGP,SK,PK,UID,F,ρ,Λ,M⟶D,KW and the index generation IndexGenGP,SK,PK,KW⟶Index.EncryptGP,SK,PK,UID,F,ρ,Λ,M⟶D,KW. This process is run by the DP, taking the global public key GP, the user public key PK, the user private key SK, the user identity UID, the user access structure F,ρ, ciphertext attribute set Λ, and plaintext M as input.(1)
LetF be a le×ke matrix. The process first randomly selects s∈ZP∗, tj∈ZP∗j=2,…,ke. Let vector v⟶ke=s,t2,…,tkeT, w⟶ke=0,t2,…,tkeT, and s be the secret value to be shared.(2)
LetFx be the x-th row of the matrix F, and λx=Fx⋅v⟶ke, μx=Fx⋅w⟶ke.(3)
Selectrx∈ZP∗,x=1,2,…,le for each Fx to calculate the following equation:(5)D=Meg,gs,Dx,1=eg,gλxeg,gαρxrx,Dx,2=grx,Dx,3=gβρxrxgμx.(4)
Create a key that belongs to the corresponding subattributeii∈Λ for the encrypted file, and the following calculation is performed:(6)Dk=gαkHUIDβk.(5)
Finally, the ciphertext is generated:(7)D=F,ρ,D,Dx,1,Dx,2,Dx,3x=1,2,…,le,Dkk∈Λ,and sent to the CS.IndexGenGP,PK,KW⟶Index. This process was conducted by DP on local devices, with the global public key GP, the user public key PK, and the keywords of ciphertext KW as inputs. Uw is the number of data keywords. The following calculations are performed to encrypt each keyword into a ciphertext index.(8)Idx1,ω=eg,gαω⋅φ⋅Hkwk,Idx2,i=gβi⋅φ.Finally, the ciphertext indexIndex=Idx1,ωω∈Uw,Idx2,i is obtained and sent to the CS.


## 5.4. Token Generation

TokenGenGP,UKUID,kw⟶Tok. This process is run by the consensus nodes that execute the distributed key generation protocol, with the global public key GP, the user identity key UKUID, and the keywords of the data users kw as input. The following calculations are performed.(9)toki=gαiβiHkw.Finally, the user tokens are generated (Tok=toki) and sent to the CS.


## 5.5. Search

CipherTextSearchGP,Tok,Index⟶D. The search is conducted by the CS. This process takes the global public key GP, the user search token Tok, and the ciphertext index Index as input. Suppose the ciphertext search is successful, output the ciphertext. Otherwise, the process is terminated.(1)
Judge if the following equation holds:(10)Idx1,ω=∏i∈UieIdx2,i,toki.(2)
If yes, output the storage ciphertextD; else, abort.


## 5.6. Decryption

The decryption consists of two processes, namely, the proxy decryption processProxyDecryptGP,D,UKUID⟶D′ and the user decryption process userDecryptGP,D,D′,UKUID⟶M.ProxyDecryptGP,D,UKUID⟶D′. Proxy decryption is run by the CS, taking the global public key GP, the ciphertext D, and the user identity key UKUID as input. Determine whether the user attributes satisfy the file access permission, whether the ciphertext attribute set Λ satisfies the ciphertext access structure P,η, and whether the user attribute set K satisfies the user access structure F,ρ.Verify that the user attribute set satisfies the user access structure; randomly selectedcx∈ZP∗ makes ∑x∈θcxλx=s,∑x∈θcxμx=0. Similarly, verify that the ciphertext attribute set satisfies the ciphertext access structure; randomly selected dy∈ZP∗ makes ∑y∈ωdyσy=φ,∑y∈ωdyτy=0. If the authentication succeeds, perform the following calculation for the ciphertext pre-decryption.Pre-decryption equation:(11)D′=∏x∈KDx,1⋅eHUID,Dx,3/eKˇρx,Dx,2cx∏y∈ΛUy,1⋅eHUID,Uy,3/eCˇηy,Uy,2dy=∏x∈Keg,gσxeHUID,gτxcx∏y∈Λeg,gλyeHUID,gμydy=eg,gseg,gφ.userDecryptGP,D,D′,UKUID⟶M. The user decryption is run by DA, taking the global public key GP, the ciphertext D, the intermediate ciphertext D′, and the user identity key UKUID as input.Decryption equation:(12)M=DD′⋅U.


## 6. Security and Performance Analysis

### 6.1. Security Analysis

The STW-ABE simplifies the security problem to a decisional bilinear Diffie–Hellman (DBDH) problem.Theorem 1.
The STW-ABE scheme is IND-CPA secure if the decisional bilinear Diffie–Hellman (DBDH) problem is hard.Proof.
If adversaryA can break the STW-ABE scheme with a non-negligible advantage, adversary A can solve the DBDH problem with a non-negligible advantage. Aq-order bilinear group G0 with generator g and bilinear mapping G0×G0⟶GT exists. C plays as the challenger in the following steps. Given an instance of the DBDH problem g,ga,gb,gc,Z, where a,b,c,z∈Zq are randomly selected. ρ∈0,1; when ρ=0, Z=eg,gabc; when ρ=1, Z=eg,gz.
Initialization. C runs the Initialization of STW-ABE and returns the global public key GP, user public key PK, and user private key SK to A.
Query Phase I. Adversary A queries the following oracles adaptively.
User Identity Key Oracle. A submits an identity UID to C. C runs the KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. Finally, it returns UKUID to A.
Encryption Oracle. A sends F,ρ,Λ,M to C. C runs the EncryptGP,SK,PK,F,ρ,Λ,M to generate the ciphertext D. Notice that the primary access structure F,ρ does not satisfy the challenge primary attribute set K, and ciphertext attribute set Λ does not satisfy the challenge secondary access structure P,η.
Challenge. A submits two plaintexts of equal length M0, M1 and sends them to C. C selects a random number ∂∈0,1 and then encrypts the selected plaintext with user access structure F∗,ρ∗ and ciphertext attribute set Λ∗. The final ciphertext D∗ will be generated and sent to A.
Query Phase II. A still can make queries adaptively as in Query Phase I after receiving the challenge ciphertext D. Similarly, A cannot query the user access structure that satisfies the challenge user attribute set and the ciphertext attribute set that satisfies the ciphertext access structure.
Guess. A outputs a guess ∂′ for ∂. If ∂′=∂, C outputs ρ′=0, and C receives a tuple g,ga,gb,gc,eg,gabc. Otherwise, C outputs ρ′=1, and C receives a tuple g,ga,gb,gc,eg,gz. The advantage of A is analyzed as follows.
Whenρ=1, Z=eg,gz, A cannot obtain the information of D. Thus, Pr∂′≠∂|∂=1=1/2. When ρ′=1, Prρ′=ρ|ρ=1=1/2.
Whenρ=0, Z=eg,gabc, A obtains ciphertext D. Thus, Pr∂′=∂|∂=0=1/2+ϵ. When ρ′=0, Prρ′=ρ|ρ=0=1/2+ϵ.
Thus,C guesses ρ′=ρ, and the correct advantage is(13)Adv=Prρ′=ρ−12=12Prρ′=ρ|ρ=1+12Prρ′=ρ|ρ=0−12=ϵ2.
In summary, if adversaryA can break the proposed scheme with a non-negligible advantage in polynomial time, a scheme that can solve the DBDH problem with a non-negligible advantage ϵ/2 in polynomial time exists. However, the DBDH problem is difficult, so the STW-ABE scheme is IND-CPA secure.Theorem 2.
The STW-ABE scheme is IND-CKA secure if the decisional bilinear Diffie–Hellman (DBDH) problem is hard.Proof.
Assume that there is a PPT adversaryA who can win the index indistinguishability security game defined in Section 4.3.2 with non-negligible advantage ε. Then, we can construct a C to solve the DBDH problem with a non-negligible advantage ε/2. C plays as the challenger in the following steps. Given an instance of the DBDH problem g,ga,gb,gc,Z, where a,b,c,z∈Zq are randomly selected. ρ∈0,1; when ρ=0, Z=eg,gabc; when ρ=1, Z=eg,gz.
Initialization. A defines a user access structure F∗,ρ∗ and ciphertext attribute set Λ∗.
Setup. C runs the Initialization of STW-ABE and returns the global public key GP, user public key PK, and user private key SK to A.
Query Phase I. Adversary A queries the following oracles adaptively.
User Identity Key Oracle. A submits an identity UID to C. C runs the KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. Finally, it returns UKUID to A.
Token Oracle. A sends kw to C. C runs the TokenGenGP,SK,kw⟶Tok to generate the token Tok. Notice that the user access structure F,ρ does not satisfy the challenge user attribute set K, and the ciphertext attribute set Λ does not satisfy the challenge ciphertext access structure P,η. We assume that all query results (Tok) have at least one matched index that can be searched out.
Index Oracle. A submits UKUID,KW to C, and C runs the IndexGenGP,PK,UKUID,KW to generate the index.
Challenge. A submits two keywords of equal length kw0 and kw1 to C. C chooses number b∈0,1 randomly and runs the IndexGenGP,PK,UKUID,KW⟶Index with the challenge user access structure F∗,ρ∗ and ciphertext attribute set Λ∗ to return Index∗ to A.(14)Idx1,kwb∗=ZHkwb,Idx2∗=Ab.
The advantage ofA is analyzed as follows.
WhenZ=eg,gabc, we set s=a,α=bc; then, the index presented as follows is identical to an actual index:(15)Idx1,kwb∗=eg,gabcHkwb=eg,gα⋅φ⋅HkwbIdx2=gb⋅φ.
WhenZ=eg,gz, due to the randomness of z, this index is random to the adversary and contains no information about b.
Query Phase II. A still can make queries adaptively as in Query Phase I after receiving the challenge Index. Similarly, A cannot query the user access structure that satisfies the challenge user attribute set and the ciphertext attribute set that satisfies the ciphertext access structure.
Guess. A outputs a guess b′ for b. If Z=eg,gabc, the probability of A outputs b′=b is 1/2+ϵ. If Z=eg,gz, the probability of A outputs b′=b is 1/2. Thus, the advantage of C solving the DBDH problem is(16)Adv=12Prb′=b|Z=eg,gabc+12Prb′=b|Z=eg,gz−12=1212+ϵ+12·12−12=ϵ2.
Because the DBDH problem is hard, we can get thatϵ/2 is negligible. In other words, the advantage of A breaking our scheme is negligible, and our scheme achieves chosen keyword security.


### 6.2. Performance Analysis

In this section, we analyze the performance and computational efficiency of STW-ABE. We compare the performance of STW-ABE with other schemes in Table2, where “√” indicates that the solution supports this method. “×” indicates that the solution does not support this method. In Table 3, we compare the computational efficiency of STW-ABE with other schemes, in which E represents an exponential operation, P represents a pairing operation, H represents a hash operation, i represents the number of attributes in the authorized institution, n represents the number of keywords in each document, m is the number of keywords searched by the user, Mi is the number of the ciphertext attributes, and Me is the number of the user attributes.Table 2
Comparison of functions.
SchemeDP-ABEPAB-MSKD-ABEBC-SABESTW-ABETwo-way√×××√Searchable encryption×√×√√Proxy encryption√√√√√Table 3
Comparison of computational methods.
SchemeDP-ABEPAB-MSKD-ABEBC-SABESTW-ABEEncryption6Mi+5E+H3n+3E+H5i+1E4i+3E3Mi+2E+HIndex generation—3n+3E—3n+1E+H2i+nE+HToken generation—2m+3E—2m+2E+Hi+mE+HSearch—E+2n+4P—iE+2i+1PMiE+i+mPDecryptionUser:2ECloud:2E+Mi+MePiE+2iPiE+2iPUser:ECloud:iE+3i+2PUser:ECloud:( Mi + Me)PAs seen in Table2, our scheme not only realizes two-way access control of ciphertext search but also uses CS to provide outsourced decryption service, reducing the computational pressure on users.Table3 compares the computational efficiency of encryption, decryption, index generation, token generation, and ciphertext search. In our scheme, first, the user needs to perform a 3Mi+2 exponential operation and a hash operation to encrypt the data, in which only one exponential operation is required for each ciphertext attribute. The user performs a hash operation on each ciphertext keyword and 2i+n exponential operation to generate a ciphertext index. Secondly, the cloud server performs a hash operation and i+m exponential operation for each keyword to be searched to generate a token for data users. Then, the cloud server performs a ciphertext search by an exponential operation of Mi and pairing operation time of i+m. In decryption, the scheme divides the decryption cost into the user part (denoted as User) and the cloud server part (denoted as Cloud). The cloud server performs the pairing operation Mi+Me. The user then only needs to perform the exponential operation once to decrypt the ciphertext into plaintext. Furthermore, the STW-ABE scheme is compared with two multi-permission ABE schemes, DP-ABE [5] and D-ABE [21], and two searchable encryption schemes, PAB-MSK [11] and BC-SABE [19], in Table 3. The cost of linear secret-sharing protocol is ignored in efficiency analysis.Figures2 and 3 contain the simulation results of the five processes. We simulated this on an Ubuntu 16 desktop system. The system has an Intel Core i7-8700 CPU and 4GB RAM. All programs were developed using Charm (version 0.50) [27], a rapid prototyping framework based on the Python encryption scheme.Figure 2
Time cost of encryption and decryption. (a) Encryption time. (b) Decryption time.
(a)(b)Figure 3
Time costs of ciphertext search. (a) Ciphertext index generation time. (b) Token generation time. (c) Ciphertext search time.
(a)(b)(c)Figure2(a) shows the encryption time cost of three ABE schemes with multiple authority agencies. As seen in the figure, the time cost of all the resulting schemes has a linear relationship with the number of attributes contained in the encrypted access structure. Figure 2(b) shows the decryption time cost of schemes D-ABE, BC-SABE, and STW-ABE. As seen in Figure 2, the time cost of cloud decryption of D-ABE, BC-SABE, and STW-ABE has a linear relationship with the number of attributes, and the user decryption cost in STW-ABE is independent of the number of attributes. Since STW-ABE outsources most of the decryption work to cloud servers, the computing pressure on users is greatly reduced. This scheme is more suitable for using lightweight devices in the IoT environment.Figure3(a) shows the time cost of the generated ciphertext index. It can be seen from the figure that STW-ABE has better computing performance than scheme PAB-MKS and scheme BC-SABE. Figure 3(b) shows the simulation results of the time cost required for the generation of the Token. The time cost of the schemes is linearly related to the number of attributes, but it can be seen that the time cost of STW-ABE is much shorter than that of scheme BC-SABE. Figure 3(c) shows the time cost of the search process under simulation. In this scheme, the file index and the number of files are fixed as simulated constants. The results of the search process represent only the performance of the search process and do not include the time cost of searching the actual database. As seen in Figure 3(c), the time cost of the STW-ABE search process is similar to that of the search process in the PAB-MKS scheme and the BC-SABE scheme. Moreover, they are all linearly related to the number of attributes.Discussion. There are two concerns when designing searchable encryption access control schemes. (1) Security. In Section 4.1, the two-way access control scheme based on searchable encryption has been proven to be IND-CPA security and IND-CKA security, which is also achieved by most searchable encryption schemes. In this paper, we use the distributed feature of blockchain and change the central authorization model in traditional access control to a blockchain consensus node with DKG that generates the relevant secret key. Where DKG follows thet,nn≤tsharing principle,t is the total number of blockchain consensus nodes involved in key generation, andnis the minimum number of consensus nodes involved in key generation. The secret key sharing must be participated by more than n consensus nodes, thus improving the robustness of the scheme. At the same time, a blockchain is a distributed ledger that ensures data integrity, immutability, and traceability of the information stored in it such as global public keys and user keys. (2) Efficiency. In this paper, the simulation experiment simulated the efficiency of the scheme and compared it with other schemes. It can be found that this scheme has certain advantages in implementation efficiency. In the decryption process, considering that most IoT devices have limited resources and cannot perform efficient decryption calculations, this scheme uses cloud servers to assist users in decryption. A large amount of decryption computation is outsourced to CS, thus reducing the computational pressure on users. This scheme adopts a distributed key generation protocol, and multiple blockchain consensus nodes participate in generating users’ public and private key pairs, which will not affect the security and robustness of the scheme. Meanwhile, the secret keys generated by blockchain nodes do not need to respond to user requests in real time, so the time cost of secret key generation is not simulated in this paper. Among them, in the BC-SABE scheme, the cloud server is used to complete the generation of tokens with the user jointly, and the user does not need to perform the calculation related to the number of attributes. In the BC-SABE scheme, the token generation time by the blockchain consensus node is not given, so there is no comparison between them in Figure 3(b). Similarly, the generation of a token in STW-ABE is completed by the blockchain consensus node. The user does not need to calculate the consumption in the generation of tokens.


## 6.1. Security Analysis

The STW-ABE simplifies the security problem to a decisional bilinear Diffie–Hellman (DBDH) problem.Theorem 1.
The STW-ABE scheme is IND-CPA secure if the decisional bilinear Diffie–Hellman (DBDH) problem is hard.Proof.
If adversaryA can break the STW-ABE scheme with a non-negligible advantage, adversary A can solve the DBDH problem with a non-negligible advantage. Aq-order bilinear group G0 with generator g and bilinear mapping G0×G0⟶GT exists. C plays as the challenger in the following steps. Given an instance of the DBDH problem g,ga,gb,gc,Z, where a,b,c,z∈Zq are randomly selected. ρ∈0,1; when ρ=0, Z=eg,gabc; when ρ=1, Z=eg,gz.
Initialization. C runs the Initialization of STW-ABE and returns the global public key GP, user public key PK, and user private key SK to A.
Query Phase I. Adversary A queries the following oracles adaptively.
User Identity Key Oracle. A submits an identity UID to C. C runs the KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. Finally, it returns UKUID to A.
Encryption Oracle. A sends F,ρ,Λ,M to C. C runs the EncryptGP,SK,PK,F,ρ,Λ,M to generate the ciphertext D. Notice that the primary access structure F,ρ does not satisfy the challenge primary attribute set K, and ciphertext attribute set Λ does not satisfy the challenge secondary access structure P,η.
Challenge. A submits two plaintexts of equal length M0, M1 and sends them to C. C selects a random number ∂∈0,1 and then encrypts the selected plaintext with user access structure F∗,ρ∗ and ciphertext attribute set Λ∗. The final ciphertext D∗ will be generated and sent to A.
Query Phase II. A still can make queries adaptively as in Query Phase I after receiving the challenge ciphertext D. Similarly, A cannot query the user access structure that satisfies the challenge user attribute set and the ciphertext attribute set that satisfies the ciphertext access structure.
Guess. A outputs a guess ∂′ for ∂. If ∂′=∂, C outputs ρ′=0, and C receives a tuple g,ga,gb,gc,eg,gabc. Otherwise, C outputs ρ′=1, and C receives a tuple g,ga,gb,gc,eg,gz. The advantage of A is analyzed as follows.
Whenρ=1, Z=eg,gz, A cannot obtain the information of D. Thus, Pr∂′≠∂|∂=1=1/2. When ρ′=1, Prρ′=ρ|ρ=1=1/2.
Whenρ=0, Z=eg,gabc, A obtains ciphertext D. Thus, Pr∂′=∂|∂=0=1/2+ϵ. When ρ′=0, Prρ′=ρ|ρ=0=1/2+ϵ.
Thus,C guesses ρ′=ρ, and the correct advantage is(13)Adv=Prρ′=ρ−12=12Prρ′=ρ|ρ=1+12Prρ′=ρ|ρ=0−12=ϵ2.
In summary, if adversaryA can break the proposed scheme with a non-negligible advantage in polynomial time, a scheme that can solve the DBDH problem with a non-negligible advantage ϵ/2 in polynomial time exists. However, the DBDH problem is difficult, so the STW-ABE scheme is IND-CPA secure.Theorem 2.
The STW-ABE scheme is IND-CKA secure if the decisional bilinear Diffie–Hellman (DBDH) problem is hard.Proof.
Assume that there is a PPT adversaryA who can win the index indistinguishability security game defined in Section 4.3.2 with non-negligible advantage ε. Then, we can construct a C to solve the DBDH problem with a non-negligible advantage ε/2. C plays as the challenger in the following steps. Given an instance of the DBDH problem g,ga,gb,gc,Z, where a,b,c,z∈Zq are randomly selected. ρ∈0,1; when ρ=0, Z=eg,gabc; when ρ=1, Z=eg,gz.
Initialization. A defines a user access structure F∗,ρ∗ and ciphertext attribute set Λ∗.
Setup. C runs the Initialization of STW-ABE and returns the global public key GP, user public key PK, and user private key SK to A.
Query Phase I. Adversary A queries the following oracles adaptively.
User Identity Key Oracle. A submits an identity UID to C. C runs the KeyGenGP,SK,PK,UID,K,P,η⟶UKUID. Finally, it returns UKUID to A.
Token Oracle. A sends kw to C. C runs the TokenGenGP,SK,kw⟶Tok to generate the token Tok. Notice that the user access structure F,ρ does not satisfy the challenge user attribute set K, and the ciphertext attribute set Λ does not satisfy the challenge ciphertext access structure P,η. We assume that all query results (Tok) have at least one matched index that can be searched out.
Index Oracle. A submits UKUID,KW to C, and C runs the IndexGenGP,PK,UKUID,KW to generate the index.
Challenge. A submits two keywords of equal length kw0 and kw1 to C. C chooses number b∈0,1 randomly and runs the IndexGenGP,PK,UKUID,KW⟶Index with the challenge user access structure F∗,ρ∗ and ciphertext attribute set Λ∗ to return Index∗ to A.(14)Idx1,kwb∗=ZHkwb,Idx2∗=Ab.
The advantage ofA is analyzed as follows.
WhenZ=eg,gabc, we set s=a,α=bc; then, the index presented as follows is identical to an actual index:(15)Idx1,kwb∗=eg,gabcHkwb=eg,gα⋅φ⋅HkwbIdx2=gb⋅φ.
WhenZ=eg,gz, due to the randomness of z, this index is random to the adversary and contains no information about b.
Query Phase II. A still can make queries adaptively as in Query Phase I after receiving the challenge Index. Similarly, A cannot query the user access structure that satisfies the challenge user attribute set and the ciphertext attribute set that satisfies the ciphertext access structure.
Guess. A outputs a guess b′ for b. If Z=eg,gabc, the probability of A outputs b′=b is 1/2+ϵ. If Z=eg,gz, the probability of A outputs b′=b is 1/2. Thus, the advantage of C solving the DBDH problem is(16)Adv=12Prb′=b|Z=eg,gabc+12Prb′=b|Z=eg,gz−12=1212+ϵ+12·12−12=ϵ2.
Because the DBDH problem is hard, we can get thatϵ/2 is negligible. In other words, the advantage of A breaking our scheme is negligible, and our scheme achieves chosen keyword security.


## 6.2. Performance Analysis

In this section, we analyze the performance and computational efficiency of STW-ABE. We compare the performance of STW-ABE with other schemes in Table2, where “√” indicates that the solution supports this method. “×” indicates that the solution does not support this method. In Table 3, we compare the computational efficiency of STW-ABE with other schemes, in which E represents an exponential operation, P represents a pairing operation, H represents a hash operation, i represents the number of attributes in the authorized institution, n represents the number of keywords in each document, m is the number of keywords searched by the user, Mi is the number of the ciphertext attributes, and Me is the number of the user attributes.Table 2
Comparison of functions.
SchemeDP-ABEPAB-MSKD-ABEBC-SABESTW-ABETwo-way√×××√Searchable encryption×√×√√Proxy encryption√√√√√Table 3
Comparison of computational methods.
SchemeDP-ABEPAB-MSKD-ABEBC-SABESTW-ABEEncryption6Mi+5E+H3n+3E+H5i+1E4i+3E3Mi+2E+HIndex generation—3n+3E—3n+1E+H2i+nE+HToken generation—2m+3E—2m+2E+Hi+mE+HSearch—E+2n+4P—iE+2i+1PMiE+i+mPDecryptionUser:2ECloud:2E+Mi+MePiE+2iPiE+2iPUser:ECloud:iE+3i+2PUser:ECloud:( Mi + Me)PAs seen in Table2, our scheme not only realizes two-way access control of ciphertext search but also uses CS to provide outsourced decryption service, reducing the computational pressure on users.Table3 compares the computational efficiency of encryption, decryption, index generation, token generation, and ciphertext search. In our scheme, first, the user needs to perform a 3Mi+2 exponential operation and a hash operation to encrypt the data, in which only one exponential operation is required for each ciphertext attribute. The user performs a hash operation on each ciphertext keyword and 2i+n exponential operation to generate a ciphertext index. Secondly, the cloud server performs a hash operation and i+m exponential operation for each keyword to be searched to generate a token for data users. Then, the cloud server performs a ciphertext search by an exponential operation of Mi and pairing operation time of i+m. In decryption, the scheme divides the decryption cost into the user part (denoted as User) and the cloud server part (denoted as Cloud). The cloud server performs the pairing operation Mi+Me. The user then only needs to perform the exponential operation once to decrypt the ciphertext into plaintext. Furthermore, the STW-ABE scheme is compared with two multi-permission ABE schemes, DP-ABE [5] and D-ABE [21], and two searchable encryption schemes, PAB-MSK [11] and BC-SABE [19], in Table 3. The cost of linear secret-sharing protocol is ignored in efficiency analysis.Figures2 and 3 contain the simulation results of the five processes. We simulated this on an Ubuntu 16 desktop system. The system has an Intel Core i7-8700 CPU and 4GB RAM. All programs were developed using Charm (version 0.50) [27], a rapid prototyping framework based on the Python encryption scheme.Figure 2
Time cost of encryption and decryption. (a) Encryption time. (b) Decryption time.
(a)(b)Figure 3
Time costs of ciphertext search. (a) Ciphertext index generation time. (b) Token generation time. (c) Ciphertext search time.
(a)(b)(c)Figure2(a) shows the encryption time cost of three ABE schemes with multiple authority agencies. As seen in the figure, the time cost of all the resulting schemes has a linear relationship with the number of attributes contained in the encrypted access structure. Figure 2(b) shows the decryption time cost of schemes D-ABE, BC-SABE, and STW-ABE. As seen in Figure 2, the time cost of cloud decryption of D-ABE, BC-SABE, and STW-ABE has a linear relationship with the number of attributes, and the user decryption cost in STW-ABE is independent of the number of attributes. Since STW-ABE outsources most of the decryption work to cloud servers, the computing pressure on users is greatly reduced. This scheme is more suitable for using lightweight devices in the IoT environment.Figure3(a) shows the time cost of the generated ciphertext index. It can be seen from the figure that STW-ABE has better computing performance than scheme PAB-MKS and scheme BC-SABE. Figure 3(b) shows the simulation results of the time cost required for the generation of the Token. The time cost of the schemes is linearly related to the number of attributes, but it can be seen that the time cost of STW-ABE is much shorter than that of scheme BC-SABE. Figure 3(c) shows the time cost of the search process under simulation. In this scheme, the file index and the number of files are fixed as simulated constants. The results of the search process represent only the performance of the search process and do not include the time cost of searching the actual database. As seen in Figure 3(c), the time cost of the STW-ABE search process is similar to that of the search process in the PAB-MKS scheme and the BC-SABE scheme. Moreover, they are all linearly related to the number of attributes.Discussion. There are two concerns when designing searchable encryption access control schemes. (1) Security. In Section 4.1, the two-way access control scheme based on searchable encryption has been proven to be IND-CPA security and IND-CKA security, which is also achieved by most searchable encryption schemes. In this paper, we use the distributed feature of blockchain and change the central authorization model in traditional access control to a blockchain consensus node with DKG that generates the relevant secret key. Where DKG follows thet,nn≤tsharing principle,t is the total number of blockchain consensus nodes involved in key generation, andnis the minimum number of consensus nodes involved in key generation. The secret key sharing must be participated by more than n consensus nodes, thus improving the robustness of the scheme. At the same time, a blockchain is a distributed ledger that ensures data integrity, immutability, and traceability of the information stored in it such as global public keys and user keys. (2) Efficiency. In this paper, the simulation experiment simulated the efficiency of the scheme and compared it with other schemes. It can be found that this scheme has certain advantages in implementation efficiency. In the decryption process, considering that most IoT devices have limited resources and cannot perform efficient decryption calculations, this scheme uses cloud servers to assist users in decryption. A large amount of decryption computation is outsourced to CS, thus reducing the computational pressure on users. This scheme adopts a distributed key generation protocol, and multiple blockchain consensus nodes participate in generating users’ public and private key pairs, which will not affect the security and robustness of the scheme. Meanwhile, the secret keys generated by blockchain nodes do not need to respond to user requests in real time, so the time cost of secret key generation is not simulated in this paper. Among them, in the BC-SABE scheme, the cloud server is used to complete the generation of tokens with the user jointly, and the user does not need to perform the calculation related to the number of attributes. In the BC-SABE scheme, the token generation time by the blockchain consensus node is not given, so there is no comparison between them in Figure 3(b). Similarly, the generation of a token in STW-ABE is completed by the blockchain consensus node. The user does not need to calculate the consumption in the generation of tokens.


## 7. Conclusions

This paper proposes a distributed STW-ABE scheme using coalition blockchain and cloud servers to assist users with accurate and secure data search and sharing. Our solution not only enables two-way confirmation between users and data but also enables the fine-grained search of ciphertext and lightweight decryption for users. In addition, our scheme utilizes a coalition blockchain to replace the centralized key management server. The consensus nodes jointly generate key parameters through the DKG, improving the security of the IoT system. Then, the blockchain is responsible for generating public and private keys, user identity keys, and keyword tokens. Due to the limited resources of IoT devices and the massive pairing operations required for the search and decryption process, we delegate a large amount of computation to CS during the search and decryption process. The user only needs one exponential operation to complete the decryption process from ciphertext to plaintext. The present security and efficiency analysis shows that the scheme has good safety and practicality.Our ultimate aim is to design a secure and efficient data sharing system for the IIoT. The possible further research direction is to implement dynamic updating of access policies based on the current work.



---

*Source: 2410455-2022-09-29.xml*