## 6 Analysis of Schemes
### Security Analysis  
In this work, we provide a formal proof and analysis based on a defined security model. In this model, all AAs are fully trusted entities responsible for generating and distributing keys, as well as managing access attributes. Their trustworthiness is crucial to maintaining the integrity and security of the system. On the other hand, CNs are considered semi-trusted. While CNs are expected to accurately perform computational tasks outsourced by the CR, such as encryption and decryption, they may attempt to collect sensitive information during the process. This semi-trusted assumption reflects real-world scenarios where computational resources at the edge of the network might not be entirely under the system's control. To address these challenges, the proposed model incorporates the following:  
* Data Confidentiality: Ensuring sensitive data remain secure, even if CNs attempt to extract information. * Operational Integrity: Verifying the authenticity and correctness of CN operations without revealing critical private keys. * Decentralisation: Reducing dependency on centralised authorities, such as a CA, thereby minimising single points of failure and enhancing system flexibility. By addressing these considerations, the model provides a robust foundation for secure and efficient access control in resource-constrained IoT environments. In the following sections, we present the security analysis of the proposed scheme, demonstrating its resistance to potential attacks under CPA scenarios and the DBDH assumption. Assumption the DBDH assumption holds, the proposed decentralised CP-ABE scheme with key generation is secure against CPA. The ciphertext generated during the decentralised key generation process is indistinguishable from a random element in \(G_{T}\), as the adversary lacks the necessary attributes to satisfy the access policy, ensuring data confidentiality against unauthorised access. Suppose there exists an adversary \(\mathcal{A}\) that can break the CPA security of the proposed decentralised CP-ABE scheme with key generation with a non-negligible advantage \(\epsilon\). We construct a challenger \(\mathcal{C}\) to break the DBDH assumption using \(\mathcal{A}\)'s advantage. \(\square\)  
Let \(e:\,\mathbb{G}\times\mathbb{G}\rightarrow\mathbb{G}_{T}\) be a bilinear map, where \(\mathbb{G}\) is a cyclic group of prime order \(p\) with generator \(g\). The challenger \(\mathcal{C}\) begins by randomly selecting \(a,\ b,\ c\ \in\ \mathbb{Z}_{p}\), \(\mu\in\{0,\ 1\}\), and \(R\in\mathbb{G}_{T}\). Based on the value of \(\theta,\mathcal{C}\) constructs the tuple \((g,\ A,\ B,\ C,\ R)\) as follows:  
* If \(\mu=0\), then the tuple is set to \((g,\ A,\ B,\ C,\ R)=\left(g,\ g^{a},\ g^{b},\ g^{c},\ e(g,g)^{abc}\right)\), representing a valid DBDH instance. * If \(\mu=1\), then the tuple is set to \((g,\ A,\ B,\ C,\ R)=\left(g,\ g^{a},\ g^{b},\ g^{c},\ R\right)\), where \(R\) is a random element in \(\mathbb{G}_{T}\). * Setup The challenger \(\mathcal{C}\) selects two numbers \(\rho,\ \theta\in\mathbb{Z}_{p}\) and defines \(\alpha=\rho+ab\) and \(\beta=\theta\). Then, \(\mathcal{C}\) computes the public key as \(PK=e(g,g)^{\alpha}=e(g,g)^{\rho}\cdot e(g,g)^{ab}\), and \(h=g^{\beta}=g^{\theta}\). Finally, \(\mathcal{C}\) provides \(PK\) to \(\mathcal{A}\). * Phase 1 \(\mathcal{A}\) queries \(\mathcal{C}\) for private keys corresponding to specific attribute sets \(S\). For each queried attribute \(i\in S\), \(\mathcal{C}\) generates the private key \(SK\) with the following components: \(D=g^{(a+r)b}\), \(D_{i}=g^{r}H_{1}(i)^{r}\), and \(D_{i}^{\prime}=g^{r_{i}}\), where \(r,r_{i}\in\mathbb{Z}_{p}\) are randomly selected values. After computing these components, \(\mathcal{C}\) constructs \(SK\) and provides it to \(\mathcal{A}\). * Challenge \(\mathcal{A}\) submits two equal-length plaintexts \(M_{0}\) and \(M_{1}\), along with an access policy \(\mathcal{T}\), to \(\mathcal{C}\).