Social networking becomes increasingly important due to the recent surge in online interaction. Social network analysis can be used to study the functioning of computer networks, information flow patterns in communities, and emergent behavior of physical and biological systems. In this paper, the mathematical formulation and computational models for security and privacy of social network data are discussed. Several possible ways for an attacker to attack are presented so that the mathematical formulation can take them into account. The metrics for measuring the amount of security and privacy in an online social network (OSN) are discussed so that we have an idea of how good a model is. Based on these current techniques and attack strategies, future directions of research are discussed.