KP and CP ABE
KP and CP ABE
KP and CP ABE
Preprint version
1 Introduction
Internet of Things is a growing trend populating the world with billions of interconnected devices. These
devices relate to physical “things”, ranging from wearable sensors, to smartphones and smart cars [1].
Unfortunately, although IoT has the potential to enable new innovative services and simplify the
communication between people and objects, it brings new security and privacy challenges. For example,
consider an IP-enabled sensor in a smart healthcare system, which transmits medical data of patients to a
remote healthcare server. In this scenario, the conveyed medical data may be routed through an untrusted
network, or could be stored in an untrusted cloud service, exposing potentially privacy sensitive data to
cyber attacks.
Besides generic IoT security and privacy issues, the concept of distributed IoT [1] introduces additional
context-specific challenges. Devices not only send their data to the cloud, but also can form an “Intranet
of Things”, communicating with each other, and with other IoT systems. For example, in a smart
healthcare system, devices in a patient’s smart house may need to interact directly with hospital’s IoT
system. However, either collaborating entities may be untrusted, or the transmitted data may need to be
revealed only to some selected parties. These challenges call for an urgent need for efficient
authentication and fine-grained access control mechanisms, requiring advanced cryptographic methods.
Furthermore, an important aspect to consider when it comes to resource-constrained IoT devices is
providing flexible key management protocols; which motivated researchers to develop efficient security
solutions for IoT systems [2].
1
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
Attribute-Based Encryption and IoT. In recent years, several security protocols adopted
Attribute-Based Encryption (ABE) as a building block in different distributed environments [3], such as
IoT [4], cloud services [5], and medical systems [6]. ABE is a public key scheme where both encryption
and decryption are based on high-level data access policies. Considering the aforementioned requirements
in distributed and heterogeneous IoT scenarios, ABE provides more efficient access control mechanism
compared to conventional cryptographic algorithms [3], [6], [7]: (i) allows fine-grained access control
based on recipients’ attributes; (ii) scales independent from the number of authorized users; (iii) is
resilient against collusion attacks; (iv) does not require key sharing or key management algorithms
between the participating parties (data owner does not need to identify the destination client). Besides its
noteworthy advantages, a proper key revocation algorithm is still a challenging issue in ABE (beyond the
scope of this paper), and an ongoing research effort [3]. More relevant to our work, ABE suffers from
high computational overhead [6], [8]. However, the literature is still missing a proper assessment of ABE
efficiency on resource-constrained devices, widely used in the IoT domain.
In order to shine a light on the feasibility of ABE in IoT, we perform a comprehensive analysis of the cost
of ABE operations on resource-constrained devices. In particular, along the same line of our previous
work [7], which investigated the feasibility of ABE on smartphone devices, in this paper we implement
the original Key-Policy Attribute-Based Encryption (KP-ABE) [9] and Ciphertext-Policy Attribute-Based
Encryption (CP-ABE) [10] on widely used IoT-enabling devices. Our work focuses on the evaluation of
encryption and decryption (hereinafter called cryptographic operations) on four boards: Intel Galileo Gen
2, Intel Edison, Raspberry Pi 1 Model B, and Raspberry Pi Zero. Due to space limitation, we only report
the results for CP-ABE. However, we noticed that the KP-ABE experiments have a very similar
quantitative behavior to CP-ABE results. Supported by our observations from thorough experimental
results, we provide evidence of the feasibility of adopting ABE on resource-constrained devices.
Moreover, we present a smart healthcare use case application to evaluate feasibility of using ABE in real
world IoT scenarios.
2
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
policy on the data. An example of the CP-ABE is illustrated in Fig. 1(b), where the data owner encrypts
the data specifying the access policy: (Dev_family=Board_XYZ ∧ Dev_role=Role_1) ∨ (Release_Date>2013)
as part of the encryption. A user will be able to decrypt the ciphertext, iif her secret key is associated with
a set of attributes that can satisfy the access policy.
Several factors influence the performance of ABE in real world applications, such as desired security
level, capacity of the underlying device (i.e., available memory and CPU speed), and the number and type
of attributes used in the access policy definition. Attributes number, in particular, plays a fundamental role
in ABE performance: encryption in CP-ABE requires computing two exponentiations for each attribute in
the resulting access policy. Similarly, KP-ABE encryption requires two exponentiations for each attribute
enforced on the ciphertext. Decryption complexity in CP-ABE is upper bounded by l exponentiations, and
2l pairing operations [10], while in KP-ABE by only l pairing operations; l is the number of attributes
“matching” the access policy (in CP-ABE) or the key policy (in KP-ABE).
For a more complete evaluation of ABE, in this research, we also analyze the impact of using numeric
attributes along with string attributes. We believe that, while the use of numeric attributes may be
expensive, it provides additional expressiveness in policy definitions, especially in CP-ABE. As an
example, there may be situations where access to data should be restricted to only a certain model of
devices, released after a certain date (which can be represented as a 64 bit integer).
3
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
4
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
5
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
the figures but are not visible since they are too small). It is evident that, as expected, increasing the
number of attributes leads to increased execution time and memory usage (and consequently, increased
energy consumption). Similarly, a higher security level leads to increased workload on the tested devices.
Memory usage footprint is similar for all the boards, ranging between 14 and 15 MByte using a
small/medium number of attributes. Security level does not have a significant impact on memory usage,
which is rather affected by the number of adopted attributes.
In terms of execution time and energy consumption, Raspberry Pi 1 and Raspberry Pi Zero have similar
behavior, and show the best performance, while Intel Galileo shows the worst performance. For example,
considering 80 bits security level and 30 attributes, it takes ≈5 sec for encryption, and ≈3.6 sec and ≈2.9
sec for decryption, on Raspberry Pi 1 and Raspberry Pi Zero, respectively. With Intel Galileo, the
execution time is ≈15 sec, and ≈13 sec for encryption and decryption, respectively. For a comparison, note
that establishing a TLS (version: 1.2; cipher: ECDHE-RSA-AES128-GCM-SHA256; key length: 2048)
session with w ww.google.com:443, on Intel Edison, requires on average 0.206 sec. In the same setting,
energy consumption of decryption and encryption on Raspberry Pi 1 and Raspberry Pi Zero are ≈0.5 J,
and ≈0.8 J, respectively, while Intel Galileo requires ≈3.7 J and ≈4.3 J, respectively.
Our study provides a clear estimate of how the above two factors contribute to the overall performance,
offering a caveat for choosing security level and attributes. In general, performance penalty is higher
when increasing the security level, compared to the number of attributes. In order to have stronger
security (i.e., moving from 80 to 128 bits), the number of considered attributes needs to be reduced, on
average, by 10 times. As an example of the tradeoff between security and number of attributes, CP-ABE
encryption with 15 attributes and 112 bits security level shows an average execution time of 9.68 sec, and
energy consumption of 1.75 J. Similar performance can be achieved with a security level of 128 bits using
policies with less than 5 attributes. A notable insight from our experimentation is this pareto-space of a
combinatorial choices of platform, security levels and attributes.
6
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
Fig. 2. Execution time, memory and energy consumption for CP-ABE encryption.
We further analyzed the overhead of our implementation at a function-call level, i.e., we measured the
timing overhead introduced by each function in CP-ABE cryptographic operations, on the Intel Edison
board. In general, the encryption routine spends almost 91% of the time executing (multiple times) two
functions from the PBC library: e lement_from_hash, to convert and hash value into a group element, and
element_pow_zn, to perform exponentiation in ZN; while decryption depends almost entirely on the
pairing_apply function (almost 97% overhead).
7
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
Fig. 3. Execution time, memory and energy consumption for CP-ABE decryption.
8
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
(c) CP-ABE encryption time on a Raspberry Pi 1 Mod B, access policy A<N, N ranges from 20 to
224.
According to [10], a numeric attribute, such as A=9, can be translated into a set of simple attributes
indicating the value of each single bit in the attribute’s binary representation. For example, using a 64 bit
representation for an integer, the attribute A=910=10012 is translated into:
A:xxxx...1xxx, A:xxxx...x0xx,
A:xxxx...xx0x, A:xxxx...xxx1,
A:eq_09, A:gt_2ˆ02, A:lt_2ˆ04, …
9
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
This represents the binary translation of 9 (x is a wildcard bit value), plus an attribute for exact matching
(A:eq_09), and other attributes, e.g., the ones of the form A:lt_2ˆN (A<2N), and A:gt_2ˆN (A>2N), which are
“compressed” representations of the remaining bits, required due to the 64 bit representation of a numeric
attribute.
Single numeric clauses can be converted into access tree structures of simple attributes. Figure 4(b) shows
the translation of A<11. As we can see, even simple access control policies involving numeric attributes
generate quite complex trees, with a consequent impact on the performance of cryptographic operations.
To better understand such impact, we measured the execution time of CP-ABE encryption using simple
policies in the form A<2X, where X ranges from 1 to 24. Figure 4(c) presents our results, experimented on
a Raspberry Pi. We derive two important observations for the practice: (1) encryption time (which
depends on the size of the tree) does not grow directly with the size of the considered number, but instead
with the “minimum number of Bytes” necessary to represent the number; (2) numbers that are power of 2
generate simpler access trees, with a consequent reduced encryption time. Moreover, for power of 2, the
closer the most significant bit at 1 is to the size of the bit word in use (i.e., 8, 16, 24, or 32), the simpler
will be the corresponding access tree. For example in Figure 4(c), the access policy A<256 (28) generates
an access tree with eleven leaves and two AND gates, requiring ≈1.941 sec for encryption; while,
encryption with A<32768 (215) generates a simpler access tree with only three leaves and one AND gate,
requiring ≈0.547 sec. Note that, the above considerations on numerical attributes usage can be also
extended to the KP-ABE scheme in [9], as it uses a similar access tree construction as in [10].
10
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
5 Conclusion
We have shown the feasibility of adopting ABE in representative IoT systems. Our results can be a
reference for researchers and designers of novel ABE-based security solutions. We believe future research
should focus on improving ABE efficiency, via both a careful selection of attributes and software and
hardware optimizations for the cryptographic library. Our analysis shows that the utilized library can be
significantly optimized via proper memory management, customized data structure deployment, and
simplification of cryptographic arithmetic operations considering input attributes. Moreover, considering
the fact that the complexity of CP-ABE and KP-ABE depends on the number of exponentiations and
pairing operations performed by each of their algorithms, future work could address the migration of
complex arithmetic operations, such as exponentiation, to hardware accelerators (for example, custom
logic on field-programmable gate arrays) in order to enhance energy efficiency and total execution time
11
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
Fig. 5. Healthcare use case parameters and latency evaluation on an Intel Edison board, considering 80
bits security level.
Acknowledgement
This research was partially supported by the EU Marie Curie Fellowship PCIG11-GA- 2012-321980 and
EU projects ReCRED (ref. 653417), EU TagItSmart! (H2020-ICT30-2015-688061), and EU-India
REACH (ICI+/2014/342-896).
12
Accepted for publication -- IEEE Micro Special Issue on Internet of Things (2016)
Preprint version
References
[1] R. Roman et al., On the features and challenges of security and privacy in distributed internet of
things, Computer Networks, 2013.
[2] S. R. Moosavi et al., Session resumption-based end-to-end security for healthcare internet-of-things,
IEEE CIT’15, 2015.
[3] S. SM. Chow, A Framework of Multi-Authority Attribute-Based Encryption with Outsourcing and
Revocation, ACM SACMAT’16, 2016.
[4] X. Li et al., Smart community: an internet of things application, IEEE Communications Magazine,
2011.
[5] H. Ma et al., Verifiable and exculpable outsourced Attribute-Based Encryption for access control in
cloud computing, IEEE TDSC, 2015.
[6] L. Ming et al., Data security and privacy in wireless body area networks, IEEE Wireless
Communication, 2010.
[7] M. Ambrosin et al., On the feasibility of attribute-based encryption on smartphone devices, ACM
MobiSys/IoT-Sys’15, 2015.
[8] X. Wang et al., Performance evaluation of Attribute-Based Encryption: Toward data privacy in the
IoT, IEEE ICC ’14, 2014.
[9] V. Goyal et al., Attribute-Based Encryption for Fine-grained Access Control of Encrypted Data, ACM
CCS’06, 2006.
[10] J. Bethencourt et al., Ciphertext-Policy Attribute-Based Encryption, IEEE S&P’07, 2007.
[11] D. Warren and C. Dewar, Understanding 5G: Perspectives on future technological advancements in
mobile, GSMA Intelligence, Tech. Rep., 2014.
[12] K. Spilker, From the MVPs: Introduction to the Internet of Things From the Device to Microsoft
Azure Cloud, Microsoft Press, 2015.
13