The emergence of mobile medical social networks has provided great convenience for patients to communicate with each other about their medical conditions, promoting efficient and high-quality communication and exchange among patients. However, at the same time, it has also raised issues of confidentiality and privacy of patient data. In response to this issue, this article proposes a cloud-based attribute-based signature encryption scheme that can effectively protect the privacy of patient data. The patient encrypts their medical information and uploads it to the cloud server. When the data user wants to access the patient’s information, the cloud server helps the data user partially decrypt and verify the integrity of the data, which to some extent reduces the computational workload of the data user. Meanwhile, under the random oracle model, it has been proven that the scheme satisfies the unforgeability under selective message attacks, indistinguishability under selective cipher text attacks, and attribute privacy security. Theoretical analysis and numerical simulation experiments show that this scheme has higher efficiency than existing schemes in the signing and decryption stages.