To securely employ fingerprint-based identity authentication in open network, private fingerprint data of a user and a server must be protected.A novel algorithm was presented to perform the minutiae matching while privacy of the two parties was preserved. In the proposed algorithm,a sequence consisting of the template of the server and query minutiae of the user was firstly sorted by oblivious sorting algorithm.Then,all the neighbor elements of the sequence were tested whether they are equal.Finally, several adders were used to compute the quantity of matched elements. The proposed algorithm was crystallized by using garbled circuits and some approaches were taken to optimize the structure of circuits. Experiment results showed that the proposed scheme is capable of real-time authentication.