Binary representation is a popular privacy-preserving biometric recognition approach. However, it is vulnerable to similarity-based reconstruction attacks (i.e., similarity attacks) due to its similarity-preserving property. In this paper, the cause of this security threat is studied, a sufficient condition for secure anti-similarity-attack hashing (ASAH) is derived, and the definition of the ASAH manifold is provided. Moreover, a general framework is proposed for employing a statistical manifold to locate a secure hash function in a given hash function family. Specifically, a secure hash function can be obtained by finding the point that is closest to the ASAH manifold in the hash function family manifold. A generalized expectation-maximization-based algorithm is then developed to optimize this process. In addition, a case study is presented to clarify the implementation details of the aforementioned algorithm. In particular, an ideal ASAH submanifold is constructed through random generation to enhance the feasibility of the proposed framework, enabling ideal hash code generation. In addition, the generative adversarial network framework is adopted to generate high-quality hash codes; the distribution of these hash codes is close to that of the ideal hash codes. We perform experiments on public biometric datasets to verify that our approach can achieve both superior recognition performance and higher security under reconstruction attacks.