## 5 Our Methodology  
The proposed methodology includes 6 steps, i.e., Setups, _KeyGen._, \(\left(Enc.\right)\), \(\left(Re-Enc.\right)\), \(\left(Dec.\right)\) and \(u^{*}\). 1. **Global Initialization (\(GlobalSetup\))** The \(CA\) selects the bilinear map that is \(e:\mathcal{G}*\mathcal{G}\rightarrow\mathcal{G}_{T}\), which corresponds to the security parameter, i.e., \(\lambda\), where \(\mathcal{G}\) and \(\mathcal{G}_{T}\) are multiplicative cyclic classes of \(p\) (\(p\) is any prime number). \(\mathcal{G}\) is considered the generator and \(U\) represents the attributes' set. The \(AID\) is depicted in all attributes. The \(UID\) represents the collection of global identification for all end users. Function \(\mathcal{H}\) corresponds to \(uid\in UID\), which is the end-user identities of the components of \(\mathcal{G}\). Function \(\mathcal{F}\) corresponds to the attributes of end users to \(\mathcal{G}\) components. Note that \(\mathcal{H}\) and \(\mathcal{F}\) are the mapping functions. \(\mathcal{T}\) is an object authority representation of the users' attributes. Thus, the dimension of the \(GP\) is given as \[GP=(\mathcal{G},\ \mathcal{G}_{T},\ p,\ g,\ e,\ U,\ AID,\ UID,\ \mathcal{H},\ \mathcal{F},\ \mathcal{T}).\] (1)
2. **Attribute Authority Initialization (\(AASetup\))**  
Figure 3: Binary State Tree \(KEK_{TREE}\). For \(aid\in AID\), \(AA\) chooses 2 random numbers \(\alpha_{aid},\beta_{aid}\in\mathbb{Z}_{p}\) (\(Z_{p}\) must be an integer ring of order \(p\)). The public and secret keys are generated as illustrated below: \[APK_{aid}=\Big{(}e(g,g)^{a_{aid}},g^{\beta_{aid}}\Big{)},\] (2) \[ASK_{aid}=(\alpha_{aid},\beta_{aid}).\] (3)
3. **Key-Gen.** The key generation includes the process of generating private and attribute-group keys. For example, the method of _Key-Gen_ is described as follows. 4. **End-user Private Key Generation (\(SKGen\))**\(S_{aid,aid}\) is considered as a set of the end users' attributes \(uid\). In all attributes \(i\in S_{aid,aid}\), the \(AA\) nominates a random number, i.e., \(t_{i}\in\mathbb{Z}_{p}\). It executes \(K_{uid,i}=g^{a_{aid}}\mathcal{H}(uid)^{\beta_{aid}}\mathcal{F}(i)^{t_{i}}\) and \(K^{{}^{\prime}}_{uid,j}=g^{t_{i}}\). Finally, the end user generates the private key, i.e., \[SK_{S,aid,aid}=\Big{(}\Big{\{}\ K_{uid,i},K^{{}^{\prime}}_{uid,i}\Big{\}}\Big{)}.\] (4)
5. **Attribute-Group-Key Generation (\(Attr-GroupKey-Gen\). )** The \(AA\) generates a \(KEK\) tree for all users [46]. In the \(KEK\) tree, a node generates a random number while a leaf node represents the end user. In this regard, the \(uid\) finds a path, i.e., \(PATH_{t}\), from the leaf node towards the root node. For instance, the path key of \(u_{2}\) is \(PATH_{2}=\{v_{0},v_{4},v_{2},v_{1}\}\). Therefore, the \(aid\) chooses random numbers \(AGK_{x}\in\mathbb{Z}_{p}\) as attribute-group keys. \(CSP\) utilizes the path key to encrypt the group key during the _Re-Enc._ step. 6. **Encryption (Enc. )** In this step, the data owner and fog nodes execute the encryption process. The data owner requires \(a_{p}=(\mathcal{M},\rho)\). The amount of computation expected for secret restoration is \(n\), and the function \(\rho\) maps each row. The data owner transmits the \(a_{p}=(\mathcal{M},\rho)\) to the fog node. 7. **Fog Node Encryption (\(FogEnc\). )** The fog node selects a random number \(\{r_{1},\ldots,r_{l}\}\in\mathbb{Z}_{p}\) and two vectors, i.e., \(z=(0,z_{2},\ldots,z_{n})^{\mathcal{T}}\) and \(v=(s,v_{2},\ldots,v_{n})^{\mathcal{T}}\), which is randomly considered. The \(s\in\mathbb{Z}_{p}^{*}\) is a secret to be shared. Then, it calculates \(\lambda_{i}=\mathcal{M}_{i}v\) and \(w_{i}=\mathcal{M}_{i}\times z\), \(\forall i\in l\). The \(\rho\) (function) maps each row \(\mathcal{M}_{i}\) to the authority to provide \(\rho(i)\). It executes \(\mathcal{C}_{1,i}=e(g,g)^{\lambda_{i}}e(g,g)^{\alpha_{i}(i)^{r_{i}}}\), \(\mathcal{C}_{2,i}=g^{-r_{i}}\), \(\mathcal{C}_{3,i}=g^{\beta_{i(i)^{r}}}g^{\varpi_{i}}\) and \(\mathcal{C}_{4,i}=\mathcal{F}(\rho(i))^{r_{i}}\).