Design and analysis of privacy-preserving protocols