# Enhancing fine-grained access control in fog-based e-health applications

Abdelghani Krinah, Yacine Challal, Mawloud Omar, Omar Nouali

► To cite this version:

Abdelghani Krinah, Yacine Challal, Mawloud Omar, Omar Nouali. Enhancing fine-grained access control in fog-based e-health applications. Cluster Computing, 2025, 28 (9), pp.605. 10.1007/s10586-025-05285-1 . hal-05234183

HAL Id: hal-05234183

https://hal.science/hal-05234183v1

Submitted on 1 Sep 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
# Enhancing Fine-Grained Access Control in Fog-Based e-Health Applications

Abdelghani Krinah¹,⁴*, Yacine Challal², Mawloud Omar³, Omar Nouali⁴

¹*Departement Informatique, Faculte des Sciences Exactes, Universite de Bejaia, Bejaia, 06000, Algeria.

²University of Doha for Science and Technology, Doha, Qatar.

³South Brittany University, France.

⁴Division of Computer Security, Research Center on Scientific and Technical Information (CERIST), Algiers, 16000, Algeria.

*Corresponding author(s). E-mail(s): abdelghani.krinah@univ-bejaia.dz, akrinah@cerist.dz;

Contributing authors: yacine.challal@udst.edu.qa; mawloud.omar@univ-ubs.fr; onouali@cerist.dz;

## Abstract

Fog computing is an extension of Cloud computing to the edge of the network, developed especially for applications requiring localized data with very low retrieval latencies, such as e-health applications. Moreover, fog computing brings many advantages to e-health applications such as elastic management of computing and storage devices on-premises. This brings more availability, reliability and security to e-health applications. However, many challenges brake the widespread adoption of fog computing in e-health applications, such as: reduced capacity of some devices used specifically in patient health monitoring and the requirements relating to patient privacy protection. In this paper we present MABE (MetaAttributes Based Encryption), an approach that leverages fine-grained data access control by making it applicable to Fog environments where constrained devices are largely used. MABE is based on access policy reduction by replacing a set of attributes with a meta-attribute that infers them. The experiment results show that our solution considerably improves the computational time compared to CP-ABE and other existing solutions. Indeed, MABE presents better results in terms of encryption time, particularly for a large number of attributes, and very similar results as for decryption, while having the advantage of not using additional processing nodes (proxy re-encryption and outsourced decryption) as is the case in many existing solutions.

**Keywords:** Fine-grain access control, Fog Computing, e-Health Applications, Similarity Calculation

## 1 Introduction

Fog Computing has been introduced to address the cloud architecture's latency issue, by bringing the processing and storage units at the edge

of the network, closer to end users where data is produced and consumed, particularly in applications requiring a very short response time, such as e-health applications. However, like any computer system in healthcare environment, it must meet
certain requirements, especially in terms of secu-
rity and privacy. Data privacy refers to an indi-
vidual's right to control data exchange with third
parties within a computer network. It is, there-
fore, essential to implement security measures that
determine who can access data for specific pur-
poses [1]. To protect patient privacy, various laws
and regulations have been put in place in different
regions, such as the Health Insurance Portability
and Accountability Act (HIPAA)<fnref n="1" /> in the USA and
the General Data Protection Regulation (GDPR)<fnref n="2" />
in Europe. These laws set standards for protecting
the confidentiality and security of personal health
information and require researchers and health-
care organizations to obtain informed consent
from patients before collecting, storing, or using
their personal information for research or analytics
purposes [2]. Compliance with these regulations is
essential to protect patients' privacy.

Among the promising techniques for privacy
protection and fine-grained data access control,
the attribute-based encryption (ABE) approach
is an interesting solution. It has proved its effec-
tiveness in various environments, such as Cloud
computing [3]. The advantage of ABE is that
it does not rely on the Cloud Service Provider
(CSP) to prevent unauthorized data access since
the access policy is embedded into the encrypted
text, or into the decryption key.

The integration of ABE into constrained envi-
ronment is a challenge. Many studies have been
conducted on the feasibility of ABE on IoT
devices, mobile devices or smartphones [4] [5]. In
our previous work [6], and in order to know what
factors affect the performance of ABE encryp-
tion in constrained environment, we performed
tests on two resource constraint devices (a smart-
phone and a Raspberry). The results obtained
were almost similar in both environments, namely
that the most influential factors are the number
of attributes.

Approach:

In this work, we present MABE (Meta-Attributes
Based Encryption), a CP-ABE improvement solu-
tion that makes it applicable to the constrained
devices of Fog environment. We have performed
an intensive benchmarking analysis of the factors

that affect Attributes Based Encryption perfor-
mance. This allowed a better understanding of
how the number of attributes influence the ABE
performance. Thereby, our approach consists of
acting on these factors. The main idea of our
solution is to reduce the number of attributes
used in CP-ABE encryption by replacing them
with Meta-Attributes. A Meta-Attribute is a set
of attributes that most often appear together and
therefore potentially describe the same user. Let's
take the medical staff of a hospital as an example.
We can notice that several individuals share the
following characteristics: Grade:Specialist Doctor,
Speciality:Cardiology, Organization:Delta Hospi-
tal, Country:Alpha... And so these attributes
often appear together. Our approach is to gather
all or some of these attributes into a single
meta-attribute which will describe these users
(See section 5.3 for more details). In the first
step, we perform a classification on the corre-
lated attributes to obtain what we call "meta-
attributes". The latter are then used in CP-ABE
operations instead of the original attributes, in
order to reduce the cost of encryption without
altering the security level.

Our solution is based on vector model intro-
duced by Salton [7], and widely used in Informa-
tion Retrieval Systems like search engines. We will
proceed as follows:

1. By analogy to corpus documents, attributes are given a vector representation, in which dimensions of the vector representing an attribute are the users it describes. Then a matrix structure of attributes is obtained by gathering all attributes' vectors. By this technique, each dimension of the matrix makes it possible to define distances (or proximities) between the elements of other dimension. So the second step is to calculate the distance between attributes. It is measured using cosine formula that calculates the cosine of angle between their respective vectors. The closer angle cosine between the two attributes' vectors to 1, the more the vectors are close what implies a greater co-occurrence between the two attributes.

2. Once cosines are calculated, we proceed to Attributes' classification using k-means technique [8]. The goal is to obtain *k* attribute

<footnote n="1">¹https://www.hhs.gov/hipaa/index.html</footnote>

<footnote n="2">²https://gdpr.eu/</footnote>
classes (clusters) corresponding to *k* meta-attributes which will be used in the various CP-ABE encryption operations.

3. Then we will develop our MABE scheme based on the modification of the CP-ABE primitives by using the meta attributes obtained in the previous steps of our construction.

4. Finally, we propose a home medical monitoring system based on Fog architecture, in order to test and validate our solution. The system is composed of: - Sensors (Body Sensors Network) which are responsible for collecting patient's medical data (Blood pressure, pulse, oxygen saturation, etc.) and transmitting them to the connected Fog nodes. - The Fog nodes whose role is to apply local processing (Filtering, alerts in case of an emergency, etc.), and encrypt data before sending it to the Cloud server. - The Cloud server for data storage and access by authorized persons

**Contribution:**

In this paper we propose a new method of reducing the number of attributes used in CP-ABE, based on k-means clustering, in order to increase its performance. Our contributions can be summarized as follows:

* First we did experiments on constrained environments in order to determine the factors that impact the performance of ABE and to act on these factors.

* To the best of our knowledge, our study is the first to use vector model and k-means classification, which is widely used in other fields, to reduce the number of attributes in ABE.

* We will keep the main CP-ABE primitives and make the necessary changes to build and use meta-Attributes instead of initial set of attributes.

* We propose an additional primitive Minimize () which transforms the access structure into a minimized access tree. The latter will be used in encryption operations.

* We propose an optimized Fog deployment scenario of an e-health application where the different treatments will be assigned to the appropriate nodes for their execution.

**Paper organization:** The rest of this paper is organized as follows. Section 2 gives some background on Fog computing and healthcare applications, as well as ABE and k-means clustering while section 3 overviews related works. Section 4 gives some preliminaries. In section 5, we present the proposed MABE solution and system model. Sections 6 and 7 discuss Security and performance analysis of our scheme. Finally, Section 8 concludes the paper.

# 2 Background

## 2.1 Fog Computing

Fog computing is an extension of the cloud computing paradigm from the core to the edge of network [9]. It is a platform that provides compute, storage, and networking services between end devices and Cloud servers. So the Fog is an infrastructure composed of nodes at the edge of the network, each node must be able to perform processing locally, and act as a router for its neighbors, to convey the information to the end user, or to a remote cloud server. A typical Fog architecture consists of 3 layers (see Figure 1). Fog nodes provide localization, allowing low latency and context awareness, while the cloud provides global centralization.

<figure><img src="image_2.png" /><figcaption>**Fig. 1** Three-layer model for fog computing [10]</figcaption></figure>

Many applications require both localization and real time processing of the Fog, as well as the globalization and the long-term storage of the Cloud, especially in the field of e-health, which perfectly illustrates the complementarity between the two technologies.
## 2.2 E-health applications

E-health applications encompass digital tools and platforms designed to improve health care delivery, patient management, and medical research. A smart healthcare system consists mainly of a large number of wearable sensor devices which are responsible for the generation and collection of medical data of a patient. They also help health-care providers monitor patients continuously [11]. In e-health, fog computing enables real-time processing and analysis of data generated by IoT devices, wearable, and remote monitoring systems. However, ensuring secure data access control in this decentralized environment is challenging. In fact, when patient medical records are stored in cloud data centers through fog nodes, privacy issues occur because cloud servers are not completely trusted. In order to ensure data confidentiality and prevent unauthorized access in fog-based e-health applications, several solutions have been proposed, including:

* **Role-Based Access Control (RBAC):** In which access rights are assigned based on predefined roles (e.g., doctor, nurse, administrator). Each role has specific permissions.

* **Attribute-Based Access Control (ABAC):** Access rights are granted based on attributes such as user roles, patient identity, device types, or contextual information (e.g., time or location).

* **Context-Aware Access Control:** combines ABAC and RBAC with real-time contextual information, such as user location, device security status, or time of access.

* **Attribute-Based Encryption (ABE):** is a type of public-key encryption that enables fine-grained access control to encrypted data. In ABE, decryption depends on whether a user's attributes satisfy the encryption policy. For example, only users with specific roles (e.g., "Doctor" AND "Cardiology") can decrypt, making it suitable for systems with diverse users.

## 2.3 Attribute-Based Encryption

ABE is a public key encryption scheme first introduced in 2005 by Sahai and Waters [12] to allow expressive access policies and fine-grained access to encrypted data. ABE uses attributes to

define user access keys and policies. There are two main types of ABE systems: KP-ABE (Key Policy ABE) and CP-ABE (Ciphertext Policy ABE). In CP-ABE, the attributes that correspond to the characteristics of the user are linked to the user's private key. The data are encrypted using the access policy established by the data owner. Data decryption depends on the satisfaction of the access policy by the data user attributes' set. This is illustrated by the example in figure 2.

<figure><img src="image_3.png" /><figcaption>Fig. 2 Ciphertext-Policy Attribute-Based-Encryption [13]</figcaption></figure>

The scheme of CP-ABE consists of the following four functions [14]:

* Setup ($U$). It takes as input an attribute universe $U$. It initializes the system and generates the master key $MK$ and the public key $PK$.

* KeyGen ($PK, MK, ω$). It takes as input the public key $PK$, the master key $MK$ and a user's attribute set $ω$. It outputs a private key $SK$.

* Encryption ($PK, M, T$). It takes as input the public key $PK$, a message $M$ and an access-policy tree $T$. It will produce a ciphertext $CT$.

* Decryption ($SK, CT$). It takes as input a private key $SK$ and a ciphertext $CT$. It returns the plaintext $M$ if $ω$ satisfies $T$.

Because of its complexity and resourcefulness, the ABE scheme has left researchers skeptical about its implementation on small devices such as wireless sensors and RFID devices. Indeed, the Internet of Things interconnects devices with limited resources in terms of energy, storage and computing capacity. These limited devices are not
capable of performing the heavy operations of
ABE. Nevertheless, and given the added value
of ABE access control in IoT, and especially
with the appearance of Fog devices which offer
better processing and storage capacities, many
techniques and solutions are proposed to reduce
the costs of ABE operations, such as compute
offloading, compression, optimization of energy
consumption...Etc.

## 2.4 Vector Model and K-means Classification

The vector space model allows representation of
document as a vector. If a term occurs in the file,
its value in the vector is nonzero (generally tf-idf
weighting), otherwise is zero [15]. By analogy, we
use vector space model to represent attributes. If
an attribute describes a user its value in the vec-
tor is one, otherwise is zero. Data clustering is a
task of data mining that consists of partitioning a
collection of data sets into separated groups called
clusters in a way that maximizes the similarity of
the objects in each cluster. Euclidean distance and
cosine similarity are some metrics used to evaluate
similarity between objects in a cluster (see figure
3).

<figure><img src="image_4.png" /><figcaption>Fig. 3 K-means Data Clustering</figcaption></figure>

K-means is one of the most widely used algo-
rithms to produce automatically *k* clusters from a
collection of data sets in a simple way [16].

## 3 Related Work

Due to its effectiveness, many studies have been
conducted to adapt ABE to constrained environ-
ments, in particular for the protection of medical
data in Cloud/Fog systems. In this section, we give
an overview of the most relevant research related
to our work.

[17] focused on improving the efficiency of
ABE by leveraging the often-found hierarchy
relationships among the attributes. They gave
a hierarchical ABE (HABE) construction con-
sidering a tree hierarchy among the attributes.
In HABE, the universal attributes are classi-
fied into trees according to their relationship
defined in the access control system. [18] combined
CP-ABE with location-based encryption (LBE).
He proposed to make use of CP-ABE to han-
dle static attributes within an encryption policy,
while the principle of location-based encryption
is employed to derive a symmetric key from a
dynamic attribute, for example, a GPS position.
The approach practically combined an offline key
generation for static attributes with a lightweight
online key generation for dynamic attributes. [19]
outlined a novel extension to CP-ABE for pro-
tecting records (EHR) both on and off the cloud.
Their extensions allow for each authority to be
designated a subset of attributes and work inde-
pendently in creating user keys. [16] proposed an
efficient k-means (called sk-means) protocol that
aims to ensure total privacy protection under a
given security model without using any crypto-
graphic scheme. The proposed solution consists of
a secure implementation of the k-means algorithm
over horizontally portioned data and based on
Π-sum. [20] constructed a comparable attribute-
based encryption scheme (CABE) to judge the
users' access behaviors based on diverse relation-
ships between a user's and a file's attributes,
such as " =, <, > " Instead of " = " only.
CABE uses a unique way to generate and man-
age sub-attributes for comparable attributes. [21]
proposed a novel architecture ensuring security
and privacy for the outsourced health records.
The proposed model uses partially ordered set
(POSET) for constructing the group based access
structure. The modified group based CP-ABE
(G-CP-ABE) minimizes the computational over-
head by reducing the number of leaf nodes in the
access tree, and thus minimal bilinear pairings. In
order to improve the performance of cache in CP-
ABE [22] proposed an effective replacement algo-
rithm called Minimum Attributes Value (MAV)
algorithm, by counting the number of high fre-
quency attribute values. The attribute similarity
is calculated by using Cosine similarity method.
The file with the minimum attribute value is
replaced. In [23] authors proposed a lightweight
and privacy-preserving fog-assisted information
sharing scheme (PFHD) for health big data. They
designed a hierarchical ABE method by encrypt-
ing the profile and health data with different
access policies, and achieved lightweight encryp-
tion by offloading part of encryption cost from
edge devices to fog servers. While [24] proposed an
access control (CP-ABE) scheme supporting out-
sourcing capability and attribute update for fog
computing. The heavy computation of encryption
and decryption are outsourced to fog nodes, thus
the computation for data owners to encrypt and
data users to decrypt are irrelevant to the num-
ber of attributes in the access structure and secret
keys respectively. [25] presented a Light weight
Attribute Based Encryption Scheme (LABE) for
mobile cloud-assisted CPS (Cyber-Physical Sys-
tem). Encryption does not need pairing and the
decryption needs only one pairing. The high com-
putation load in CP-ABE is offloaded partly to the
cloud servers and then decreased. [26] presented
a scalable privacy-preserving clustering algorithm
and designed a modular approach for multi-party
clustering. Using an efficient batched Euclidean
squared distance computation protocol, hospitals
can cluster their patients into subgroups, then
predict behavior of each subgroup, and design
special medicine/treatment for each subgroup.
With aim to deal with the huge challenge for
resource-constrained data owners, [27] proposed
a highly secure privacy-preserving outsourced k-
means clustering scheme under multiple keys in
cloud computing, where data is classified without
exposing the sensitive information of data. In out-
sourced data clustering, the cloud classifies users'
data into groups according to their similarities.
The clustering is performed over the encrypted
data records without exposing data privacy. To
guarantee the privacy of sensitive information,
an OABE (Optimal Attribute-Based Encryption)
scheme over big data has been implemented by
[28]. Initially, input data are clustered using the
PFCM (probabilistic fuzzy c-means) algorithm.
For optimization, the proposed method utilizes
Rider Optimization Algorithm (ROA), and the
proposed scheme's outcome is evaluated through
clustering accuracy, error value, memory, and

time. While [29] proposed a blockchain-based CP-ABE scheme with partially hidden access structures (BCP-ABE-PHAS) where the ciphertext size is constant to achieve fine-grained access control while ensuring user privacy. In [30] authors propose a novel multi-authority CP-ABE scheme with reduced-size ciphertext (RMA-CPABE) to provide secure access in fog-enabled IoT applications, by shifting the ciphertext size dependency from the number of attributes used in policy to the number of authorities involved in access policy building. To reduce the burden of patients, [31] present a verifiable outsourced ABE scheme, in which edge servers are responsible for ABE encryption while fog nodes assist data users to perform the corresponding decryption. To protect the privacy of data owner, authors introduced the proxy re-encryption algorithms, which achieves dual access control for EMRs. The second ABE encryption is completely outsourced to the fog server, so that it can free the patient from encrypt calculations. To meet security demands, [32] proposed a remote patient monitoring system using energy-efficient IoT sensors, where an effective trust mechanism based on CP-ABE and KP-ABE is established to attain better results in terms of the number of alive nodes, energy left, and throughput. In the same perspective [33] proposed privacy-preserving model for E-health monitoring through patient data forwarding during normal, emergency, and critical cases. The proposed system adopts the artificial bee colony approach for the evolution of information collected from the patient's sensors for a precautionary medication process. In [10] authors propose a Multi-Authority Attribute-based Broadcast Encryption (MA-ABBE) scheme to break through the limitations of CP-ABE when implemented in a fog computing environment. With CP-ABBE, data owners can specify a broadcast set and define a flexible access policy when encrypting a message, while Multiple authorities jointly manage attribute distribution. For his part, and since the encryption computational overhead is proportional to the number of attributes in the access policy, [34] proposes an optimization approach for CP-ABE via the flexible integration of access policies with multiple shared sub-policies to improve its efficiency. [35] proposes a novel revocable CP-ABE scheme suitable for IoT scenarios. It targets
multiple attribute authorities, outsourced encryption and decryption, user revocation, and asymmetric pairings to achieve recommended security levels.

## 3.1 Comparison of Related Work

Table 1 provides a comparative analysis of related works. The comparison is made based on the following criteria:

* **Environment:** The computational environment or system in which the encryption method is implemented, such as general cloud, IoT, Fog...etc.

* **Encryption Method Used:** The type of encryption scheme employed, with an emphasis on the specific ABE variant.

* **Attributes' Optimization:** How the scheme handles the attributes in order to reduce access policy and decrease computational cost.

* **Outsourcing:** Whether the encryption or decryption tasks are outsourced to external entities, such as proxies, fog nodes or cloud servers.

We can see that several works focused on minimizing bilinear pairings to reduce the computational overhead [18] [21] [29] [30]. This poses the problem of the efficiency of the resulting algorithm. Our approach is to act upstream by reducing the number of attributes, without altering the basic operations of CP-ABE.

Other studies have attempted to minimize the number of attributes by using comparison, hierarchy or selection (by elimination) [17] [20] [22] [23] [10] [34]. Our approach is based on classification (by clustering) to avoid loss of information, as long as all attributes are considered in the encryption process.

Some studies have performed outsourced re-encryption using additional proxies to offload constrained devices [23] [24] [25] [31] [35]. This leads to the expansion of the network and the multiplication of nodes, which further exposes the confidentiality of partially encrypted data. Our solution does not require extra nodes in the system, nor additional data transfer which will increase traffic and harm security.

On the other hand, in most of the works that use the Euclidean distance clustering ([16] [26] [27] [28]), similarity calculation is applied to

the patient's medical information (data owners), which raises the problem of privacy-preservation. In our approach we precede to the classification of the user's attributes (data users), which protects the confidentiality of patients' personal and medical data.

# 4 Preliminaries

## 4.1 Bilinear Maps

Let $G_0$ and $G_1$ be two cyclic groups of prime order $p$ and $g$ is a generator of $G_0$. A bilinear map is a map $e: G_0 \times G_0 \to G_1$ with the following properties [36]:

* **Bilinear:** $\forall u, v \in G_0$ and $x, y \in Z_p$, we have $e(u^x, v^y) = e(u, v)^{xy}$.

* **Non-degenerate:** $\exists u, v \in G_0$ such that $e(u, v) \neq 1$

* **Computable:** There is an efficient algorithm to compute $e(u, v)$ for any $u, v \in G_0$

## 4.2 Access Structure

Let $P_1, P_2, ..., P_n$ be a set of parties. A collection $A \subseteq \{P_1, P_2, ..., P_n\}$ is monotone if $\forall B, C$: if $B \in A$ and $B \subseteq C$ then $C \in A$.

An access structure is a collection $A$ of nonempty subsets of $\{P_1, P_2, ..., P_n\}$, i.e., $A \subseteq \{P_1, P_2, ..., P_n\} \setminus \{\emptyset\}$

The sets in $A$ are called authorized sets, and sets not in $A$ are called unauthorized sets [37].

## 4.3 Access Tree

Let $T$ be a tree representing an access structure. Each non-leaf node $x$ of the tree represents a threshold operator described by the number of its children $num_x$ and a threshold value $k_x$ with $1 \le k_x \le num_x$. When $k_x = 1$, the threshold is an OR operator, and when $k_x = num_x$, it is an AND operator. While each leaf node $x$ represents an attribute with a threshold value $k_x = 1$ [37].

The following functions are defined to facilitate the handling of access trees.

* $parent(x)$: represents the parent of the node $x$ in the tree.

* $att(x)$: represents the attribute associated with the leaf node $x$.

* $index(x)$: represents the order of the node $x$ among other nodes of the same parent.
<table><caption>**Table 1** Comparison of Related Work</caption><thead><tr><th>Work</th><th>Environment</th><th>Encryption</th><th>Attributes' Optimization</th><th>Outsourcing</th></tr></thead><tbody><tr><td>[17]</td><td>General</td><td>Hierarchical ABE (HABE)</td><td>Tree hierarchy to classify attributes</td><td>×</td></tr><tr><td>[18]</td><td>General</td><td>CP-ABE with Location-Based Encryption (LBE)</td><td>Static attributes with location-based dynamic key</td><td>Partial</td></tr><tr><td>[20]</td><td>Cloud</td><td>Comparable Attribute-Based Encryption (CABE)</td><td>Sub-attributes for comparable attributes</td><td>×</td></tr><tr><td>[21]</td><td>Cloud</td><td>G-CP-ABE (Group-based CP-ABE)</td><td>Reducing the number of leaf nodes</td><td>×</td></tr><tr><td>[22]</td><td>General</td><td>CP-ABE</td><td>Minimum Attributes Value (MAV)</td><td>×</td></tr><tr><td>[23]</td><td>Fog</td><td>Hierarchical ABE</td><td>Lightweight encryption by splitting access policies</td><td>Partial (Health data encryption)</td></tr><tr><td>[24]</td><td>Fog</td><td>CP-ABE</td><td>×</td><td>Encryption and decryption</td></tr><tr><td>[25]</td><td>Mobile Cloud</td><td>Lightweight ABE (LABE)</td><td>×</td><td>Partial (encryption to cloud)</td></tr><tr><td>[29]</td><td>IPFS (Inter-Planetary File System)</td><td>Blockchain-based CP-ABE with partially hidden access policy</td><td>×</td><td>×</td></tr><tr><td>[30]</td><td>Fog</td><td>Multi-Authority CP-ABE</td><td>×</td><td>×</td></tr><tr><td>[31]</td><td>Fog</td><td>Verifiable Outsourced ABE</td><td>×</td><td>Encryption and decryption</td></tr><tr><td>[10]</td><td>Fog</td><td>Multi-Authority Attribute-Based Broadcast Encryption (MA-ABBE)</td><td>Attributes distribution to multiple authorities</td><td>×</td></tr><tr><td>[34]</td><td>Cloud</td><td>CP-ABE</td><td>Multiple shared sub-policies</td><td>×</td></tr><tr><td>[35]</td><td>IoT</td><td>Revocable CP-ABE</td><td>×</td><td>Encryption and decryption</td></tr><tr><td>Ours</td><td>IoT-Fog-Cloud</td><td>Meta-Attributes Based Encryption (MABE)</td><td>Replacement of attributes with Meta-Attributes</td><td>×</td></tr></tbody></table>

Let $T$ be an access tree with root $R$ and $T_x$ be the sub-tree of $T$ rooted by the node $x$. If a set of attributes $\omega$ satisfies the access tree $T_x$, we denote it as $T_x(\omega) = 1$. We calculate $T_x(\omega)$ recursively as follows. If $x$ is a non-leaf node, we evaluate $T_y(\omega)$ for each child $y$ of node $x$. $T_x(\omega)$ returns 1 if and only if at least $k_x$ children return 1. If $x$ is a leaf node, then $T_x(\omega)$ returns 1 if and only if $att(x) \in \omega$.

All these notions will be used in the encryption functions of our proposed system model.

# 5 Proposed approach

In this section, we present in details our Meta-Attributes Based Encryption proposed solution. The main notations used in this section are shown in table 2.

## 5.1 System Overview

As a motivation scenario, we propose a disease home monitoring application based on Fog architecture. Indeed, patients home monitoring is the
<table><caption>**Table 2** Notations</caption><thead><tr><th>Notation</th><th>Description</th></tr></thead><tbody><tr><td>AA</td><td>Attribute Authority</td></tr><tr><td>PK, MK, SK</td><td>Public, Master and Secret key resp.</td></tr><tr><td>M</td><td>Message to encrypt</td></tr><tr><td>CT</td><td>Ciphertext</td></tr><tr><td>M<sub>UA</sub></td><td>Matrix of Users/Attributes</td></tr><tr><td>A<sub>i</sub></td><td>i-th Attribute</td></tr><tr><td>U<sub>k</sub></td><td>k-th User</td></tr><tr><td>U<sub>ki</sub></td><td>k-th element in i-th Attribute vector</td></tr><tr><td>U</td><td>Total number of attributes (Attributes' Universe)</td></tr><tr><td>n</td><td>Total number of users</td></tr><tr><td>MA</td><td>Meta-Attribute</td></tr><tr><td>T<sub>MA</sub></td><td>Table of Meta-Attributes</td></tr><tr><td>k</td><td>Number of clusters in k-means algorithm</td></tr><tr><td>T, T'</td><td>Access Tree, Minimized Access Tree resp.</td></tr><tr><td>N</td><td>AND Node in Access Tree</td></tr><tr><td>x<sub>i</sub></td><td>Leaf node i in Access Tree</td></tr><tr><td>ω</td><td>User's attributes set</td></tr><tr><td>ω'</td><td>New User's attributes set (including meta-attributes)</td></tr></tbody></table>

kind of applications that simultaneously require a rapid response in case of emergency, and medical data sharing between experts and analysts, especially in case of a pandemic. The use of Fog architecture is ideal for meeting both of these needs. Figure 4 illustrates our Patient's Home Monitoring System Architecture.

<figure><img src="image_5.png" /><figcaption>**Fig. 4** Proposed System Overview</figcaption></figure>

Our system works as follows: (1) The patient is registered at the medical center by providing his personal information and the characteristics

of the individuals authorized to access his medical data. (2) The attribute authority provides him with his public encryption key as well as the access policy which will be stored on his Fog device. (3) The sensors installed on the patient collect information about his physical signals (temperature, blood pressure, oxygen saturation, etc.) and transmit them to the Fog node, the latter, after having processed and analyzed the data, is responsible for activating the oxygen concentrator or any other medical device if necessary, warning the patient or his family if there is an anomaly, or alerting the medical staff in case of emergency. (4) Finally, the Fog device encrypts the data using the public key and the access policy before saving it to the cloud.

(5) On the other side, the data user registers at the medical center by providing his information. (6) The attribute authority sends him his private decryption key containing his attributes. (7) The data user requests access to patient medical data from the Cloud. (8) The Cloud sends him the encrypted data which he tries to decrypt with his private key. If the user's attributes match the access policy, he could decrypt and view the data otherwise he will be denied access.

## 5.2 Assumptions

In our proposed solution we assume that:

* The attribute authority is fully trusted. It is located in a secure environment at the medical center or health organization, which means that it would not leak data.

* The IoT sensors and data owner device (fog node) are within the same local network (patient's home), and that the communications between them are secure using network security mechanisms.

* The communication between the attribute authority and users' (both data owner and user) devices, mainly for keys distribution, is protected via communication security protocols.

Assuming that, we focus on securing patient's medical data transmitted and stored on Cloud servers, considered as semi-trusted entity.

## 5.3 Meta-Attribute concept

As previously stated MABE is based on access policy reduction by replacing a set of attributes with a meta-attribute that infers them. The data are
<figure><img src="image_6.png" /><figcaption>Fig. 5 Meta-Attributes Based Encryption</figcaption></figure>

encrypted using the minimized access tree. Data decryption depends on the satisfaction of this minimized access policy by the data user attributes' set. This is illustrated by the example in figure 5.

A meta-attribute is a set of attributes that often appear together and therefore potentially describe the same user. We use vector model similarity computation and k-means clustering to construct the meta-attributes as follows:

* Each attribute is given a vector representation (see figure 6) $A_i = \{U_{1i}, ..., U_{ni}\}$, in which dimensions of the vector representing an attribute are the users it describes ($U_{ki} = 1$ if the attribute $A_i$ describes the user $U_k$, 0 otherwise). Then we proceed to similarity (distance) calculation between attributes using cosine formula that calculates the cosine 1 of angle between their respective vector ($n$ being the number of users).

$$ \cos(A_i, A_j) = \frac{\sum_{n} (U_{ni} * U_{nj})}{\sqrt{\sum_{n} U_{ni}^2} * \sqrt{\sum_{n} U_{nj}^2}} \quad (1) $$

* Once cosines calculated, we proceed to Attributes' classification using k-means technique. Our k-means clustering algorithm follows below steps:

1. Select the number $k$ to decide the number of clusters. $k$ depends on the universe of attributes: The more attributes there are, the greater is $k$.

2. Select $k$ attributes as centroids. In our case we chose attributes that have two properties: They appear most often in the users' profiles, and they have the smallest value of similarity (cosine) between them.

3. Assign each attribute point to their closest (most similar) centroid, which will form the predefined $k$ clusters.

4. Repeat: Calculate the variance and place a new centroid of each cluster, and reassign each attribute to the new closest centroid of each cluster (same as step3), until clusters centers do not change.

5. Return attributes' clusters.

<figure><img src="image_7.png" /><figcaption>Fig. 6 Meta-Attributes construction</figcaption></figure>
We use the obtained clusters to build the meta-attributes table (Figure 6), where each entry is composed of the meta-attribute name, its cardinality and the attributes that constitute it. The resulting meta-attributes table will be used to reduce the access policy.

## 5.4 Access Policy reduction

In order to minimize the access policy our inference mechanism will proceed as follows: For each AND node in the original access tree we will detect the attributes that belong to the same meta-attribute, and if the number of these attributes equals the cardinality of the meta-attribute we will replace this subset of attributes (and not the entire node) by the corresponding meta-attribute in order to reduce the size (in terms of number of elements) of the node without altering its content. By applying this mechanism to all the AND nodes of the access tree we will reduce the access policy without modifying its structure. The example in Figure 7 illustrates the principle of reducing the access policy.

In this example, our inference mechanism allows us to move from an access policy with length = 6 to a minimized access policy with length = 4 while preserving the consistency of the original expression.

## 5.5 System Model

Our approach is to keep the four original functions of CP-ABE, while making the necessary modifications relating to the support of meta-attributes, and to add a fifth Minimize() primitive in order to reduce the access tree. As shown by figure 8 and presented in our System Overview, the proposed model consists of four entities: Data Owner, Data User, trusted Attribute Authority, and semi trusted Cloud storage service.

Our construction extends the SETUP and KEYGEN functions of the CP-ABE model to enable the support of meta-attributes. The following section provides a detailed construction of the proposed MABE scheme and outlines the extensions to each function.

* Setup($M_{UA}$) → (PK, MK, $T_{MA}$): The setup algorithm is performed by the attribute authority AA. It takes the Users -Attributes Matrix ($M_{UA}$) as input and outputs the Public Key ($PK$), the Master Secret Key (MK) and the Meta-Attributes Table ($T_{MA}$). Unlike the classical Setup primitive which admits as input the universe of attributes, in our case the input argument is the Users -Attributes Matrix which will be used to build the meta-attributes as explained in section 5.3.

We then use classical functions of CP-ABE Setup algorithm to generate public key and master key as follows:

1. Choose a bilinear group $G_0$ of prime order $p$ and generator $g$.

2. Select two random elements $\alpha, \beta$ in $Z_p$.

3. $PK = \{G_0, g, h = g^\beta, e(g, g)^\alpha\}$ $MK = \{g^\alpha, \beta\}$

* KeyGen($PK, MK, \omega, T_{MA}$) → (SK): The key generation algorithm is performed by the attribute authority AA. It takes as input the public and master keys, the data user attribute set $\omega$, and the Meta-Attributes table, and outputs secret key SK. This function allows generating the users' private key, not by directly using the set of attributes as is usually done, but by first converting it into a set of meta-attributes. This conversion is presented in Algorithm 1:

**Algorithm 1** User's attributes conversion into meta-attributes

1: **for** (each attribute $A_i$ from $\omega$) **do**

2: Find in $T_{MA}$ the meta-attribute $MA_i$ where it belongs

3: Search in $\omega$ for attributes which belong to the same meta-attribute $MA_i$

4: **if** (the number of attributes found = $MA_i$ cardinal) **then**

5: Add the meta-attribute $MA_i$ to $\omega$

6: **end if**

7: **end for**

8: Return the new set of attributes $\omega'$

We finally use the new set of attributes $\omega'$ to generate the secret key as follows:

1. Choose a random $r \in Z_p$ and a random $u \in Z_p$

2. $SK = \{D = g^{\frac{(\alpha + r)}{\beta}}, \forall j \in \omega' : D_j = g^r * H(j)^u, D'_j = g^u\}$
<figure><img src="image_8.png" /><figcaption>Fig. 7 MABE access policy reduction</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Fig. 8 MABE System Entities and functions</figcaption></figure>

*   **Minimize(T, T<sub>MA</sub>) → (T')**: The Minimize algorithm is run by the attribute authority AA. It takes as input the access tree *T* (submitted by the data owner during his subscription) and the Meta-Attributes table *T<sub>MA</sub>*<sub>?</sub>, and outputs the minimized access tree *T'*<sub>?</sub>. The access structure transformation is done following steps in algorithm 2:

**Algorithm 2 Access Policy Minimization**

1: **for** (each AND node *N* in *T*) **do**

2: Find all leaf nodes $x_i$ in $N$ that belong to the same meta-attribute $MA_i$

3: **if** (the number of attributes found = $MA_i$ cardinal) **then**

4: Replace all the leaf nodes $x_i$ by $MA_i$

5: **end if**

6: **end for**

7: Return the new access tree $T'$

The thus minimized access tree will be used in
the encryption operation instead of the original
access tree.

*   **Encrypt**(*M*, *PK*, *T') → (CT)*: This algorithm is performed by the data owner using a constrained Fog device. It is similar to CP-ABE Encrypt algorithm but uses the minimized access tree. It takes as input a message to encrypt *M*, the public key *PK* and the access tree *T'*, and outputs the encrypted message or ciphertext *CT*. The Encrypt algorithm follows usual CP-ABE steps namely:

1. Choose a random $s \in Z_p$

2. Choose a polynomial $q_x$ for each node $x$ in the tree $T$ from top to bottom, such that:

- $q_R(0) = s$ ($R$ is the root node). And choose other points randomly to completely define the polynomial $q_R$.

- For each node $x$ in the tree, set the degree $d_x$ of the polynomial $q_x$ to $d_x = k_x - 1$ ($k_x$ is the threshold value of the node $x$)

- Set $q_x(0) = q_{parent(x)}(index(x))$. And choose other points randomly to completely define the polynomial $q_x$.

3. Finally, consider the set of leaf nodes $Y$ in the access tree $T'$, the ciphertext $CT$ is calculated:

$$
\begin{align*}
CT &= \{T', \tilde{C} = Me(g, g)^{\alpha s}, C = \\
   &h^s, \forall y \in Y : C_y = g^{q_y(0)}, C'_y = \\
   &H(att(y))^{q_y(o)}\}
\end{align*}
$$

*   **Decrypt**(*CT*, *SK*) → (*M*): This algorithm is performed by the data user. It takes as input the ciphertext *CT*, which contains an access policy *T'*, and a private secret key *SK*, associated with a set *ω* of user's attributes. If *ω* satisfies *T'* then
the algorithm will decrypt the ciphertext and
return the message M. The decrypt algorithm
is a recursive function performed from bottom
to top as follows:

For each node *x* in the access tree *T'* do

1. If *x* is a leaf node associated with attribute *i* then

- If $i \notin \omega'$ then return null

- If $i \in \omega'$ then $F_x = \text{DecryptNode}(x) = e(g, g)^{r.q_i(0)}$

2. If *x* is NOT a leaf node then For all nodes *z* that are children of *x* do

- Perform $F_z = \text{DecryptNode}(z)$

- Let $S_x$ be an arbitrary $k_x$ sized set of child nodes $z$ such that $F_z$ is not null

- If the set does not exist then return null
  (node not satisfied)

- If not then calculate $F_x = \prod_{z \in S_x} F_z^{\Delta_i S_x^{(0)}} = e(g, g)^{r.q_x^{(0)}}$

The decrypt algorithm begins by calling the function DecryptNode(R) (on the root node R of the tree T'). If the tree is satisfied by the attributes set ω' the function returns M, otherwise it returns null.

After presenting the proposed system model,
we will analyze the security, the scalability, and
discuss the performance of our solution in the
following.

6 Security and Scalability
Analysis

Because our MABE can be viewed as an extension
of ordinary CP-ABE scheme (keygen, encrypt and
decrypt algorithms used in our extended MABE
scheme remain the same as presented in original
CP-ABE, only the input changes), MABE also has
CP-ABE's security properties, namely:

*   **Data confidentiality:** Confidentiality requires that the Cloud service, Attribute authority, and the unauthorized users cannot decrypt the medical data. In our solution clustering operation (carried out by AA machine) is performed on data users' attributes and not on patients' medical data. Medical information is kept in data owner device, it is encrypted near its source

in the local network and safely transported
for storage in the cloud. Therefore, no indi-
vidual could access the content of the medical
data stored there, except authorized users with
appropriate characteristics.

*   **Collusion Attack Resistance:** User resistance to collusion means that the users cannot collude their keys to illegally access data. Our system is secure against the collusion attack because each user secret key is generated using a secret random element (the $u \in Z_p$ in KeyGen function 5.5). Therefore, even if two users combine their attributes to match the access structure of the requested ciphertext, they have different $u$ values in their secret keys, thereby different users could not combine their attributes to obtain unauthorized data access rights.

*   **User revocation:** Revocation of a user has no impact on the reliability of our solution since it does not alter the similarity relationships between the attributes, on which our approach is based. Therefore, it can be treated either by integrating a revocation list or a broadcast set [10], or by adding a revocation/validity attribute in the access policy [19]. As long as adding a single attribute does not have a significant impact on encryption performance. In both cases, there is no need to re-encrypt the data to achieve the revocation.

*   **Access policy change:** Just like revoking a user, modifying the access policy does not affect our clustering solution, as long as it does not modify the proximity relationships between attributes. If a data owner changes their data access policy, only the minimization function will be executed by the Attribute authority, and the new reduced access policy will be sent to the concerned user.

*   **User's Attributes change:** Attributes change will not affect encryption reliability, but may impact clustering consistency and therefore performance. For this, regular updating of the meta-attributes table is necessary in the case of frequent attribute changes. Our solution is based on a change counter and an update threshold.

When a user modifies their attributes (or the
arrival of a new user) the attribute authority
will execute the KeyGen function to generate
and send them their new secret key, then incre-
ment the change counter. If the counter reaches
or exceeds the update threshold, the AA will
update the meta-attribute table by restarting
the clustering operation, and resend the access
policies as well as the secret keys only to users
affected by the changes.

System performance closely depends on the
choice of the update threshold: a small value
of threshold forces the Attribute Authority to
frequently refresh meta-attribute table and con-
sequently increase the overall system overhead.
A large threshold value allows us to minimize
the number of updates, and thus avoid system
overload and maintain a satisfactory level of
performance.

* **Scalability:** Scalability in fog computing is a critical feature. In our solution, and in order to adapt MABE to larger multi-layers fog environments, we propose to perform the setup and clustering functions at the highest central attribute authority, where the entire universe of attributes is located. This entity is responsible for building the meta-attribute table and transmitting it to lower-level authorities that are close to the end users and that are responsible for reducing the access policy for data owners, as well as generating secret keys for data users, registered at their level (in their geographical area), as illustrated by figure 9.

<figure><img src="image_10.png" /><figcaption>Fig. 9 MABE’s Scalability</figcaption></figure>

Thus, users communicate only with nearby enti-
ties, which in turn interact with centralized
entities in a hierarchical manner, which avoids
overloading the network and ensures better
security of the exchanged data.

7 Performance analysis and
comparison

In this section, we analyze the efficiency of our
solution and compare it with other similar schemes
in theoretical and experimental aspects. We are
interested in the computation cost of the encryp-
tion and decryption operations because they are
performed by a constrained device on the data
owner and data users side respectively, and they
are the main source of overhead in CP-ABE. All
other operations (including clustering and access
policy minimizing) take place in environments
with more capacity.

## 7.1 Theoretical analysis

In this part, we use the following notations:

• $E_0, E_1$: Exponentiation in $G_0, G_1$ respectively.

• $P$: Pairing operation.

• $|S|$: Number of nodes satisfying the access structure.

• $L_o, L_m$: Number of attributes in original and minimized access policy respectively.

• $L_p, L_h$: Number of profile and health attributes respectively in access policy.

• $L_r, L_f$: Number of real and false attributes respectively in access policy.

• $L_u$: Number of attributes associated with a user's secret key.

Table 3 and table 4 provide a comparison of the encryption and decryption cost between our proposed scheme and the schemes referenced in [24] and [23], as well as original CP-ABE scheme [12]. We note that multiplication operations are significantly less computationally expensive than exponentiation ones. Thus, our comparison is based on the number of exponential and pairing operations.

In traditional CP-ABE algorithm (table 3), the encryption algorithm requires $3L_o+1$ exponentiation operations in $G_0$ and only one in $G_1$, whereas the computation time of encryption in [23] and our MABE is respectively $3L_p+1$ and $3L_m+1$ exponentiations in $G_0$ and 1 in $G_1$. As both $L_p$
<table><caption>**Table 3** Encryption Computation Cost comparison</caption><thead><tr><th>Scheme</th><th>Encryption at Data owner</th><th>Re-encryption</th></tr></thead><tbody><tr><td>CP-ABE [12]</td><td>(3L<sub>0</sub> + 1)E<sub>0</sub> + 1E<sub>1</sub></td><td>x</td></tr><tr><td>Zhang et al [24]</td><td>4E<sub>0</sub> + 2E<sub>1</sub></td><td>(L<sub>0</sub> + 2)E<sub>1</sub></td></tr><tr><td>Tang et al [23]</td><td>(3L<sub>p</sub> + 1)E<sub>0</sub> + 1E<sub>1</sub></td><td>(3L<sub>h</sub> + 1)E<sub>0</sub> + 1E<sub>1</sub></td></tr><tr><td>Our MABE</td><td>(3L<sub>m</sub> + 1)E<sub>0</sub> + 1E<sub>1</sub></td><td>x</td></tr></tbody></table>

and $L_m$ are smaller than $L_o$, the encryption time for both schemes is less than original CP-ABE one (at data owner side). While the encryption time is even smaller in [24] since it does not increase with the number of attributes (only the symmetric key is encrypted at data owner side) and requires 4 exponentiations in $G_0$ and 2 in $G_1$. However, the re-encryption operation in [24] is the most computationally expensive since it involves all the attributes and requires $L_o + 2$ exponentiations in $G_0$. followed by [23] scheme which only involves health attributes and requires $3L_h + 1$ exponentiations in $G_0$ and only one in $G_1$. While our MABE and original CP-ABE schemes do not use re-encryption.

<table><caption>**Table 4** Decryption Computation Cost comparison</caption><thead><tr><th>Scheme</th><th>Decryption at Data user</th><th>Proxy Decryption</th></tr></thead><tbody><tr><td>CP-ABE [12]</td><td>(2L<sub>u</sub> + 1)P + (L<sub>u</sub> + 2|S|)E<sub>1</sub></td><td>x</td></tr><tr><td>Zhang et al [24]</td><td>1P + 2E<sub>1</sub></td><td>(L<sub>u</sub> + 2)P + (2|S| + 2)E<sub>1</sub></td></tr><tr><td>Tang et al [23]</td><td>(2L<sub>u</sub> + 1)P + L<sub>u</sub>E<sub>1</sub></td><td>(2|L<sub>h</sub>|)E<sub>1</sub></td></tr><tr><td>Our MABE</td><td>(2L<sub>u</sub> + 1)P + (L<sub>u</sub> + 2|S|)E<sub>1</sub></td><td>x</td></tr></tbody></table>

From table 4 we can notice that at the end user level, [24] scheme depends neither on the number of attributes in the private key, nor the number of leaf nodes in the access policy (contained in the ciphertext), and involves only 2 exponentiations in $G_1$ plus 1 pairing. However, the most expensive computation cost has been outsourced to intermedial proxy (Fog node with more capacity), which significantly increases its overall execution time by $L_u + 2$ pairings and $2|S| + 2$ exponentiations in $G_1$. For its part, [23] scheme depends only on the data user attributes number and involves $2L_u + 1$ pairings and $L_u$ exponentiations in $G_1$. But it

performs health attributes decryption (before re-encryption) in the fog server, which also increases its global computation cost by $(2|L_h|)E_1$. While traditional CP-ABE and our MABE execute the full ABE algorithm at the end-user level, which requires $2L_u + 1$ pairings and $L_u + 2|S|$ exponentiations in $G_1$. Since the decryption time depends on the number of leaf nodes in the access tree. Reducing leaf nodes (by our solution) provide gain in overall decryption computation time.

## 7.2 Experimental Setup and Parameters

To validate the theoretical analysis and evaluate the performance of our proposed MABE model, we proceed to the experimental analysis of our solution. We considered an e-health application system (see System Overview in section 5) including a Java CP-ABE implementation 3 extended by our additional functions. The clustering and access policy reduction were carried out on Ubuntu18.04 (64 bits), with 8 GB memory and i5-8400 CPU 2.8GHz. We tested encryption operation on a Raspberry Pi Zero (1GHz single-core CPU, 512MB RAM) which acts as a data owner edge device. For decryption, we used a Samsung S3 Smartphone (1GHz ST Ericsson U8420 CPU, 1,4 GB RAM) as a data user device (see table 5).

<table><caption>**Table 5** Experimental Setup</caption><thead><tr><th>Device</th><th>Configuration</th><th>Functions</th></tr></thead><tbody><tr><td>HP Laptop</td><td>- Ubuntu18.04<br>- 8 GB RAM<br>- 2.8GHz CPU<br>- 5GHz IEEE 802.11ac WiFi</td><td>Setup + Keygen (Attribute Authority)</td></tr><tr><td>Raspberry Pi Zero</td><td>- Raspian<br>- 512 MB RAM<br>- 1GHz CPU<br>- 2.4GHz IEEE 802.11b/g/n WiFi</td><td>Encryption (Data Owner)</td></tr><tr><td>Samsung S3 Smartphone</td><td>- Android<br>- 1.4 GB RAM<br>- 1GHz CPU<br>- 2.4+5GHz IEEE 802.11a/b/g/n WiFi</td><td>Decryption (Data User)</td></tr></tbody></table>

<footnote n="3">³https://github.com/junwei-wang/cpabe/</footnote>
Before measuring the performance of the encryption and decryption operations of our solution, we first carried out tests to fix the parameters used in our experiment, namely: Input data size, number of clusters, and access policy content.

### 7.2.1 Input data size

In order to evaluate the impact of input data size on the encryption performance, and determine the optimal size of data to be encrypted, we carried out an experiment where we set the size of access policy to an average value of 10 attributes, varied the input file size from 1KB to 50MB and calculated the encryption time. The results are presented in Figure 10.

<figure><img src="image_11.png" /><figcaption>Fig. 10 MABE encryption time under various data size</figcaption></figure>

We can notice that small and medium-sized input data (from 1 to 100 KB) do not have significant impact on encryption performance. However, from 500 KB the encryption time starts to increase linearly and considerably with the data size. Therefore, in our following experiment, we gathered the medical data into 100 KB files and used them as input to the encryption operation, because choosing a higher value of data size will increase the encryption time, while a lower value increases the frequency (number of times) of the encryption operation.

### 7.2.2 Number of clusters

In addition, we took advantage of the experimentation carried out to determine what is the best

value of *k* (the number of clusters in classification algorithm). For this, we tested three versions of MABE, one with a value of *k* = 1/2 *U* (*U* is the total number of attributes), the other with *k* = 1/3 *U*, and the last one with a value of *k* = 1/4 *U*, in order to see which of the three produces the best results. We first compared the performance of the three versions in access policy reduction (Table 6). We then varied the access tree size (from 10 to 50 attributes) and measured the encryption time of each version and compared the results (Figure 11).

<table><caption>Table 6 The value of k effect on access policy reduction</caption><thead><tr><td>Value of k</td><td>Reduced Access Tree Size (% of Original Access Tree Size)</td></tr></thead><tbody><tr><td>1/4 of U</td><td>79%</td></tr><tr><td>1/3 of U</td><td>71%</td></tr><tr><td>1/2 of U</td><td>66%</td></tr></tbody></table>

<figure><img src="image_12.png" /><figcaption>Fig. 11 MABE encryption time under various k value</figcaption></figure>

According to table 6 and figure 11, we can observe that MABE with *k* = 1/2 *U* presents better results than the other two versions. This is due to the fact that the more clusters (which represent the meta-attributes) we have, the fewer elements we have in each cluster. And therefore, the fewer components a meta-attribute contains, the greater the probability that it appears in the access tree, and consequently the more the access policy is minimized, which impacts positively the encryption cost. On the other hand, choosing a
value greater than $1/2 U$ will produce many clusters with only one element (the centroid), which is useless in reducing the access policy (replacing one attribute element by one meta-attribute element in the access tree has no impact on the size and therefore on performance). In the following we will consider the best version of MABE (with $k = 1/2 U$) in the comparative analysis.

### 7.2.3 Access policy content

In order to determine the impact of access policy content on reduction rate of the latter, we applied the minimization function ( with the same meta-attributes' table) on access policies of the same size with different content. The results are presented in Table 7.

<table><caption>**Table 7** Impact of access policy content on reduction rate</caption><thead><tr><th>Access policy</th><th>Size</th><th>Reduced Access Tree Size (% of Original Access Tree Size)</th></tr></thead><tbody><tr><td>Policy 1</td><td>25</td><td>95%</td></tr><tr><td>Policy 2</td><td>25</td><td>86%</td></tr><tr><td>Policy 3</td><td>25</td><td>79%</td></tr><tr><td>Policy 4</td><td>50</td><td>83%</td></tr><tr><td>Policy 5</td><td>50</td><td>67%</td></tr><tr><td>Policy 6</td><td>50</td><td>50%</td></tr></tbody></table>

It should be noted that the performance of MABE does not only depend on the size of access policy but also on its content, and the probability of containing meta-attributes. Consider for example a meta-attributes table containing two elements $MA_1 = \{Grade:Doctor, Speciality:Radiology\}$ and $MA_2 = \{Speciality:Cardiology, Organism:Hospital Delta\}$, and having two access policies of the same size $T_1 = \{(Doctor AND Radiology AND Hospital Delta) OR (Professor AND Cardiology AND Country Alpha)\}$ and $T_2 = \{(Doctor AND Radiology AND Country Beta) OR (Doctor AND Cardiology AND Hospital Delta)\}$. Applying our minimization function to $T_1$ and $T_2$, we obtain respectively the two minimized access trees $T'_1 = \{(MA_1 AND Hospital Delta) OR ((Professor AND Cardiology AND Country Alpha)\}$ and $T'_2 = \{(MA_1 AND Country Beta) OR (Doctor AND MA_2)\}$. Thereby, the reduction rate is 83% (5 of 6) for $T_1$ and 66% (4 of 6) for $T_2$. Which

means that for different access policies of the same size, the reduction rate can vary depending on the attributes in the AND nodes. Indeed, the principle of our solution is to eliminate redundancies in the access tree based on the most similar attributes. And the fact of having opted for similarity relationships (co-occurrence) in the grouping of attributes into meta-attributes increases the probability of finding them in the access policy, and consequently increases the minimization rate of the latter.

Considering the results obtained from the previous tests, we set the experiment parameters as follows:

* We gathered the medical data into files of 100 KB size (which will serve as input to the encryption operations).

* We performed the classification of the attributes with a number of clusters equal to half the total number of attributes.

* We performed each test on 10 access policies of different content and measured the average value of ciphertext size, as well as encryption and decryption time.

## 7.3 Experimental Analysis

### 7.3.1 Ciphertext size

We first compare the ciphertext size obtained by our solution with those of original CP-ABE [12] and PFHD [23] schemes.

<figure><img src="image_13.png" /><figcaption>**Fig. 12** Ciphertext size Comparison</figcaption></figure>
From figure 12 we can observe that for a small attributes' number (10) our solution's ciphertext size is slightly higher than that of the other two schemes. But it becomes equal to that of CP-ABE for 15 attributes, and to that of PFHD at 25 attributes. We notice that from 30 attributes our solution presents the best (smallest) ciphertext size. This is precisely due to the reduction in the size of the access policy. This reduction not only allows a considerable gain in storage space for encrypted data on the data owner's device, but also improves transfer speed as well as decryption performance which depends on the size of the data to be decrypted.

### 7.3.2 Encryption Cost

We then compared the performances of our proposed MABE scheme with those of original CP-ABE [12] (without optimization) as well as the solutions proposed by [24], [23], [21] and [29]. The results are shown in figure 13 and 14.

<figure><img src="image_14.png" /><figcaption>Fig. 13 Encryption Time Comparison</figcaption></figure>

From results shown in figure 13 we notice that the encryption time of original CP-ABE is the longest as all the other solutions tend to improve it. Concerning comparison with the other three schemes, we can observe that for a small number of attributes, the MABE encryption lasts slightly longer (0.20sec for our solution against 0.10sec, 0.12sec and 0.15sec for the other approaches), but from 15-20 attributes the curves

of the three other schemes begin to increase significantly while the MABE curve remains relatively constant. We also notice that from 25 attributes our solution presents better results than those of other solutions, and the tendency continues in this direction for higher number of attributes. This is explained by the fact that the more attributes we have (connected by AND operator) in the access tree, the greater the probability of detecting meta-attributes, and consequently the more the access tree will be reduced. Thereby, the size of the obtained access tree remains almost constant despite the increase in the size of the original access policy. Which keeps the encryption time of MABE relatively constant, while all other schemes' computational cost increases linearly with the number of attributes.

<figure><img src="image_15.png" /><figcaption>Fig. 14 Decryption Time Comparison</figcaption></figure>

### 7.3.3 Decryption Cost

Regarding decryption operation, we can notice from figure 14 that CP-ABE computational time increases linearly with the number of attributes. We can also observe that our MABE performance is better than [24] and very similar to the two other schemes without using additional devices. This is explained by the fact that the slight increase in the size of the decryption secret key (less than 30%) is compensated by the reduction of leaf nodes in the access policy attached to ciphertext. Which means that our solution increases the number of pairings on one side but decreases
the number of exponentiations on the other side, which keeps the overall decryption time constant and similar to other solutions. Indeed, improving CP-ABE decryption time is a difficult task. This is why most studies use outsourcing of the most computationally expensive operations to devices with more capacity. In our solution, the entire decryption operation takes place on the data user's device, which optimizes resource utilization and ensures better data security while keeping performance comparable to other proposed solutions.

## 7.4 Discussion

The experimental results show that MABE scheme considerably improves the computational cost of original CP-ABE. Indeed, our solution makes it possible to reduce the size of access tree by 33%, which allows to improve the encryption time by around 40% for 10-15 attributes and can exceed 75% for larger size of access policies (more than 40 attributes). As well as improving decryption time by around 35%.

Compared to other optimized approaches, our solution significantly improves encryption time and ciphertext size, while ensuring satisfactory decryption performance. This makes MABE more suitable for e-health applications, in particular patient home monitoring systems where the encryption operation is the most resource-intensive since it is executed almost continuously (measuring patients physical signals is done practically without interruption) on devices with limited capacity (patient's edge device). In addition, our solution avoids the transmission of partially encrypted patient's data (medical data and access policy) to semi-trusted intermediate nodes for re-encryption, which ensures better protection of patient privacy, which constitutes our major initial objective.

In addition, MABE can be exploited in other domains where applications are based on a fog computing architecture (IoT-Fog-Cloud), and which use attribute-based encryption to guarantee the confidentiality of data transiting between the different layers, and ensure fine-grained access control to information stored in cloud servers. Indeed, this architecture allows to deploy the different functionalities of our solution in order to optimize the use of constrained devices' resources, particularly in domains with a very large number

of users (and consequently a very large number of attributes) such as smart grids [38], Industrial IoT [35] [39] and smart cities [40] [41] applications.

# 8 Conclusion and Future Work

In this paper we presented MABE: Our Meta-Attribute Based Encryption solution of optimizing CP-ABE encryption. For the purpose of protecting medical data in a constrained environment, namely an e-health application system based on an IoT-Fog-Cloud architecture, associated with an optimal deployment scenario delegating additional tasks towards nodes with more capacities.

We did experiments to determine the factors that impact the performance of ABE to act on these factors. Then we proposed a CP-ABE's access tree reduction mechanism based on attributes clustering.

The experimentation shows that the use of meta-attributes makes it possible to significantly improve the performance of encryption and minimize resource utilization on the constrained devices, which makes our solution suitable for patient home monitoring applications where these devices are widely used.

Moreover, Meta-Attribute Based Encryption (MABE) can be effectively combined with other security mechanisms, such as blockchain and context-aware access control (CAAC) to enhance medical data protection and optimize resource utilization in fog-based e-health systems. A fog-based adaptive context-sensitive access control framework, as presented in [42], dynamically adjusts access policies based on contextual information such as location, device state, or user behavior, providing adaptability to changing environments and ensuring real-time responsiveness. By leveraging fog computing, CAAC brings decision-making closer to end nodes, reducing latency, and preventing unauthorized access. Blockchain solutions as presented in [43] complement this framework by acting as a decentralized and tamper-proof ledger to securely store access policies (and minimized access policies), audit logs, and data integrity proofs. This ensures trusted and secure communication between IoT devices and fog nodes. Finally, MABE enhances the framework by offering fine-grained access control with reduced computational
overhead. By replacing attribute sets (both in CP-ABE and CAAC) with meta-attributes, MABE streamlines encryption processes, making it particularly suited for resource-constrained fog environments. This could be the subject of future work.

## Declarations

* Funding: The authors declare that no funds, grants, or other support were received during the preparation of this manuscript.

* Conflict of interest/Competing interests: The authors have no competing interests to declare that are relevant to the content of this article.

* Author contribution: The study conception and design were performed by Abdelghani Krinah and revised by Yacine Challal. The first draft of the manuscript was written by Abdelghani Krinah and all authors commented on previous versions of the manuscript. All authors read and approved the final manuscript.

## References

[1] Redwan Walid, Karuna Pande Joshi, and Lavanya Elluri. Secure and privacy-compliant data sharing: An essential framework for healthcare organizations. *10th International Conference on Mathematics and Computing ICMC*, January 2024.

[2] Ewa J. Kleczyk. Importance of patient privacy in healthcare analytics research. *Ethics - Scientific Research, Ethical Issues, Artificial Intelligence and Education*, 2023.

[3] Steve Moffat, Mohammad Hammoudeh, and Robert Hegarty. A survey on ciphertext-policy attribute-based encryption (cp-abe) approaches to data security on mobile devices and its application to iot. *Proceedings of the International Conference on Future Networks and Distributed Systems*, 2017.

[4] Moreno Ambrosin, Arman Anzanpour, Mauro Conti, Tooska Dargahi, Sanaz Rahimi Moosavi, Amir M. Rahmani, and Pasi Liljeberg. On the feasibility of attribute-based encryption on internet of things devices. *IEEE Micro*, 36(6):25–35, 2016.

[5] Moreno Ambrosin, Mauro Conti, and Tooska Dargahi. On the feasibility of attribute-based encryption on smartphone devices. *Proceedings of the 2015 Workshop on IoT challenges in Mobile and Industrial Systems*, 2015.

[6] Abdelghani Krinah, Yacine Challal, Mawloud Omar, and Omar Nouali. Using abe for medical data protection in fog computing. *International Conference on Enterprise Information Systems*, pages 155–161, 2019.

[7] G. Salton and M.J. McGill. *Introduction to Modern Information Retrieval*. International student edition. McGraw-Hill, 1983.

[8] Anil K. Jain, M. Narasimha Murty, and Patrick J. Flynn. Data clustering: a review. *ACM Comput. Surv.*, 31:264–323, 1999.

[9] Shanhe Yi, Cheng Li, and Qun A. Li. A survey of fog computing: Concepts, applications and issues. *Proceedings of the 2015 Workshop on Mobile Big Data*, 2015.

[10] Jie Chen, Jiaxu Niu, Hao Lei, Li Lin, and Yunhao Ling. Adaptively secure multi-authority attribute-based broadcast encryption in fog computing. *Comput. Networks*, 232:109844, 2023.

[11] Bedatrayee Ghosh, Priyanka Parimi, and Rashmi Ranjan Rout. Improved attribute-based encryption scheme in fog computing environment for healthcare systems. *2020 11th International Conference on Computing, Communication and Networking Technologies (ICCCNT)*, pages 1–6, 2020.

[12] Amit Sahai and Brent Waters. Fuzzy identity-based encryption. *IACR Cryptol. ePrint Arch.*, 2004:86, 2005.

[13] Jungyub Lee, Sungmin Oh, and Ju Wook Jang. A work in progress: Context based encryption scheme for internet of things. *Proceedia Computer Science*, 56:271–275, 2015. The 10th International Conference on Future Networks and Communications (FNC 2015) / The 12th International Conference on Mobile Systems and Pervasive Computing (MobiSPC 2015) Affiliated Workshops.

[14] Ahmed Saidi, Omar Nouali, and Abdelouahab Amira. Share-abe: an efficient and secure data sharing framework based on ciphertext-policy attribute-based encryption and fog computing. *Cluster Computing*, 25:167 – 185, 2021.

[15] Deepa. A secure multi-keyword search scheme for encrypted cloud data using cosine similarity. *International Journal of Computer*
*Science and Mobile Computing*, 5:171–176, 2016.

[16] Zakaria Gheid and Yacine Challal. Efficient and privacy-preserving k-means clustering for big data mining. *2016 IEEE Trustcom/Big-DataSE/ISPA*, pages 791–798, 2016.

[17] Jin Li, Qian Wang, Cong Wang, and Kui Ren. Enhancing attribute-based encryption with attribute hierarchy. *Mobile Networks and Applications*, 16:553–561, 2009.

[18] Stefan G. Weber. A hybrid attribute-based encryption technique supporting expressive policies and dynamic attributes. *Information Security Journal: A Global Perspective*, 21:297 – 305, 2012.

[19] Daniel Servos, Sabah Mohammed, Jinan Fiaidhi, and Tai hoon Kim. Extensions to ciphertext-policy attribute-based encryption to support distributed environments. *Int. J. Comput. Appl. Technol.*, 47:215–226, 2013.

[20] Kaiping Xue, Jianan Hong, Yingjie Xue, David S. L. Wei, Nenghai Yu, and Peilin Hong. Cabe: A new comparable attribute-based encryption construction with 0-encoding and 1-encoding. *IEEE Transactions on Computers*, 66:1491–1503, 2017.

[21] Mukalel Bhaskaran Smithamol and S. Raja Rajeswari. Hybrid solution for privacy-preserving access control for healthcare data. *Advances in Electrical and Computer Engineering*, 17:31–38, 2017.

[22] Jian CHEN, Xiaojun SHEN, Yiyang YAO, Yafei XING, and Xiaoming JU. Cache replacement strategy based on access mechanism of ciphertext policy attribute based encryption. *Journal of Computer Applications*, 37(10):2964, 2017.

[23] Wenjuan Tang, Kuan Zhang, Ju Ren, Yaoxue Zhang, and Xuemin Shen. Lightweight and privacy-preserving fog-assisted information sharing scheme for health big data. *GLOBECOM 2017 - 2017 IEEE Global Communications Conference*, pages 1–6, 2017.

[24] Peng Zhang, Zehong Chen, Joseph K. Liu, Kaitai Liang, and Hongwei Liu. An efficient access control scheme with outsourcing capability and attribute update for fog computing. *Future Gener. Comput. Syst.*, 78:753–762, 2018.

[25] Qian He, Ning Zhang, Yongzhuang Wei, and Yan Zhang. Lightweight attribute based encryption scheme for mobile cloud assisted cyber-physical systems. *Comput. Networks*, 140:163–173, 2018.

[26] Payman Mohassel, Mike Rosulek, and Ni Trieu. Practical privacy-preserving k-means clustering. *Proceedings on Privacy Enhancing Technologies*, 2020:414 – 433, 2020.

[27] Ying Zou, Zhen Zhao, Sha Shi, Lei Wang, Yunfeng Peng, Yuan Ping, and Baocang Wang. Highly secure privacy-preserving outsourced k-means clustering under multiple keys in cloud computing. *Secur. Commun. Networks*, 2020:1238505:1–1238505:11, 2020.

[28] Ajmeera Kiran and D Vasumathi. Optimized attribute based encryption approach over big data analytics for privacy preservation in data mining. *International Journal of Advanced Research in Engineering and Technology (IJARET)*, 11:2555–2573, 2020.

[29] Yang Ba, Xuexian Hu, Yue Chen, Zenghang Hao, Xuewei Li, and Xincheng Yan. A blockchain-based cp-abe scheme with partially hidden access structures. *Security and Communication Networks*, 2021.

[30] Chandan Kumar Chaudhary, Richa Sarma, and Ferdous Ahmed Barbhuiya. Rma-cpabe: A multi-authority cpabe scheme with reduced ciphertext size for iot devices. *Future Gener. Comput. Syst.*, 138:226–242, 2022.

[31] Chenlu Xie, Run hua Shi, Xiaoxu Zhang, Peng-Bo Wang, and Wan peng Guo. Verifiable outsourcing emrs scheme with attribute-based encryption in cloud-edge environments. *J. Inf. Secur. Appl.*, 76:103526, 2023.

[32] Bhaskar Kapoor, Bharti Nagpal, and Meshal Alharbi. Secured healthcare monitoring for remote patient using energy-efficient iot sensors. *Comput. Electr. Eng.*, 106:108585, 2023.

[33] Chandramohan Dhasarathan, Rajaguru Dayalan, Vengattaraman Thirumal, and Dhavachelvan Ponnurangam. A coordinator-specific privacy-preserving model for e-health monitoring using artificial bee colony approach. *Security and Privacy*, 1, 2018.

[34] Yinlong Wang, Ting Guo, and Nurmamat Helil. Cp-abe optimization via the flexible integration of access policies containing multiple shared subpolicies. *Security and*
Communication Networks, 2023.

[35] Alejandro Peñuelas-Angulo, Claudia Feregrino-Uribe, and Miguel Morales-Sandoval. A revocable multi-authority attribute-based encryption scheme for fog-enabled iot. *Journal of Systems Architecture*, 155:103265, 2024.

[36] Dan Boneh and Matthew K. Franklin. Identity-based encryption from the weil pairing. *IACR Cryptol. ePrint Arch.*, 2001:90, 2001.

[37] John Bethencourt, Amit Sahai, and Brent Waters. Ciphertext-policy attribute-based encryption. *2007 IEEE Symposium on Security and Privacy (SP '07)*, pages 321–334, 2007.

[38] Ahmed Saidi, Abdelouahab Amira, and Omar Nouali. A secure multi-authority attribute based encryption approach for robust smart grids. *Concurrency and Computation: Practice and Experience*, 36, 2023.

[39] Shruti, Shalli Rani, and Gautam Srivastava. Secure hierarchical fog computing-based architecture for industry 5.0 using an attribute-based encryption scheme. *Expert Syst. Appl.*, 235:121180, 2023.

[40] Subhranshu Sekhar Tripathy, Sujit Bebortta, Mazin Abed Mohammed, Muhammet Deveci, Haydar Abdulameer Marhoon, and Radek Martínek. A secure mist-fog-assisted cooperative offloading framework for sustainable smart city development. *Digital Communications and Networks*, 2024.

[41] Ronita Rezapour, Parvaneh Asghari, Hamid Haj Seyyed Javadi, and Shamsollah Ghanbari. A semantic model based on ensemble learning and attribute-based encryption to increase security of smart buildings in fog computing. *J. Supercomput.*, 80:26614–26657, 2024.

[42] Rudri Kalaria, A. S. M. Kayes, Wenny Rahayu, Eric Pardede, and Ahmad Salehi Shahraki. Adaptive context-aware access control for iot environments leveraging fog computing. *Int. J. Inf. Sec.*, 23:3089–3107, 2024.

[43] Hemant Kumar Apat and Bibhudatta Sahoo. A blockchain assisted fog computing for secure distributed storage system for iot applications. *J. Ind. Inf. Integr.*, 42:100739, 2024.