Cloud computing is a revolutionary information technology paradigm, which provides users with unlimited, scalale, low-cost and convenient resource services, but when data is outsourced to a semi-trusted cloud server, challenging security issues such as user privacy, access control, etc. still urgently need to be addressed. Attribute-based encryption (ABE) scheme can provide sufficient data security and fine-grained access control for cloud data. However, the limitation of ABE is that user's privacy would be disclosed with the access policy (structure) stored in clear text. Some works sacrificed the computing efficiency, key length or ciphertext size for privacy concerns. To overcome these problems, this paper proposes an efficient anonymous attributebased encryption scheme with access policy hidden. Using the idea of Boolean equivalent transformation, the proposed scheme can achieve fast encryption and protect the privacy for both data owner and legitimate access user. In addition, the proposed scheme can satisfy constant secret key length and reasonable size of ciphertext requirements. We conduct theoretical security analysis, and carry out experiments to prove that the proposed scheme has good performance in terms of computational, communication and storage overheads.