*Article* **Practical Inner Product Encryption with Constant Private Key †**

#### **Yi-Fan Tseng, Zi-Yuan Liu \* and Raylin Tso**

Department of Computer Science, National Chengchi University, Taipei 11605, Taiwan;

yftseng@cs.nccu.edu.tw (Y.-F.T.); raylin@cs.nccu.edu.tw (R.T.)


Received: 7 November 2020; Accepted: 1 December 2020; Published: 3 December 2020

**Abstract:** Inner product encryption, first introduced by Katz et al., is a type of predicate encryption in which a ciphertext and a private key correspond to an attribute vector and a predicate vector, respectively. Only if the attribute and predicate vectors satisfy the inner product predicate will the decryption in this scheme be correct. In addition, the ability to use inner product encryption as an underlying building block to construct other useful cryptographic primitives has been demonstrated in the context of anonymous identity-based encryption and hidden vector encryption. However, the computing cost and communication cost of performing inner product encryption are very high at present. To resolve this problem, we introduce an efficient inner product encryption approach in this work. Specifically, the size of the private key is only one G element and one Z*<sup>p</sup>* element, and decryption requires only one pairing computation. The formal security proof and implementation result are also demonstrated. Compared with other state-of-the-art schemes, our scheme is the most efficient in terms of the number of pairing computations for decryption and the private key length.

**Keywords:** predicate encryption; inner product encryption; constant-size private key; efficient decryption; constant pairing computations

#### **1. Introduction**

Inner product encryption (IPE), first introduced by Katz et al. [1], is a type of predicate encryption [2] in which a ciphertext and a private key correspond to an attribute vector **x** and a predicate vector **y**, respectively. In particular, the decryption will be correct if and only if the attribute vector and the predicate vector satisfy the inner product predicate, meaning that the inner product operation of **x** and **y** equals zero (**x**, **y** = 0). Over the past decade, many IPE schemes have been proposed, such as those based on pairing [3–7] and lattice [8–11]. The security definition of an IPE scheme [1] can be naturally extended from the IND–CPA security of identity-based encryption [12–14]. More precisely, under the security approach of IPE, an adversary learns nothing about the encrypted message from a ciphertext associated with an attribute vector **x** if they do not own the private key associated with a predicate vector **y** such that **x**, **y** = 0. Such a definition is also called the IND–CPA security for IPE scheme in some papers [15] and is defined as the payload-hiding property in [1]. Alternatively, the security definition defined in [1], called the attribute-hiding property, states that a ciphertext reveals nothing about the corresponding ciphertext attribute **x**. However, we emphasize that the attribute-hiding property is not an absolutely necessary property for IPE. Many IPE schemes proposed in the literature achieve only IND–CPA security/payload hiding, such as that in [15–17].

In addition to their usefulness in fine-grained access control, IPE schemes can be used to construct various cryptographic primitives or can be converted to more complex primitives, such as identity-based encryption [12–14], hidden vector encryption [2,18] and subset predicate encryption [19,20]. We refer readers to the work presented in [1,19] for details.

Although many IPE schemes have been introduced, the computing cost and communication cost of these schemes are high. In particular, the pairing operation required by existing pairing-based IPE schemes is typically linearly related to the vector length; therefore, the computational efficiency of these schemes is low. Moreover, the size of the private key of most schemes is linearly related to vector lengths. However, although the existing lattice-based IPE schemes are considered quantum-resistant, the key size of almost all schemes is too large or the message space is too small. In addition, Internet of Things devices are gradually becoming common in daily life; however, the problems mentioned in the preceding discussion make the application of an IPE scheme impractical for these resource-constrained devices. Thus, an unresolved question remains: can we obtain an efficient IPE scheme by reducing the cost of decryption and optimizing the length of the private key?

#### *1.1. Our Contributions*

Herein, we resolve the aforementioned problem by introducing an effective IPE scheme. In particular, in the proposed scheme, the length of a private key is independent of the length of the predicate vector. In addition, the decryption only requires one pairing operation; thus, the decryption is also independent of the length of the predicate vector. Rigorous proofs are provided to demonstrate that, under a modified decisional Diffie–Hellman assumption, our proposed scheme is coselective IND–CPA secure. Moreover, our proposed scheme is more efficient than other advanced schemes, as listed in Tables 1 and 3.

#### *1.2. Related Works*

#### 1.2.1. Pairing-Based IPE Schemes

The first IPE scheme, introduced by Katz et al. [1], entails the evaluation of predicates over Z*<sup>N</sup>* using the inner product, where *N* is a composite number. After this pioneering work, many studies followed. For example, Okamoto and Takashima [3] proposed the first hierarchical predicate encryption method (or delegable predicate encryption) for inner product predicates; this provides a user with functionality to delegate more restrictive functionality to another user. Attrapadung and Libert [16] constructed an IPE scheme that solves the inefficiency problem of the previous scheme. More precisely, provided that the description of the ciphertext attribute vector is not included in the ciphertext, the ciphertext overhead of the scheme is reduced to *O*(1). By combining dual system encryption [21] and dual pairing vector spaces [3] carefully, Lewko et al. [22] obtained the first fully secure IPE scheme and hierarchical predicate encryption under the *n*-extended decisional Diffie–Hellman assumption. However, the security of all these previous studies was based on nonstandard assumptions. To resolve this issue, Park [23] developed the first IPE scheme under the standard assumptions (i.e., decisional bilinear Diffie–Hellman and decisional linear (DLIN) assumptions). Okamoto and Takashima [24] then introduced two nonzero inner product encryption schemes that support constant-size ciphertexts and a constant-size secret key, respectively, which are adaptively secure under the DLIN assumption in the standard model. The authors also proposed the first IPE scheme that is fully secure and fully attribute-hiding [25] as well as the first unbounded IPE scheme that is also fully secure and fully attribute-hiding in the standard model under the DLIN assumption [26]. Kawiai and Takashima [27] introduced a new notion, called IPE with ciphertext conversion, which considers the security of predicate-hiding. Zhenlin and Wei [28] then introduced another concept, called multiparty cloud computation IPE with multiplicative homomorphic property, which enables an IPE scheme to support multiparty cloud computation. Kim et al. [29] proposed a new efficient IPE scheme that only requires *n* exponentiation and three pairing computations for decryption. Huang et al. [30] proposed the first enabled–disabled IPE, which supports timed-release services and data self-destruction. Ramanna [15] constructed two IPE schemes using tag-based quasi-adaptive

noninteractive zero knowledge, where the first and second both have the property of constant-size ciphertext but only the second has the property of attribute-hiding. Zhang et al. [7] recently proposed a new IPE scheme based on a double encryption system; it has been demonstrated to achieve adaptive security under a weak attribute-hiding model.

As discussed subsequently, extensive research has focused on the developed and proposed schemes; however, the private key length of most schemes is linearly dependent on the vector length or requires many pairing operations, making these schemes impractical. Thus, determining how to construct a more practical scheme remains a critical area of research.

#### 1.2.2. Lattice-Based IPE Schemes

To fend off attack from quantum computers in the future, Agrawal et al. [8] proposed the first IPE scheme based on the lattice hard assumption (i.e., the learning with error assumption, which is believed to be able to withstand quantum attacks); to do so, they modified an identity-based encryption approach proposed by Agrawal et al. [31]. Xagawa [9], inspired by the work of Agrawal et al., proposed an improved lattice-based IPE scheme that reduced the size of public parameters and ciphertext. Li et al. [10] proposed a lattice-based IPE scheme that further reduced the size of public parameters and ciphertext. In contrast to [9], their work reduced the size by a factor of log *n*, where *n* is the security parameter. Wang et al. [11] recently proposed the first compact IPE scheme that employs an IPE scheme [9], fully homomorphic encryption [32] and vector-encoding schemes [33]. Although these constructions are thought to be able to withstand quantum computer attacks, they are based on the learning with errors assumption, resulting in key lengths that are still too large to be practical.

#### *1.3. Organization*

The remainder of this paper is organized as follows. In Section 2, we start by discussing some preliminaries on bilinear maps, complexity assumptions and the definition of IPE. In Section 3, we then propose our IPE scheme and demonstrate its correctness. In Section 4, we subsequently demonstrate security proofs using a modified decisional Diffie–Hellman problem, and then in Section 5, we compare our approach with other state-of-the-art schemes and reveal the implementation results. In Section 6, we finally conclude the paper.

#### **2. Preliminaries**

Herein, we present the necessary preliminaries, such as notations, complex assumptions, and the definition of an IPE scheme.

#### *2.1. Notations*

Throughout this paper, we use *x* \$ ←− *S* to denote "choose an element *x* randomly and uniformly from the set *S*" and *x* ← *A* to denote "*x* is the output of the algorithm *A*". Moreover, we use **a** to denote a vector and use **a***<sup>i</sup>* to denote the *i*-th entry of vector **a**. The inner product of these two vectors **<sup>x</sup>**, **<sup>y</sup>** is denoted as **x**, **<sup>y</sup>**. For a prime *<sup>p</sup>*, we use <sup>Z</sup>*<sup>p</sup>* to denote the set of integers modulo *<sup>p</sup>*. Finally, we use N and Z to denote the set of positive integers and integers, respectively.

#### *2.2. Bilinear Maps*

Let G and G*<sup>T</sup>* be an additive and a multiplicative cyclic group, respectively; here, the order of <sup>G</sup> and <sup>G</sup>*<sup>T</sup>* is a large prime *<sup>p</sup>* (i.e., <sup>|</sup>G<sup>|</sup> <sup>=</sup> <sup>|</sup>G*T*<sup>|</sup> <sup>=</sup> *<sup>p</sup>*). Then, let *<sup>P</sup>* be a generator of <sup>G</sup>. A bilinear map (pairing) *<sup>e</sup>* : <sup>G</sup> <sup>×</sup> <sup>G</sup> <sup>→</sup> <sup>G</sup>*<sup>T</sup>* is a mapping with the following properties:


In this work, we take advantage of the generalized decisional Diffie–Hellman exponent (GDDHE) problem, based on [34]. The GDDHE problem is a generic framework within which new complexity assumptions can be created. We first give an overview of the GDDHE problem. Let


*Q*, *QT* are two ordered sets with multivariate polynomials, and thus, we define *Q* = (*q*1, *q*2, ... , *qs*) and *R* = (*r*1,*r*2, ... ,*rs*). As stated in [34], we require *p*<sup>1</sup> = *q*<sup>1</sup> = 1 to be two constant polynomials. Consider a bilinear map *<sup>e</sup>* : <sup>G</sup> <sup>×</sup> <sup>G</sup> <sup>→</sup> <sup>G</sup>*<sup>T</sup>* with the generator *<sup>P</sup>* of <sup>G</sup> and *gT* <sup>=</sup> *<sup>e</sup>*(*P*, *<sup>P</sup>*) <sup>∈</sup> <sup>G</sup>*T*. For a vector (*x*1, *<sup>x</sup>*2,..., *xn*) <sup>∈</sup> <sup>F</sup>*<sup>n</sup> <sup>p</sup>*, we define

$$Q(\mathbf{x}\_1, \mathbf{x}\_2, \dots, \mathbf{x}\_n)P = (q\_1(\mathbf{x}\_1, \mathbf{x}\_2, \dots, \mathbf{x}\_n)P, \dots, q\_s(\mathbf{x}\_1, \mathbf{x}\_2, \dots, \mathbf{x}\_n)P) \in \mathbb{G}^s, \mathbb{G}$$

and

$$\mathbb{g}\_T^{R(x\_1, x\_2, \ldots, x\_n)} = (\mathbb{g}\_T^{r\_1(x\_1, x\_2, \ldots, x\_n)}, \ldots, \mathbb{g}\_T^{r\_s(x\_1, x\_2, \ldots, x\_n)}) \in \mathbb{G}\_T^s.$$

By " *<sup>f</sup>* depends on (*Q*, *<sup>R</sup>*)" we mean that there are *<sup>s</sup>*<sup>2</sup> <sup>+</sup> *<sup>s</sup>* constants {*ai*,*j*}*<sup>s</sup> <sup>i</sup>*,*j*=<sup>1</sup> and {*bk*}*<sup>s</sup> <sup>k</sup>*=<sup>1</sup> such that

$$f = \sum\_{i,j=1}^{s} a\_{i,j} q\_i q\_j + \sum\_{k=1}^{s} b\_k r\_k.$$

We say that *f* is independent of (*Q*, *R*) if *f* does not depend on (*Q*, *R*).

**Definition 1** (The (*Q*, *R*, *f*)-GDDHE Problem)**.** *Given* (*Q*(*x*1, ... , *xn*)*P*, *g R*(*x*1,...,*xn*) *<sup>T</sup>* , *<sup>Z</sup>*) <sup>∈</sup> <sup>G</sup>*<sup>s</sup>* <sup>×</sup> <sup>G</sup>*<sup>s</sup> <sup>T</sup>* <sup>×</sup> <sup>G</sup>*T, decide if Z* ? = *<sup>g</sup>f*(*x*1,...,*xn*) *<sup>T</sup> .*

Then, for an algorithm A, the advantage of A in solving the (*Q*, *R*, *f*)-GDDHE problem is defined as

$$\operatorname{Adv}\_{\mathsf{F}}(\operatorname{QR},\mathsf{f})\operatorname{\mathcal{Q}D\mathsf{H}\mathsf{H}}(\mathcal{A}) = \left| \mathcal{A}\left(\operatorname{Q}(\mathbf{x}\_{1},\ldots,\mathbf{x}\_{n})\operatorname{P}, \operatorname{\mathcal{S}}\_{\mathsf{T}}^{\operatorname{R}(\mathbf{x}\_{1},\ldots,\mathbf{x}\_{n})}, \operatorname{\mathcal{S}}\_{\mathsf{T}}^{\operatorname{(\{\mathbf{x}\_{1},\ldots,\mathbf{x}\_{n}\}}}\right) - \operatorname{\mathcal{A}}\left(\operatorname{Q}(\mathbf{x}\_{1},\ldots,\mathbf{x}\_{n})\operatorname{P}, \operatorname{\mathcal{S}}\_{\mathsf{T}}^{\operatorname{(\{\mathbf{x}\_{1},\ldots,\mathbf{x}\_{n}\}}},\operatorname{Z}\xleftarrow{\operatorname{\mathcal{G}}}\operatorname{\mathcal{G}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{R}}\operatorname{\mathcal{$$

Boneh et al. propose that the (*Q*, *R*, *f*)-GDDHE problem is difficult if *f* is independent of (*Q*, *R*) and demonstrate that a large class of hard problems can be fit into the framework of the GDDHE problem; for instance, the DDH problem over G*T*.

**Definition 2** (The decisional Diffie–Hellman problem over <sup>G</sup>*<sup>T</sup>* (DDHG*<sup>T</sup>* problem))**.** *Let gT* <sup>=</sup> *<sup>e</sup>*(*P*, *<sup>P</sup>*) *be a generator of* G*T. Given* (*P*, *gT*, *A* = *g<sup>a</sup> <sup>T</sup>*, *<sup>B</sup>* = *<sup>g</sup><sup>b</sup> <sup>T</sup>*, *<sup>C</sup>*) <sup>∈</sup> <sup>G</sup> <sup>×</sup> <sup>G</sup><sup>4</sup> *<sup>T</sup>, where <sup>a</sup>*, *<sup>b</sup>* \$ ←− <sup>Z</sup>*p, decide whether <sup>C</sup>* <sup>=</sup> *<sup>g</sup>ab T or an random element from* G*T.*

By setting *Q* = (1), *R* = (1, *a*, *b*), *f* = *ab*, the DDH problem over G*<sup>T</sup>* is equivalent to the (*Q*, *R*, *f*)-GDDHE problem. Observe that no constants exist such that the linear combination of 1, *a*, *b* equals *ab*; therefore, *f* is independent of (*Q*, *R*). Given the result of Boneh et al., we conclude that no algorithm is available with which to solve the DDHG*<sup>T</sup>* problem with a nonnegligible advantage. See [34] for additional details.

Next, we present a modified version of the DDHG*<sup>T</sup>* problem, which will be used in the security proof.

**Definition 3** (The modified decisional Diffie–Hellman problem over <sup>G</sup>*<sup>T</sup>* (M-DDHG*<sup>T</sup>* problem))**.** *Let gT* = *e*(*P*, *P*) *be a generator of* G*T. Given* (*P*, *A* = *aP*, *gT*, *A* = *g<sup>a</sup> <sup>T</sup>*, *<sup>B</sup>* = *<sup>g</sup><sup>b</sup> <sup>T</sup>*, *<sup>C</sup>*) <sup>∈</sup> <sup>G</sup><sup>2</sup> <sup>×</sup> <sup>G</sup><sup>4</sup> *T, where a*, *b* \$ ←− <sup>Z</sup>*p, decide whether C* <sup>=</sup> *<sup>g</sup>ab <sup>T</sup> or a random element from* <sup>G</sup>*T.*

**Theorem 1** (The modified decisional Diffie–Hellman assumption over <sup>G</sup>*<sup>T</sup>* (M-DDHG*<sup>T</sup>* assumption))**.** *We say that the M-DDH*G*<sup>T</sup> assumption holds if there is no algorithm* D *for solving the M-DDH*G*<sup>T</sup> problem with a nonnegligible advantage.*

**Proof.** Compared with the DDHG*<sup>T</sup>* problem, the instance of the M-DDHG*<sup>T</sup>* problem contains an additional element *A* = *aP*. The M-DDHG*<sup>T</sup>* problem is equivalent to the (*Q*, *R*, *f*)-GDDHE problem with

$$Q = (1, a), \mathbb{R} = (1, a, b), f = ab.$$

No constants exist such that the linear combination of the monomials (1 · *a*), 1, *a*, *b* equals the polynomial *ab*. Therefore, considering the the results of Boneh et al., we conclude that the M-DDHG*<sup>T</sup>* problem is hard. Moreover, we define the advantage for an algorithm D in solving the M-DDHG*<sup>T</sup>* problem as

$$\text{Adv}^{\text{M-DDH}\_{\mathbb{G}\_{\text{T}}}}(\mathcal{D}) = \left| \Pr[\mathcal{D}(P, A', \mathcal{g}\_{\text{T}}, A, B, \mathbb{C} = \mathcal{g}\_{\text{T}}^{ab}) = 1] - \Pr[\mathcal{D}(P, A', \mathcal{g}\_{\text{T}}, A, B, \mathbb{C} \stackrel{\text{g}}{\leftarrow} \mathbb{G}\_{\text{T}}) = 1] \right|.$$

$$\mathbf{0}$$

#### *2.3. Definition of Inner Product Encryption*

An IPE scheme consists of four algorithms: **Setup**, **KeyGen**, **Encrypt** and **Decrypt**. The details of the algorithms are as follows:


The correctness is defined as follows. For all *λ*, - <sup>∈</sup> <sup>N</sup>, let <sup>C</sup>**<sup>x</sup>** <sup>←</sup> **Encrypt**(params, **<sup>x</sup>** <sup>∈</sup> <sup>A</sup>, *<sup>M</sup>*) and let K**<sup>y</sup>** ← **KeyGen**(params, msk, **y** ∈ P); thus, we have

> *M* ← **Decrypt**(params, C**x**, K**y**) if **x**, **y** = 0; ⊥ ← **Decrypt**(params, C**x**, K**y**) if **x**, **y** = 0,

where (params, msk) <sup>←</sup> **Setup**(1*λ*, 1-).

#### *2.4. Security Model*

Here, we first introduce IND–CPA security for IPE. The IND–CPA game of IPE for the attribute vector space A and predicate vector space P is defined as an interactive game between a challenger C and an adversary A.

• **Setup**. The challenger <sup>C</sup> runs **Setup**(1*λ*, 1-) and sends the system parameter params to the adversary A.


The advantage of an adversary for winning the IND–CPA game is defined as

$$Adv^{\mathbb{I}\mathbb{N}\mathbb{D}\cdot\mathbb{C}\mathbb{P}\mathbb{A}}(\mathcal{A}) = \left| \Pr[\beta'=\beta] - \frac{1}{2} \right| \dots$$

**Definition 4** (IND–CPA Security for IPE)**.** *We say that an IPE is IND–CPA secure if there is no probabilistic polynomial-time adversary* A *who wins the IND–CPA game with a nonnegligible advantage.*

As we mentioned in Section 1, in some literature [1,23], the security notions for an IPE are defined with the notions "payload hiding" and "attribute hiding". Informally, payload-hiding (or attribute-hiding) is defined to argue that a ciphertext leaks no information about the encrypted message (or attribute vector). The IND–CPA security shown in this section is equivalent to payload-hiding. We emphasize that attribute-hiding is unnecessary for an IPE scheme; in [15–17], schemes have been proposed satisfying only payload hiding.

We next present the selective security and the coselective security [16,35] for IPE. The selective IND-CPA (sIND-CPA) game is defined the same as the IND-CPA game, except that the adversary A is forced to commit before the **Setup** phase to an attribute vector **x**∗, and A is not allowed to make private key queries with **y** such that **x**∗, **y** = 0 in both **Query Phase 1** and **Query Phase 2**.

**Definition 5** (sIND-CPA Security for IPE)**.** *An IPE scheme is said to be sIND–CPA secure if no probabilistic polynomial-time adversary wins the sIND–CPA game with a nonnegligible advantage.*

The coselective IND–CPA (csIND–CPA) game is defined as equal to the IND–CPA game, except that the adversary A is forced to commit before the **Setup** phase *q* to predicate vectors **<sup>y</sup>**(1), ... , **<sup>y</sup>**(*q*) for the private key queries, where *<sup>q</sup>* is a polynomial in the security parameter *<sup>λ</sup>* and <sup>A</sup> is required to invoke the **Challenge** phase with an attribute vector **<sup>x</sup>**<sup>∗</sup> such that **x**∗, **<sup>y</sup>**(*j*) <sup>=</sup> 0 for *j* = 1, . . . , *q*.

**Definition 6** (csIND–CPA Security for IPE)**.** *An IPE scheme is said to be csIND–CPA secure if no probabilistic polynomial-time adversary wins the csIND–CPA game with a nonnegligible advantage.*

Coselective security can be understood as a complementary notion to selective security. In the selective security game, the adversary can learn the private key in accordance with its previous choices, whereas in the coselective security game, the adversary can choose its target after seeing the public parameter and learning the private keys of its choice. Although selective security and coselective security are weaker than full security, both notions are, by definition, incomparable in general by definition.

#### **3. Proposed Inner Product Encryption Scheme**

Our IPE scheme consists of four algorithms: **Setup**, **KeyGen**, **Encrypt** and **Decrypt**. The details of the proposed scheme are explained in the following.

	- 1. Choose bilinear groups G, G*<sup>T</sup>* of prime order *p* > <sup>2</sup>*λ*. Let *P* and *gT* = *e*(*P*, *P*) be the generator of G and G*T*, respectively.
	- 2. Set the predicate vector space and the attribute vector space to Z- *p*.
	- 3. Choose **s** = (*s*1,*s*2,...,*s*-) \$ ←− <sup>Z</sup>- *p*.
	- 4. Compute **<sup>h</sup>**\$ = (*gsi T* )- *<sup>i</sup>*=<sup>1</sup> = (\$*h*1,..., \$*h*-).
	- 5. Output the system parameter params = (*P*, *gT*, **h**\$), and the master secret key msk = **s**.
	- 1. Choose *r*, *δ* \$ ←− <sup>Z</sup>*p*.
	- 2. Compute <sup>C</sup><sup>0</sup> <sup>=</sup> *rP*, and \$C<sup>0</sup> <sup>=</sup> *<sup>g</sup><sup>r</sup> T*.
	- 3. Compute <sup>C</sup>*<sup>i</sup>* = \$*h<sup>r</sup> <sup>i</sup>* · *<sup>g</sup>δxi <sup>T</sup>* · *M* for *i* = 1 to -.
	- 4. Output the ciphertext <sup>C</sup>**<sup>x</sup>** = (C0, \$C0, <sup>C</sup>1, <sup>C</sup>2,..., <sup>C</sup>-).
	- 1. Choose *k* \$ ←− <sup>Z</sup>*p*.
	- 2. Compute K<sup>0</sup> = *kP*, and K<sup>1</sup> = **s**, **y** + *k* mod *p*.
	- 3. Output the private key K**<sup>y</sup>** = (K0, K1).
	- 1. Compute D<sup>0</sup> = *e*(K0, C0).
	- 2. Compute D<sup>1</sup> = ∏- *<sup>i</sup>*=<sup>1</sup> C *yi i* .
	- 3. Compute <sup>D</sup> <sup>=</sup> <sup>D</sup><sup>0</sup> · <sup>D</sup><sup>1</sup> \$CK1 0 .
	- 4. Compute *d* = (∑- *<sup>i</sup>*=<sup>1</sup> *yi*)−<sup>1</sup> mod *p*.
	- 5. Compute *M* = D*d*.

#### *Correctness*

The correctness of the proposed scheme is shown as follows.


*<sup>i</sup>*=<sup>1</sup> *yi* .


#### **4. Security Analysis of the Proposed Scheme**

We now provide the security proof for the coselective security of the proposed IPE scheme. In the subsequent proof, we view a vector as a row vector.

**Theorem 2.** *The proposed scheme is csIND–CPA secure for q private key queries, where q is a polynomial in the security parameter λ, under the M-DDH*G*<sup>T</sup> assumption.*

**Proof.** Given (*P*, *A* = *aP*, *gT*, *A* = *g<sup>a</sup> <sup>T</sup>*, *<sup>B</sup>* = *<sup>g</sup><sup>b</sup> <sup>T</sup>*, *C*), we build an algorithm C using the adversary A to solve the M-DDHG*<sup>T</sup>* problem as follows.


$$\begin{bmatrix} \mathbf{y}\_1 \\ \mathbf{y}\_2 \\ \vdots \\ \mathbf{y}\_q \end{bmatrix} \mathbf{u}^\top = \mathbf{0}\_{\ell}^\top \mathbf{y}$$

where **0**- = (0, 0, . . . , 0) % &' ( -. Such **u** exists when *q* > -. The operation is to find a vector **u** such

that **u**, **y***j* = 0 for *j* = 1 to *q*. C then chooses **v** = (*v*1, *v*2, ... , *v*-) \$ ←− <sup>Z</sup>- *<sup>p</sup>*. Next, C computes **<sup>h</sup>**\$ = (*Bui* · *<sup>g</sup>vi T* )- *<sup>i</sup>*=<sup>1</sup> = (\$*h*1, ... , \$*h*-). Finally, C sets params = (*P*, *gT*, **h**\$) and sends params to A. Note that <sup>C</sup> implicitly sets msk <sup>=</sup> **<sup>s</sup>** = (*si* <sup>=</sup> *ui* · *<sup>b</sup>* <sup>+</sup> *vi*)- *<sup>i</sup>*=1.

• **Query Phase 1**. After receiving **y**(*i*) = (*y* (*i*) <sup>1</sup> , ... , *y* (*i*) - ) from A, where *i* ∈ [1, 2, ... , *q*], C first chooses *k* \$ ←− <sup>Z</sup>*<sup>p</sup>* and then computes <sup>K</sup>**y**(*i*) = (K0, <sup>K</sup>1)=(*kP*,**v**, **<sup>y</sup>**(*i*) <sup>+</sup> *<sup>k</sup>* mod *<sup>p</sup>*). The correctness of the private key K**y**(*i*) is demonstrated as follows.

$$\begin{array}{ll} & \mathbf{^K\_1} \\ & = & \langle \mathbf{s}, \mathbf{y}^{(i)} \rangle + k \mod p \\ & = & \sum\_{j=1}^{\ell} s\_j y\_j^{(i)} + k \mod p \\ & = & \sum\_{j=1}^{\ell} (u\_j \cdot b + v\_j) \cdot y\_j^{(i)} + k \mod p \\ & = & b \sum\_{j=1}^{\ell} u\_j y\_j^{(i)} + \sum\_{j=1}^{\ell} v\_j y\_j^{(i)} + k \mod p \\ & = & b \langle \mathbf{u}, \mathbf{y}^{(i)} \rangle + \langle \mathbf{v}, \mathbf{y}^{(i)} \rangle + k \mod p \\ & = & \langle \mathbf{v}, \mathbf{y}^{(i)} \rangle + k \mod p. \end{array}$$

	- 1. Choose *β* ∈ {0, 1}.
	- 2. Choose *δ* \$ ←− <sup>Z</sup>*p*.
	- 3. Set C <sup>0</sup> = *A* and \$C <sup>0</sup> = *A*.
	- 4. For *i* = 1 to -, compute C *<sup>i</sup>* = (*Cui* · *<sup>A</sup>vi* · *<sup>g</sup> δx*∗ *i <sup>T</sup>* ) · *Mβ*.
	- 5. Set the challenge ciphertext C∗ = (C <sup>0</sup>, \$C <sup>0</sup>, C <sup>1</sup>, C <sup>2</sup>,..., C -).
	- 6. Return C<sup>∗</sup> to A.

Here, we implicitly set the randomness of the encryption procedure to *a*. Therefore, if *C* = *gab T* , then we have C <sup>0</sup> = *aP*, \$<sup>C</sup> <sup>0</sup> = *<sup>g</sup><sup>a</sup> <sup>T</sup>* for *i* = 1, . . . , -,

$$\begin{array}{lcl} \mathbf{C}\_{i}^{\prime} &= \left(\mathbf{C}^{u\_{i}} \cdot \mathbf{A}^{v\_{i}} \cdot \mathbf{g}\_{T}^{\delta \mathbf{x}\_{i}^{\star}}\right) \cdot \mathbf{M}\_{\beta} \\ &= \left(\mathbf{g}\_{T}^{abu\_{i}} \cdot \mathbf{g}\_{T}^{av\_{i}} \cdot \mathbf{g}\_{T}^{\delta \mathbf{x}\_{i}^{\star}}\right) \cdot \mathbf{M}\_{\beta} \\ &= \left(\mathbf{g}\_{T}^{a(bu\_{i} + v\_{i})}\right) \cdot \left(\mathbf{g}\_{T}^{\delta \mathbf{x}\_{i}^{\star}}\right) \cdot \mathbf{M}\_{\beta} \\ &= h\_{i}^{a} \cdot \mathbf{g}\_{T}^{\delta \mathbf{x}\_{i}^{\star}} \cdot \mathbf{M}\_{\beta} .\end{array}$$

Thus, the challenge ciphertext C∗ is a valid ciphertext.


Assume that the adversary A wins the game with advantage :

$$\left| \Pr[\beta' = \beta] - \frac{1}{2} \right| \ge \epsilon.$$

If *C* = *gab <sup>T</sup>* , then the view of the adversary is identical as that in real world. Thus, we have

$$\begin{array}{ll} & \Pr\left[\mathcal{C}\left(P, A', \mathbb{g}\_{T'} \, A, B, \mathcal{C} = \mathbb{g}\_{T}^{ab}\right) = 1\right] \\ = & \Pr\left[\mathcal{S}' = \mathcal{S}\right] \\ \geq & \frac{1}{2} + \epsilon. \end{array}$$

However, if *C* is a random element in G*T*, then the choice of *β* is independent from the adversary's view and we have

$$\begin{array}{ll} & \Pr[\mathcal{C}(P, A', \mathbb{S}\_T, A, B, \mathbb{C} \xleftarrow{\\$} \mathbb{G}\_T) = 1] \\ = & \Pr[\beta' = \beta] \\ = & \frac{1}{2} . \end{array}$$

Therefore, the advantage of C in solving the M-DDHG*<sup>T</sup>* problem is

$$\begin{array}{l|l} & \left| \Pr[\mathcal{C}(P, A', \mathbb{G}\_T, A, B, \mathbb{C} = \mathbb{g}\_T^{ab}) = 1] \right| \\ & - \left| \Pr[\mathcal{C}(P, A', \mathbb{g}\_{T'}, A, B, \mathbb{C} \stackrel{\mathbb{S}}{\leftarrow} \mathbb{G}\_T) = 1] \right| \\ & \geq \left| (\frac{1}{2} + \epsilon) - \frac{1}{2} \right| \\ & \geq -\epsilon. \end{array}$$

This means that if there is an adversary winning the game with nonadvantage , then there is an algorithm C solving the M-DDHG*<sup>T</sup>* problem with a probability greater than .

#### **5. Efficiency Analysis and Implementation Results**

Herein, we compare the efficiency of the proposed IPE scheme with the schemes proposed in [1,3,5–7,15,16,22–30,36] (Because [4,17] are the complete versions of [16,24], we only compare our work with [16,24]). As shown in Table 1, we compare our scheme to others in two aspects: the size of the private key and the number of pairing operations for decryption. The type of group order is also presented because the efficiency of prime order groups is higher than that of composite order bilinear groups.

As is evident in Table 1, our proposed scheme has the shortest private key length and smallest number of pairings. Moreover, both the private key length and the number of pairings in our proposed scheme are independent of the length of the predicate and attribute vectors. The most efficient existing scheme is [29], where the private key length is three group elements and three pairings are needed for decryption. In our scheme, the private key is only an element of G and an element of Z*p*, and only one pairing is necessary during decryption. Furthermore, in [5], the private key length (2*m*|G|) and the number of pairings (2*m*) are independent of the lengths of the vectors, where *m* is the leakage-resilience parameter. However, *m* must be at least equal to or greater than 2. Therefore, the private key length and pairing number are still larger than those obtained with our approach (this is because their scheme degenerates to a conventional IPE scheme without leakage resilience when *m* = 1).

**Table 1.** Comparison of our scheme's efficiency with that of other schemes. The vector length for an IPE scheme is denoted by -; the bit lengths of the representations for an element in Z*<sup>p</sup>* and G are denoted by <sup>|</sup>Z*p*<sup>|</sup> and <sup>|</sup>G|, respectively; the leakage resilience parameter is denoted by *<sup>m</sup>*.


We also implemented our scheme and the schemes of [15,17,29] to compare efficiency. We chose these three schemes for the following reasons:


The environment of the implementation is presented in Table 2, and the implementation results are shown in Table 3. We implemented these schemes by using the Charm-Crypto library [37] and Python language. For schemes constructed over symmetric paring groups (the approach in [16] and our method), we selected the pairing group SS512 in [38] (also known as type A groups), and for the schemes constructed over asymmetric pairing groups (in [15,29]), we chose the pairing group BN254 in [39] (also known as type F groups). The SS512 group is a supersingular elliptic curve group where the size of the base field order is 512 bits and the embedding degree is two. For a bilinear map *<sup>e</sup>* : <sup>G</sup> <sup>×</sup> <sup>G</sup> <sup>→</sup> <sup>G</sup>*<sup>T</sup>* over the SS512 group, the bit lengths of elements in <sup>G</sup> and <sup>G</sup>*<sup>T</sup>* are 64 and 128 bytes, respectively. In the case of the BN254 group, the size of the base field order is 256 bits and the embedding degree is 12. For a bilinear map *<sup>e</sup>* : <sup>G</sup><sup>1</sup> <sup>×</sup> <sup>G</sup><sup>2</sup> <sup>→</sup> <sup>G</sup>*<sup>T</sup>* over the BN254 group, the bit lengths of elements in G1, G2, and G*<sup>T</sup>* are 64, 128, and 384 bytes, respectively. For the length of predicate and attribute vectors, we chose - = 100. As evident in Table 3, the encryption and decryption algorithms of our scheme were highly efficient. For decryption and encryption, only 10 and 20 ms was required, respectively. Our encryption algorithm was 5, 8.5, and 13 times faster than that in [15,16,29], respectively, and our decryption algorithm was 10, 14, and 14 times faster than that in [15,16,29], respectively. Moreover, our private key length was 86, 2.6, and 4.3 times shorter than that in [15,16,29], respectively. However, as a trade-off, the length of the ciphertext in our scheme was the largest among these schemes.


**Table 2.** Environment of the implementation.


#### **Table 3.** Implementation results.

#### **6. Conclusions**

In this work, an efficient IPE scheme in which the size of the private keys and the number of pairings for decryption are constant is introduced; moreover, this scheme is coselective IND–CPA secure under the modified decisional Diffie–Hellman assumption. Comparison and experimental results are also provided to illustrate that the size and computing cost of this scheme are small. In future works, we aim to improve the efficiency by reducing the ciphertext length and provide a security proof for stronger security concerns under standard assumptions. Because the proposed scheme is based on bilinear pairing, it cannot resist quantum attacks, unlike lattice-based IPE schemes. In future work, we will explore how to construct an efficient and practical quantum-resistant IPE scheme.

**Author Contributions:** Conceptualization, Y.-F.T. and Z.-Y.L.; Methodology, Y.-F.T. and Z.-Y.L.; Investigation, Z.-Y.L.; Writing—Original Draft Preparation, Z.-Y.L.; Writing—Review and Editing, Y.-F.T. and R.T.; Supervision, R.T.; Project Administration, R.T.; Funding Acquisition, Y.-F.T. and R.T. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was supported by the Ministry of Science and Technology, Taiwan (ROC), under Project Numbers MOST 108-2218-E-004-001-, MOST 108-2218-E-004-002-MY2, MOST 109-2218-E-011-007-, and by Taiwan Information Security Center at National Sun Yat-sen University (TWISC@NSYSU).

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
