on the feasibility of attribute-based encryption on smartphone … · 2015. 4. 3. · core 2 duo...

6
On the Feasibility of Attribute-Based Encryption on Smartphone Devices Moreno Ambrosin University of Padua, Italy [email protected] Mauro Conti * University of Padua, Italy [email protected] Tooska Dargahi West Tehran Branch, Islamic Azad University, Iran [email protected] ABSTRACT Attribute-Based Encryption (ABE) is a powerful crypto- graphic tool that allows fine-grained access control over data. Due to its features, ABE has been adopted in several appli- cations, such as encrypted storage or access control systems. Recently, researchers argued about the non acceptable per- formance of ABE when implemented on mobile devices. In- deed, the non feasibility of ABE on mobile devices would hinder the deployment of novel protocols and services–that could instead exploit the full potential of such devices. How- ever, we believe the conclusion of non usability was driven by a not-very efficient implementation. In this paper, we want to shine a light on this concern by studying the feasibility of applying ABE on smartphone de- vices. In particular, we implemented AndrABEn, an ABE library for Android operating system. Our library is written in the C language and implements two main ABE schemes: Ciphertext-Policy Attribute-Based Encryption, and Key- Pol- icy Attribute-Based Encryption. We also run a thorough set of experimental evaluation for AndrABEn, and compare it with the current state-of-the-art (considering the same experimental setting). The results confirm the possibility to effectively use ABE on smartphone devices, requiring an acceptable amount of resources in terms of computations and energy consumption. Since the current state-of-the-art claims the non feasibility of ABE on mobile devices, we be- lieve that our study (together with the AndrABEn library that we made available online) is a key result that will pave the way for researchers and developers to design and imple- ment novel protocols and applications for mobile devices. * Mauro Conti is supported by a European Marie Curie Fellow- ship (N. PCIG11-GA-2012-321980). This work is also partially supported by the Italian MIUR PRIN Project TENACE (N. 20103P34XC), and the University of Padua PRAT 2014 Project on Mobile Malware. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full cita- tion on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or re- publish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. IoT-Sys 2015, May 18, 2015, Florence, Italy. Copyright c 2015 ACM 978-1-4503-3502-7/15/05 ...$15.00. http://dx.doi.org/10.1145/2753476.2753482. 1. INTRODUCTION Attribute-Based Encryption (ABE) is a public key en- cryption scheme first introduced in 2005 by Sahai and Wa- ters [17]. In this scheme, both encryption and decryption are based on attributes (e.g., age, gender, or job position), that can be either related to the private keys of the users, or to the ciphertext. A user can restrict access to a spe- cific piece of data by defining an access policy. As an ex- ample, an access policy can be expressed as a boolean ex- pression such as (A B) C, where A, B and C are at- tributes and the possible values for attributes are implic- itly true or false. Researchers proposed two main types of ABE schemes, namely Key-Policy Attribute-Based Encryp- tion (KP-ABE) [11] and Ciphertext-Policy Attribute-Based Encryption (CP-ABE) [7]. Compared to the other encryption approaches, ABE presents several advantages [14]. First, it allows the data owner to apply a fine grained access control over data, based on attributes and policies. Second, ABE schemes are scal- able and independent of the number of authorized users. Moreover, ABE by construction is resilient against collu- sion attacks. Finally, while traditional public key infras- tructures impose a noticeable communication and storage overhead due to the exchange of cryptographical material, using ABE the data owner can encrypt data by using a set of attributes, without exchanging any certificates or identi- fying the client [14]. Several factors influence the performance of ABE in real applications, such as the number of attributes used for defin- ing an access policy, the desired security level, and the capa- bilities of the underlying device, in terms of available mem- ory and CPU speed. Some researchers have already studied the feasibility of using ABE on mobile devices [21]; how- ever, most of the existing studies do not consider all the factors, or actually do not implement ABE on smartphone. In [21], Wang et al. evaluated the performance of CP-ABE and KP-ABE on laptop and smartphone devices. They im- plemented both schemes by Java language, and evaluated different metrics. The authors concluded that the ABE per- formance is unacceptable on Android smartphone. However, the usefulness of ABE in mobile applications is evident, and its non feasibility on such devices would be a big obstacle to deployment of new services and to benefit from its ad- vantages. Therefore, obtaining acceptable performance is the biggest challenge for guaranteeing the use of ABE on resource constraint devices. arXiv:1504.00619v1 [cs.CR] 2 Apr 2015

Upload: others

Post on 25-Sep-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: On the Feasibility of Attribute-Based Encryption on Smartphone … · 2015. 4. 3. · Core 2 Duo CPUs. Based on our experimental results, the CP-ABE encryption and decryption time

On the Feasibility of Attribute-Based Encryptionon Smartphone Devices

Moreno AmbrosinUniversity of Padua, Italy

[email protected]

Mauro Conti ∗

University of Padua, [email protected]

Tooska DargahiWest Tehran Branch,

Islamic Azad University, [email protected]

ABSTRACTAttribute-Based Encryption (ABE) is a powerful crypto-graphic tool that allows fine-grained access control over data.Due to its features, ABE has been adopted in several appli-cations, such as encrypted storage or access control systems.Recently, researchers argued about the non acceptable per-formance of ABE when implemented on mobile devices. In-deed, the non feasibility of ABE on mobile devices wouldhinder the deployment of novel protocols and services–thatcould instead exploit the full potential of such devices. How-ever, we believe the conclusion of non usability was drivenby a not-very efficient implementation.

In this paper, we want to shine a light on this concern bystudying the feasibility of applying ABE on smartphone de-vices. In particular, we implemented AndrABEn, an ABElibrary for Android operating system. Our library is writtenin the C language and implements two main ABE schemes:Ciphertext-Policy Attribute-Based Encryption, and Key- Pol-icy Attribute-Based Encryption. We also run a thorough setof experimental evaluation for AndrABEn, and compareit with the current state-of-the-art (considering the sameexperimental setting). The results confirm the possibilityto effectively use ABE on smartphone devices, requiring anacceptable amount of resources in terms of computationsand energy consumption. Since the current state-of-the-artclaims the non feasibility of ABE on mobile devices, we be-lieve that our study (together with the AndrABEn librarythat we made available online) is a key result that will pavethe way for researchers and developers to design and imple-ment novel protocols and applications for mobile devices.

∗Mauro Conti is supported by a European Marie Curie Fellow-ship (N. PCIG11-GA-2012-321980). This work is also partiallysupported by the Italian MIUR PRIN Project TENACE (N.20103P34XC), and the University of Padua PRAT 2014 Projecton Mobile Malware.

Permission to make digital or hard copies of all or part of this work for personal orclassroom use is granted without fee provided that copies are not made or distributedfor profit or commercial advantage and that copies bear this notice and the full cita-tion on the first page. Copyrights for components of this work owned by others thanACM must be honored. Abstracting with credit is permitted. To copy otherwise, or re-publish, to post on servers or to redistribute to lists, requires prior specific permissionand/or a fee. Request permissions from [email protected] 2015, May 18, 2015, Florence, Italy.Copyright c© 2015 ACM 978-1-4503-3502-7/15/05 ...$15.00.http://dx.doi.org/10.1145/2753476.2753482.

1. INTRODUCTIONAttribute-Based Encryption (ABE) is a public key en-

cryption scheme first introduced in 2005 by Sahai and Wa-ters [17]. In this scheme, both encryption and decryptionare based on attributes (e.g., age, gender, or job position),that can be either related to the private keys of the users,or to the ciphertext. A user can restrict access to a spe-cific piece of data by defining an access policy. As an ex-ample, an access policy can be expressed as a boolean ex-pression such as (A ∧ B) ∨ C, where A, B and C are at-tributes and the possible values for attributes are implic-itly true or false. Researchers proposed two main types ofABE schemes, namely Key-Policy Attribute-Based Encryp-tion (KP-ABE) [11] and Ciphertext-Policy Attribute-BasedEncryption (CP-ABE) [7].

Compared to the other encryption approaches, ABEpresents several advantages [14]. First, it allows the dataowner to apply a fine grained access control over data, basedon attributes and policies. Second, ABE schemes are scal-able and independent of the number of authorized users.Moreover, ABE by construction is resilient against collu-sion attacks. Finally, while traditional public key infras-tructures impose a noticeable communication and storageoverhead due to the exchange of cryptographical material,using ABE the data owner can encrypt data by using a setof attributes, without exchanging any certificates or identi-fying the client [14].

Several factors influence the performance of ABE in realapplications, such as the number of attributes used for defin-ing an access policy, the desired security level, and the capa-bilities of the underlying device, in terms of available mem-ory and CPU speed. Some researchers have already studiedthe feasibility of using ABE on mobile devices [21]; how-ever, most of the existing studies do not consider all thefactors, or actually do not implement ABE on smartphone.In [21], Wang et al. evaluated the performance of CP-ABEand KP-ABE on laptop and smartphone devices. They im-plemented both schemes by Java language, and evaluateddifferent metrics. The authors concluded that the ABE per-formance is unacceptable on Android smartphone. However,the usefulness of ABE in mobile applications is evident, andits non feasibility on such devices would be a big obstacleto deployment of new services and to benefit from its ad-vantages. Therefore, obtaining acceptable performance isthe biggest challenge for guaranteeing the use of ABE onresource constraint devices.

arX

iv:1

504.

0061

9v1

[cs

.CR

] 2

Apr

201

5

Page 2: On the Feasibility of Attribute-Based Encryption on Smartphone … · 2015. 4. 3. · Core 2 Duo CPUs. Based on our experimental results, the CP-ABE encryption and decryption time

Contribution.The contribution of this paper is a comprehensive and

careful study of the feasibility of ABE operations on An-droid smartphone devices. In particular, differently fromwhat claimed in [21], we show that it is possible to achievereasonable performance for the main ABE operations, evenon smartphone devices. We provide AndrABEn, an imple-mentation of CP-ABE [7] and KP-ABE [11] as a C libraryfor Android smartphones. We integrated such library intoAndroid using the Android Native Development Kit (NDK)tool. We evaluated our implementation, and compared itsperformance with the Java-based study and implementa-tion proposed by Wang et al. in their work presented atICC 2014 [21], considering the same experimental settings1.The results of our thorough evaluation show that the perfor-mance of our solution is an order of magnitude higher thanthe one in [21]. Accordingly, our results prove that apply-ing ABE is indeed feasible on current mobile devices, suchas Samsung Galaxy Nexus smartphone—on which we ranour experiments. Finally, we made the AndrABEn libraryfreely available [1] for researchers and developers.

Organization.The rest of the paper is organized as follows. In Section

2 we present some related work. In Section 3 we introducethe preliminaries and background on ABE. In Section 4,we present AndrABEn, our proposed implementation forCP-ABE and KP-ABE, and provide an analysis of its per-formance. We also discuss and compare our results with theones in [21]. Finally, in Section 5 we draw our conclusions.

2. RELATED WORKDue to the increasing use of mobile devices, evaluating the

performance of cryptographic algorithms on mobile devicesis an important issue that has been considered in severalresearch studies [9, 13, 18, 20]. As an example, Braga andNascimento [9] evaluated the feasibility of cryptographic al-gorithms on Android smartphone devices. They assessed theportability of cryptographic libraries on a Samsung i9100and measured the performance of applying these librarieson the Android devices; however, in their analysis they didnot consider ABE.

Recently, the concept of ABE has been used in variousschemes to deal with data confidentiality, privacy and accesscontrol issues. Unfortunately, most of these research stud-ies did not evaluate the actual feasibility of adopting ABEin their proposed approaches. However, few researchers fo-cused on such assessment; we discuss some of them in thefollowing.

In [6], Baden et al. presented Persona, an Online SocialNetwork, where users are able to hide their personal infor-mation. They provided privacy by encrypting data withABE. They implemented their solution on a first generationiPhone device, by cross-compiling the cpabe library [2] andits dependencies for the iPhone SDK 2.2.1. They obtainedan average decryption and encryption time of 254 ms and926 ms respectively, considering access structures containingone to five attributes. However, the authors did not providean implementation of ABE on the Android smartphone.

1We re-implemented the proposal in [21] due to the unavail-ability of the original source code.

Along the same line of studies, we also proposed a systemfor efficient software updates distribution, over untrusteddistribution networks in [5]. We used CP-ABE to guaranteeflexible access control. In this work, we only provided eval-uations measured on a laptop device with two 2.4 GHz IntelCore 2 Duo CPUs. Based on our experimental results, theCP-ABE encryption and decryption time for five attributesare 77.47 ms and 32.62 ms, respectively. We realized thatnot providing a proper feasibility assessment is a big limita-tion for this type of proposals. In this paper, we aim to fillthis gap and pave the way for developing further solutionsassuming the feasibility of ABE for mobile devices.

A study similar to the one we are going to discuss in thispaper was carried out in [21]. The authors evaluated theperformance of CP-ABE and KP-ABE in terms of execu-tion time, data overhead, energy consumption, CPU andmemory usage. They implemented these two ABE schemesusing Java on a laptop with a 1.60 GHz Intel Quad-Core i72677M CPU and a smartphone runs Android 4.04 with a1.60 GHz Intel Atom Z2460. The authors stated that ap-plying ABE on Android smartphone devices is not practicalwith acceptable performance. In this paper, we show thatthis conclusion mostly depends on the specific implementa-tion provided in [21], and it does not hold in general.

Finally, in [12] Green et al. proposed an alternative ap-proach for efficient ABE decryption. In their solution, apart of the ABE decryption is outsourced to a third partycloud, highly reducing the load on the client device. How-ever, while representing a good option to facilitate the ABEoperations on devices with limited resources, this solutionrequires additional resources compared to in-device decryp-tion, such as a third-party cloud entity, as well as Internetconnectivity.

To the best of our knowledge, we are the first that showthe reasonable performance of ABE on Android devices,and provide a publicly available implementation for Androidsmartphone devices [1]. Indeed, existing ABE implementa-tions for Android showed a high computation overhead onmobile platforms [19, 21]. We prepared and cross-compiledtwo ABE C libraries, to be used on the Android mobile de-vices, thus proving the feasibility of such schemes on thisplatform. While we leave this as a future work, we expectthat AndrABEn can be easily extended for other mobiledevices and Internet of Things (IoT) devices.

3. BACKGROUND ON ABEThis section provides the fundamentals of Key-Policy

ABE (KP-ABE) [11], and Ciphertext-Policy ABE (CP-ABE) [7]. Both CP-ABE and KP-ABE, are public keyschemes. In a KP-ABE scheme, the data owner encryptsthe data specifying a set of attributes. Each user owns aprivate key D that reflects a specific policy. She will be ableto decrypt a ciphertext if and only if the attributes embed-ded into the ciphertext satisfy the policy in D. It consistsof four functions:

• Setup. It takes as input an implicit security param-eter and outputs the public parameter pkABE , and amaster key mkABE .

• Encryption. It takes as input a message M , a setof attributes γ, and the public parameter pkABE , andoutputs the ciphertext E.

Page 3: On the Feasibility of Attribute-Based Encryption on Smartphone … · 2015. 4. 3. · Core 2 Duo CPUs. Based on our experimental results, the CP-ABE encryption and decryption time

• KeyGen. It takes as input an access policy A, themaster key mkABE and the public parameter pkABE .It outputs a decryption key D reflecting the given pol-icy.

• Decryption. It takes as input the ciphertext E that isencrypted under the set of attributes γ; the decryptionkey D, that represents the access policy A; and thepublic parameter pkABE . It outputs the message M ifand only if γ “satisfies” the access policy A.

Different from KP-ABE, in the CP-ABE scheme, the dataowner encrypts her data enforcing an access policy. Usersare provided with private keys representing a set of at-tributes. Only users having attributes that satisfy an accesspolicy will be able to decrypt the ciphertext. A CP-ABEscheme provides the following functions:

• Setup. It takes as input an implicit security param-eter and outputs the public parameter pkABE , and amaster key mkABE .

• Encryption. It takes as input a message M , an ac-cess policy A, and the public parameter pkABE , andoutputs the ciphertext E.

• KeyGen. It takes as input a set of attributes γ, themaster key mkABE and the public parameter pkABE .It outputs a decryption key D reflecting the given at-tributes.

• Decryption. It takes as input the ciphertext E thatis encrypted under the access policy A; the decryptionkey D representing a set of attributes γ; and the publicparameter pkABE . It outputs the message M if andonly if γ “satisfies” the access policy A.

Similar to other pairing-based schemes, the complexity ofCP-ABE and KP-ABE depends on the number of exponen-tiations and pairing operations performed by each of theiralgorithms [15]. In the CP-ABE scheme [7], the efficiency ofthe KeyGen algorithm depends on the number of attributesto be applied to the newly generated key. Herein, the al-gorithm performs two exponentiations for each attribute.Similarly, the Encryption operation requires two exponen-tiations for each attribute in the specified policy. The samecomplexity is required also by the KeyGen and Encryp-tion operations in the KP-ABE scheme [11]. However, theefficiency of the Decryption function for CP-ABE mainlydepends on how the policy enforced on the ciphertext andon the private key used for its decryption. This makes anestimation of the complexity of such operation a non triv-ial task [7]. The same holds for the KP-ABE Decryptionoperation, which strongly depends on the attributes set andthe access policy specified in the ciphertext and the privatekey, respectively.

4. ANDRABEN: IMPLEMENTATION ANDANALYSIS

In this section, we provide an in-depth analysis of theperformance of AndrABEn (Section 4.1), and a comparisonwith the implementation in [21] (Section 4.2).

4.1 Performance EvaluationOur ABE implementation [1] comprises two libraries: the

cpabe library [2], which implements the scheme proposed byBethencourt et al. in [7], and a publicly available custom im-plementation [3] of the KP-ABE scheme proposed by Goyalet al. in [11]. The original code has been slightly modified,in order to be integrated into Android mobile devices. Bothlibraries employ Type A pairings provided by the PBC li-brary [4]. Type A pairings are built on top of an ellipticcurve: y2 = x3 + x over a finite field Fq, for some primeq = 3 mod 4, and have a fixed embedding degree k = 2 [16].Therefore, the security strength of the scheme can be tunedby modifying two parameters: the size of the field q, andthe prime order r of the base point P ∈ E(Fq) [21]. Ta-ble 1 shows the security level of both CP-ABE and KP-ABEschemes, according to [10].

Security level bits 80 112 128

bit length of r 160 224 256

bit length of q 512 1024 1536

Table 1: Security strength of CP-ABE and KP-ABE.

AndrABEn is implemented on Android 4.3, “JellyBeam”. We carried out our experimental evaluation on aSamsung Galaxy Nexus device (1.2 GHz dual-core ARMCortex-A9 CPU, 1 GB RAM). For completeness and com-parison, we also tested our libraries on a laptop device(Ubuntu 14.4 LTS, 1.8 GHz 4x Intel CoreTM i7-4500U CPU,8 GB RAM).

We evaluated KeyGen, Encryption and Decryptionoperations, varying the number of attributes adopted fromone to 30. We consider this range to be representa-tive enough for a wide range of real world applications ofABE [21].

We tested both ABE schemes with security levels of 80,112 and 128 bits, and measured average execution time,CPU and memory utilization, and energy consumption onmobile devices. Note that, as in other public key schemes,in ABE the actual encryption of the ciphertext is performedby means of a symmetric key, which is in turn encryptedwith the public key. Therefore, we evaluate both encryptionand decryption operations performed on a symmetric key.This makes our analysis independent from the size of theciphertext.

Execution Time.Figure 1 presents the average time overhead for Encryp-

tion and Decryption operations for both CP-ABE andKP-ABE schemes. The results are presented for both An-droid and Laptop devices. They have been obtained as anaverage of 100 executions for each operation, varying thenumber of employed attributes and adopting different levelsof security.

As we can see in Figure 1, in general, the time requiredto perform each operation depends directly on the numberof attributes that are used. Adopting a security value of80 bits (which is reasonable for several medium-level secu-rity applications [8]) the CP-ABE Encryption operationremains under 4 s on the Android smartphone. Similarly,the CP-ABE KeyGen operation requires less than 2 s tobe executed. However, adopting a security level of 112 or128 bits, the time overhead imposed by CP-ABE on Android

Page 4: On the Feasibility of Attribute-Based Encryption on Smartphone … · 2015. 4. 3. · Core 2 Duo CPUs. Based on our experimental results, the CP-ABE encryption and decryption time

0 5 10 15 20 25 30Number of Attributes

0

10

20

30

40

50Ex

ecut

ion

time

(sec

onds

) Laptop, 80 bitsLaptop, 112 bitsLaptop, 128 bitsSmartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(a) CP-ABE Keygen

0 5 10 15 20 25 30Number of Attributes

0

10

20

30

40

50

Exec

utio

n tim

e (s

econ

ds) Laptop, 80 bits

Laptop, 112 bitsLaptop, 128 bitsSmartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(b) KP-ABE Keygen

0 5 10 15 20 25 30Number of Attributes

0

10

20

30

40

50

Exec

utio

n tim

e (s

econ

ds) Laptop, 80 bits

Laptop, 112 bitsLaptop, 128 bitsSmartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(c) CP-ABE Encryption

0 5 10 15 20 25 30Number of Attributes

0

10

20

30

40

50

Exec

utio

n tim

e (s

econ

ds) Laptop, 80 bits

Laptop, 112 bitsLaptop, 128 bitsSmartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(d) KP-ABE Encryption

0 5 10 15 20 25 30Number of Attributes

0

10

20

30

40

50

Exec

utio

n tim

e (s

econ

ds) Laptop, 80 bits

Laptop, 112 bitsLaptop, 128 bitsSmartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(e) CP-ABE Decryption

0 5 10 15 20 25 30Number of Attributes

0

10

20

30

40

50

Exec

utio

n tim

e (s

econ

ds) Laptop, 80 bits

Laptop, 112 bitsLaptop, 128 bitsSmartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(f) KP-ABE Decryption

Figure 1: Average execution time (and std. deviation inerrorbar) for main CP-ABE and KP-ABE algorithms.

smartphone is much higher, while we argue being still usablefor non-interactive applications (e.g., encrypted data to beuploaded to a cloud storage service). Indeed, in such appli-cations the encryption could be carried out in a backgroundprocess. For KP-ABE, however, the time required to per-form the various operations is lower, and even the adoptionof a security level of 128 bits is feasible on Android smart-phone. On laptop, the evaluation results confirm the prac-ticality of both CP-ABE and KP-ABE schemes, requiring areasonable time for both KeyGen (<2 s), and Encryption(<2 s) operations.

CPU utilization.We measured CPU utilization on Android smartphone

by collecting the required information from the system files/proc/stat, and /proc/[pid]/stat, where pid is the id ofthe application’s process. The CPU utilization remains un-der 50% for each of the three operations, for both CP-ABEand KP-ABE, i.e., the operations fully utilize one of the twoCPUs provided by the underlying platform.

Memory utilization.We measured the average memory space required by An-

drABEn, adopting a range between one to 30 attributes.We realized that our implementations utilize between 13.5and 14.5 MBytes of RAM space. We argue that such amountis acceptable for modern smartphones such as the SamsungGalaxy Nexus—used in our experiments.

To better understand the behavior of AndrABEn in largescale scenarios, we also measured the average memory con-

101 102 103

Number of Attributes

1314151617181920

Aver

age

RAM

usa

ge (M

Byte

s)

Smartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(a) CP-ABE Keygen

101 102 103

Number of Attributes

1314151617181920

Aver

age

RAM

usa

ge (M

Byte

s)

Smartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(b) KP-ABE Keygen

101 102 103

Number of Attributes

1314151617181920

Aver

age

RAM

usa

ge (M

Byte

s)

Smartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(c) CP-ABE Encryption

101 102 103

Number of Attributes

1314151617181920

Aver

age

RAM

usa

ge (M

Byte

s)

Smartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(d) KP-ABE Encryption

101 102 103

Number of Attributes

1314151617181920

Aver

age

RAM

usa

ge (M

Byte

s)

Smartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(e) CP-ABE Decryption

101 102 103

Number of Attributes

1314151617181920

Aver

age

RAM

usa

ge (M

Byte

s)

Smartphone, 80 bitsSmartphone, 112 bitsSmartphone, 128 bits

(f) KP-ABE Decryption

Figure 2: Average RAM usage for CP-ABE and KP-ABEon Android smartphone.

sumption employing 10, 100 and 1000 attributes. Figure 2shows the obtained results. As expected, the amount of re-quired RAM grows with the number of employed attributes.Here, one of the main advantages of running CP-ABE andKP-ABE on native code is the possibility to manage theheap usage directly, without relying on the Dalvik VM. In-deed, in such case the use of the expensive garbage collectorsignificantly slows down the overall execution [19].

Energy Consumption.Energy consumption is a major concern in mobile devices.

Therefore, a desirable implementation of a cryptographictool for mobile devices, should consume as less energy aspossible. We measured the average energy consumption foreach of the CP-ABE and KP-ABE operations, by using thewell-known PowerTutor Android application [22]. Figure 3shows the obtained results. As we can see, with a securitylevel of 80 and 112 bits, the energy required by both schemesremains low, making their use suitable on smartphones.

4.2 DiscussionIn what follows, we provide a brief comparison of our pro-

posal, AndrABEn, against the implementation proposedin [21], on the Android platform.

Unfortunately, the code used in [21] does not seem tobe publicly available. Moreover, in [21], the authors per-formed their evaluation on a device (and a specific proces-sor in smartphone) which is not easily available anymore(an Android smartphone with a 1.60 GHz Intel Atom Z2460processor and 1 GB RAM). For these reasons, to compare

Page 5: On the Feasibility of Attribute-Based Encryption on Smartphone … · 2015. 4. 3. · Core 2 Duo CPUs. Based on our experimental results, the CP-ABE encryption and decryption time

5 10 15 20 25 30Number of Attributes

02468

101214161820

Ener

gy (J

)Smartphone, 80 bitSmartphone, 112 bitSmartphone, 128 bit

(a) CP-ABE Keygen

5 10 15 20 25 30Number of Attributes

02468

101214161820

Ener

gy (J

)

Smartphone, 80 bitSmartphone, 112 bitSmartphone, 128 bit

(b) KP-ABE Keygen

5 10 15 20 25 30Number of Attributes

02468

101214161820

Ener

gy (J

)

Smartphone, 80 bitSmartphone, 112 bitSmartphone, 128 bit

(c) CP-ABE Encryption

5 10 15 20 25 30Number of Attributes

02468

101214161820

Ener

gy (J

)

Smartphone, 80 bitSmartphone, 112 bitSmartphone, 128 bit

(d) KP-ABE Encryption

5 10 15 20 25 30Number of Attributes

02468

101214161820

Ener

gy (J

)

Smartphone, 80 bitSmartphone, 112 bitSmartphone, 128 bit

(e) CP-ABE Decryption

5 10 15 20 25 30Number of Attributes

02468

101214161820

Ener

gy (J

)

Smartphone, 80 bitSmartphone, 112 bitSmartphone, 128 bit

(f) KP-ABE Decryption

Figure 3: Average energy consumption for CP-ABE andKP-ABE on Android smartphone.

with the implementation proposed in [21], we can only relyon the numbers reported in [21] itself. Most of the discus-sion that follows is based on this approach. Moreover, for afurther validation we also re-implemented the solution pro-posed in [21] and performed some additional comparison. Asa side note we observe that, since our implementation is sin-gle threaded, it does not take advantage from the dual-coreCPU of the device we used for our measurements. Further-more, both the device we adopted and the one used in [21]are equipped with the same RAM memory (i.e., 1 GB).

As shown in Figure 1, the execution time for both CP-ABE and KP-ABE with AndrABEn is significantly lowercompared to the results reported in [21]. In particular,the CP-ABE key generation with AndrABEn requiresless than 30 s, while with the implementation proposedin [21], key generation requires around 200 s. Similarly, An-drABEn performs CP-ABE encryption and decryption inless than 30 s and 20 s, respectively, while in the implemen-tation proposed in [21], encryption and decryption opera-tions take on average 70 s and 80 s, respectively. Moreover,the average execution time reported in [21] for all the threemain KP-ABE operations, considering 26 attributes and asecurity level of 128 bits, is ≈ 45 s for encryption, whiledecryption and key generation operations require between≈ 90 s and ≈ 110 s. Instead, our AndrABEn implemen-tation of KP-ABE requires a considerably lower executiontime for each of the main operations, i.e., 12 s for decryp-tion (Figure 1f), and 3 s for encryption (Figure 1d) and keygeneration (Figure 1b).

In order to compare the energy consumption of An-drABEn (which is illustrated in Figure 3) with the im-plementation proposed in [21] for CP-ABE, let us consider10 attributes and a security level of 128 bits. With An-drABEn, each of the main CP-ABE operations, i.e., keygeneration, encryption and decryption, consumes almost 5 J,while with the implementation proposed in [21], key genera-tion consumes between 70 J and 100 J, and encryption anddecryption operations consume 30 J and 40 J, respectively.Furthermore, compared to AndrABEn, also the KP-ABEimplementation of key generation, encryption and decryp-tion provided in [21] require a considerably higher amountof energy. Indeed, while our implementation of the threemain KP-ABE operations requires less than 5 J, the imple-mentation in [21] requires between 15 J and 40 J.

0 5 10 15 20 25 30Number of Attributes

0

100

200

300

400

500

600

Exec

utio

n tim

e (s

econ

ds) ANDRABEN, 80 bits

ANDRABEN, 112 bitsANDRABEN, 128 bitsJava impl., 80 bitsJava impl., 112 bitsJava impl., 128 bits

(a) CP-ABE Keygen

0 5 10 15 20 25 30Number of Attributes

0

100

200

300

400

500

600

Exec

utio

n tim

e (s

econ

ds) ANDRABEN, 80 bits

ANDRABEN, 112 bitsANDRABEN, 128 bitsJava impl., 80 bitsJava impl., 112 bitsJava impl., 128 bits

(b) CP-ABE Encryption

0 5 10 15 20 25 30Number of Attributes

0

100

200

300

400

500

600

Exec

utio

n tim

e (s

econ

ds) ANDRABEN, 80 bits

ANDRABEN, 112 bitsANDRABEN, 128 bitsJava impl., 80 bitsJava impl., 112 bitsJava impl., 128 bits

(c) CP-ABE Decryption

Figure 4: Comparison between the CP-ABE implementationof AndrABEn and in [21].

The comparison reported up to this point considered di-rectly the performance results reported in [21]. However, fora further validation we also developed our own Java-basedimplementation of the CP-ABE scheme in [7], following thespecifications reported in [21]. We evaluated our Java imple-mentation (which we believe being similar to the one usedin [21], for which code is not available) on the same device weused to evaluate AndrABEn. Due to space limitations, weonly provide a comparison of the different execution time forthe two solutions, which is presented in Figure 4. As we cansee, the execution time for CP-ABE with AndrABEn is sig-nificantly lower compared to the results obtained with ourJava based implementation, that in turn presents resultsthat are consistent with the ones provided in [21]. As an ex-ample, let us consider the execution time obtained with 25attributes and a security level of 128 bits. Our CP-ABE An-drABEn implementation requires ≈25 s to perform the keygeneration, while the Java-based implementation requires≈360 s to perform the same task. Similarly, the CP-ABEencryption and decryption operations with AndrABEn re-quire on average ≈26 s and ≈19 s, while our Java-based im-plementation performs encryption and decryption in ≈340 sand ≈172 s, respectively.

Page 6: On the Feasibility of Attribute-Based Encryption on Smartphone … · 2015. 4. 3. · Core 2 Duo CPUs. Based on our experimental results, the CP-ABE encryption and decryption time

Overall, we can conclude that, compared with the ap-proach discussed in [21], AndrABEn provides significantlybetter performance, in terms of execution time, memory andCPU usage, and energy consumption.

5. CONCLUSIONWith the increasing use of cloud environment and smart

devices connected to the Internet of Things, exchanged dataconfidentiality and access control to the stored data becomea challenging issue. Attribute-Based Encryption is one of thebest solutions that can be used to satisfy users privacy con-cerns [21]. However, its performance on resource constraintdevices is a challenging issue, and still represents a big con-cern for researchers willing to use ABE to develop novelprivacy-preserving and access control solutions for such de-vices.

In this paper, we studied the feasibility of applying ABEon smartphone devices and presented AndrABEn, an im-plementation of ABE in C language. We also provided acomparative analysis with a similar research study [21] inwhich the authors proposed a Java-based implementationof ABE for Android smartphone. Based on the results ofour thorough experiments, we conclude that using ABE onAndroid smartphones and similar devices is feasible. Theevidence that we bring in this paper will be a reference forapplicability of ABE in resource-constrained devices.

6. REFERENCES[1] ANDRABEN library.

http://spritz.math.unipd.it/projects/andraben.

[2] CP-ABE implementation.http://hms.isi.jhu.edu/acsc/cpabe/.

[3] KP-ABE implementation.https://github.com/gustybear/kpabe.

[4] Pairing Based Cryptography library.http://crypto.stanford.edu/pbc/.

[5] M. Ambrosin, C. Busold, M. Conti, A. R. Sadeghi,and M. Schunter. Updaticator: Updating billions ofdevices by an efficient, scalable and secure softwareupdate distribution over untrusted cache-enablednetworks. In ESORICS’14, pages 76–93, 2014.

[6] R. Baden, A. Bender, N. Spring, B. Bhattacharjee,and D. Starin. Persona: An online social network withuser-defined privacy. SIGCOMM ComputerCommunications Review, 39(4):135–146, 2009.

[7] J. Bethencourt, A. Sahai, and B. Waters.Ciphertext-policy attribute-based encryption. InSP’07, pages 321–334, 2007.

[8] J. W. Bos, M. E. Kaihara, T. Kleinjung, A. K.Lenstra, and P. L. Montgomery. On the security of1024-bit rsa and 160-bit elliptic curve cryptography.

Cryptology ePrint Archive, Report 2009/389, 2009.http://eprint.iacr.org/.

[9] A. M. Braga and E. N. Nascimento. Portabilityevaluation of cryptographic libraries on androidsmartphones. In CSS’12, volume 7672, pages 459–469,2012.

[10] M. Brown, D. Hankerson, J. Lopez, and A. Menezes.Software implementation of the nist elliptic curvesover prime fields. In Topics in Cryptology - CT-RSA2001, volume 2020, pages 250–265. 2001.

[11] V. Goyal, O. Pandey, A. Sahai, and B. Waters.Attribute-based encryption for fine-grained accesscontrol of encrypted data. In CCS’06, pages 89–98,2006.

[12] M. Green, S. Hohenberger, and B. Waters.Outsourcing the Decryption of ABE Ciphertexts. InUSENIX Security Symposium, page 3, 2011.

[13] Y. Kawahara, T. Takagi, and E. Okamoto. Efficientimplementation of tate pairing on a mobile phoneusing java. In CIS’06, volume 2, pages 1247–1252,2006.

[14] C.-C. Lee, P.-S. Chung, and M.-S. Hwang. A surveyon attribute-based encryption schemes of accesscontrol in cloud environments. IJ Network Security,15(4):231–240, 2013.

[15] M. Li, W. Lou, and K. Ren. Data security and privacyin wireless body area networks. IEEE WirelessCommunications, 17(1):51–58, 2010.

[16] B. Lynn. On the implementation of pairing-basedcryptosystems. PhD thesis, Stanford University, 2007.

[17] A. Sahai and B. Waters. Fuzzy identity-basedencryption. In EUROCRYPT’05, pages 457–473, 2005.

[18] S. Tillich and J. Grossschaedl. A survey of public-keycryptography on j2me-enabled mobile devices. InISCIS’04, pages 935–944. 2004.

[19] P. Tysowski and M. Hasan. Hybrid Attribute- andRe-Encryption-Based Key Management for Secure andScalable Mobile Applications in Clouds. IEEETransactions on Cloud Computing, 1(2):172–186, 2013.

[20] A. G. Voyiatzis, K. G. Stefanidis, and D. N. Serpanos.Increasing lifetime of cryptographic keys onsmartphone platforms with the controlled randomnessprotocol. In WESS’11, pages 1–6, 2011.

[21] X. Wang, J. Zhang, E. M. Schooler, and M. Ion.Performance evaluation of attribute-based encryption:Toward data privacy in the iot. In ICC’14, 2014.

[22] L. Zhang, B. Tiwana, Z. Qian, Z. Wang, R. P. Dick,Z. M. Mao, and L. Yang. Accurate online powerestimation and automatic battery behavior basedpower model generation for smartphones. InCODES/ISSS ’10, pages 105–114, 2010.