## 5 Our Methodology
The ciphertext is calculated as \[\mathcal{CT}_{out}^{1}=\Big{(}\mathcal{A},\{\mathcal{C}_{1,i},\mathcal{C}_{2, i},\mathcal{C}_{3,i},\mathcal{C}_{4,i}\}_{i\in[l]}\Big{)}.\] (5)
8. **Data-owner Encryption (\(DOEnc\). )** The \(DO\) select \(DK\in\mathbb{Z}_{p}\) and encrypt \(m\) by using \(SE\), i.e., \(\mathcal{C}=SE_{DK}(m)\). They also compute \(\mathcal{C}_{O}=DK\cdot e(g,g)^{s}\). Hence, the \(DO\) deliver the ciphertext \(\mathcal{CT}\), i.e., \[\mathcal{CT}=\Big{(}\mathcal{A},\mathcal{C},\mathcal{C}_{O},\{\mathcal{C}_{1, i},\mathcal{C}_{2,i},\mathcal{C}_{3,i},\mathcal{C}_{4,i}\}_{i\in[l]}\Big{)}.\] (6) The fog node receives \(\mathcal{CT}\) from the \(DO\) to upload to the \(CSP\) for re-encryption. 9. **Re-Encryption (Re-Enc. )** In this process, the \(AGK_{\rho(i)}\) is utilized to re-encrypt the \(\mathcal{CT}\) for \(\rho(i)\) related to the \(\mathcal{CT}\) of the \(\mathcal{A}\). In the _Re-Enc._, the \(\mathcal{CT}^{{}^{\prime}}\) becomes \[\mathcal{CT}^{\prime}=\mathcal{A},\mathcal{C},\mathcal{C}_{O},\Big{\{} \mathcal{C}_{1,i},\mathcal{C}_{2,i},\mathcal{C}_{3,i},\mathcal{C}_{4,i}^{{}^{ \prime}}=(\mathcal{C}_{4,i})^{AGK_{\rho(i)}}\Big{\}},\] (7) where \(i\in[l]\). In the \(KEK\) tree, \(CSP\) selects the minimum root node coverage set \(KEK(G_{i})\) that covers the leaf nodes to the set of the end user. For instance, \(G_{i}=\left\{\,u_{1},u_{2},u_{3},u_{4},u_{7},u_{8}\right\}\) and \(KEK(G_{i})=\left\{KEK_{2},KEK_{7}\,\right\}\). Lastly, the information of the header is created as  
\[Hdr=\left(\forall y\in Y:\left\{E_{K}\Big{(}AGK_{\rho(y)}\Big{)} \right\}_{u\in KEK\left(C_{y}\right)}\right), \tag{8}\]  
where \(Y\) is the set of attributes in \(a_{p}\) and \(E_{K}\Big{(}AGK_{\rho(y)}\Big{)}\) is a symmetric encryption, i.e., \(SE=E_{K}\Big{(}AGK_{\rho(y)}\Big{)}\). 10. **Decryption (Dec.)** The decryption involves predecryption, fog node decryption and end-user decryption. 11. **Predecryption (\(Pre-Dec\). )** If the (\(a_{p}\)) is not satisfied by the attribute set of the end user, i.e., \(S_{uid}\
i a_{p}\), then the end user's output is \(\bot\) (\(\bot\) is an invalid output). Alternatively, the users decrypt the information by intersecting the path key and the minimum root node coverage to obtain an attribute-group key. It utilizes the attribute-group-key \(AGK_{\rho(i)}\) to compute \(K^{*}_{uid,\rho(i)}=\left(K^{\prime}_{uid,\rho(i)}\right)^{1/AGK_{\rho(i)}}\). Lastly, the end user upgrades the private (secret) key as follows: \[SK^{\prime}_{S,uid,uid}=\left\{K_{uid,\rho(i)},K^{*}_{uid,\rho(i)} \right\}_{\rho(i)\in S_{uid,uid}}.\] (9)  
The end user randomly chooses from the set of \(z\in\mathbb{Z}_{p}\), computes \(K^{1}_{uid,\rho(i)}=\left(K_{uid,\rho(i)}\right)^{1/z}\) and \(K^{2}_{uid,\rho(i)}=\left(K^{*}_{uid,\rho(i)}\right)^{1/z}\) and creates outsourcing private keys as given in (10):  
Figure 3:0  
Next, the end user computes \(\mathcal{C}^{\prime}_{1,i}=\mathcal{C}^{1/z}_{1,i}\) and \(\mathcal{C}^{\prime}_{3,i}=\mathcal{C}^{1/z}_{3,i}\) and alters the ciphertext as  
Figure 3:1  
where \([l]=\left\{1,2,\ldots,l\right\}\). Hence, \(OSK\) and \(\mathcal{CT}^{\prime\prime}\) are sent to the fog node. 12. **Fog Node Decryption \(\left(Fog-Dec\right)\)** The sets of fog nodes are \(I=\left\{\,x:\rho(x)\in S_{uid}\right\}\) and they compute the constants \(\left\{c_{x}\in\mathbb{Z}_{p}\right\}_{x\in l^{\prime}}\), i.e., \(\sum_{x\in l}c_{x}\mathcal{M}_{x}=\left(1,0,\ldots,0\right)\), which is illustrated in (12) [45]: Figure 3:2 Figure 3:3 Figure 3:4 Figure 3:5 (12)  
As a result, the fog node transmits the ciphertext \(\mathcal{CT}^{2}_{out}=\left\{\mathcal{A},\mathcal{C},\mathcal{C}_{O},B\right\}\) to the end user. 13. **End-user Decryption \(\left(end-user-Dec\right)\)** After the end user obtains the ciphertext \(\mathcal{CT}^{2}_{out}\) from the fog node, it computes  
Figure 3:6The end users now decrypt the plaintext \(m\) by utilizing the symmetric key \(DK\):  
\[\mathcal{CT}^{*}=\ \left(