The prominence of cloud computing has grown up in the IT industry over the last decade. It has been attracting companies’ owners to shift their data storage and applications to the cloud to enjoy the cloud resources and reduce the operational cost. Outsourcing data to a third party opens up these data to security and privacy risks. Authorizing and revoking users when hosting large amount of files on a third party are a challenging security task, especially when having a complex and large users community. In this paper, we address the open problem of authorization and revocation in cloud computing. We propose a new key policy attribute-based encryption method and introduce the feature of atomic attribute-based encryption. Using this feature, the client provides encrypted attributes to the cloud, and then, he may go offline. Our scheme provides privacy for data, users and files owners. We enable the client to assign negative and positive attributes to achieve flexible authorization and revocation. Our solution enables individuals to outsource their data to clouds, authorize users with different permissions to access these files and revoke selected users with less computational cost.