We present a cryptographic framework to achieve access control, privacy of social relations, secrecy of resources, and anonymity of users in social networks. The main idea is to use pseudonyms to hide user identities, signatures on pseudonyms to establish social relations, and zero-knowledge proofs on these signatures to demonstrate the existence of the corresponding social relations without sacrificing user anonymity. Our framework is generally applicable and, in particular, constitutes an ideal plug-in for decentralized social networks. We formally verified the aforementioned security properties using ProVerif, an automated theorem prover for cryptographic protocols. We also conducted an experimental evaluation to demonstrate the efficiency and the scalability of our framework. Categories and Subject Descriptors C.2.0 [Computer-Communication Networks]: Security and Protection General Terms Security, Verification Keywords Social network security, anonymity in distributed systems, ...