Many individuals share their opinions (e.g., on political issues) or sensitive information about them (e.g., health status) on the internet in an anonymous way to protect their privacy. However, anonymous data sharing has been becoming more challenging in today's interconnected digital world, especially for individuals that have both anonymous and identified online activities. The most prominent example of such data sharing platforms today are online social networks (OSN). Many individuals have multiple profiles in different OSNs, including anonymous and identified ones (depending on the nature of the OSN). Here, the privacy threat is profile matching: if an attacker links anonymous profiles of individuals to their real identities, it can obtain privacy-sensitive information which may have serious consequences, such as discrimination or blackmailing. Therefore, it is very important to quantify and show to the OSN users the extent of this privacy risk in real-time and provide countermeasures. On the other hand, today, the massive amount of data shared by individuals on various online platforms greatly outstrips our cognitive capacity to understand the privacy risks due to the shared data. Thus, intelligent and efficient algorithms are required to transform massive volumes of data from OSNs into accurate privacy risk quantification tools.In this thesis, we develop algorithms to efficiently formulate, model, and quantify the privacy risk due to profile matching attacks in OSNs. We formulate the profile matching risk in several different ways (using machine learning, optimization techniques, and graphical methods) and study the relationship between the accuracy and efficiency of different formulations. We evaluate the proposed frameworks on four real-life datasets and show how user profiles in different OSNs can be matched in an efficient and accurate way. Using the output of the formulation, we model the profile characteristics of users that are vulnerable to profile matching and we make probabilistic inferences about how the vulnerabilities of users change as they share new content on OSNs or make new connections.