In a digital library, an increasingly important problem is how to prevent the exposure of user privacy in an untrusted network. This study aims to design an effective approach for the protection of user privacy in a digital library, by consulting the basic ideas of encryption and anonymization. In our proposed approach, any privacy data, which can identify user’s real identity, should be encrypted first before being submitted to the library server, to achieve anonymization of user identity. Then, to solve the problem of querying encrypted privacy data, additional feature data are constructed for the encrypted data, such that much of the query processing can be completed at the server-side, without decrypting the data, thereby improving the efficiency of each kind of user query operation. Both theoretical analysis and experimental evaluation demonstrate the effectiveness of the approach, which can improve the security of users’ data privacy and behavior privacy on the untrusted server-side, without compromising the availability (i. e. accuracy, efficiency, and usability) of digital library services. This paper provides a valuable study attempt at the protection of digital library users’ privacy, which has a positive influence on the development of a privacy-preserving library in an untrusted network environment.