The use of IoT for real-time data processing and sharing in various fields such as medical care, finance, and education has become essential. However, the current infrastructure for IoT is expensive and complex, leading to high maintenance costs. The outsourcing cloud paradigm and attribute-based encryption (ABE) are solutions to address data access problems in IoT data sharing. Ciphertext-policy attribute-based encryption (CP-ABE) is a prominent approach for securely utilizing shared data in cloud computing. However, CP-ABE raises concerns regarding key escrow problems and complex access structures. Multi-authority systems can increase communication costs. To address these issues, a scheme called Key escrow-protected Cooperative ciphertext policy with weighted attribute-based encryption (KPC-CP-WABE) is proposed. This scheme involves two authorities: the attribute authority and the Central Trusted Authority Center (CTAC). The user's secret key is generated separately by both parties, with the CTAC also playing a role in key generation. A two-party computation protocol is used to design the user's secret key, ensuring the privacy of the private key. The study mainly focused on looking at KPC-CP-WABE with other methods over encryption performance whole weighted access policies with “AND” gates. The proposed approach introduces weights to the provider's access policy attributes. An information retrieval system is also presented to extract the common access sub-policy, improving encryption performance while avoiding complex access structures. Compared to standard methods, this approach reduces encryption and decryption costs. Overall, the study demonstrates that KC-CP-WABE selectively secures shared data based on CP-WABE, resulting in superior performance in terms of extraction time compared to CP-ABE, CP-WABE, and C-CP-ABE.