Concerns of privacy, template security and efficiency of biometric authentication systems have received considerable research attention in the recent past. Binary template representations have been shown to provide significant improvements in efficiency without compromising accuracy for a variety of biometric modalities including fingerprints, palmprints and iris. Most of the secure authentication protocols work with generic feature representations or propose new secure templates for specific modalities. In this work, we propose an authentication protocol that works with any binary biometric representation that employs hamming distance for comparison and convert it into a secure, privacy preserving protocol that provides template protection. We also provide the ability to use masks while computing the hamming distance. The protocol retains the accuracy of the underlying representation as demonstrated by our experiments.