Malicious users can launch denial-of-service attacks to any hash-based application by enforcing continuous hash collisions. In this paper, we propose a generalized attack-resistant hashing algorithm that is immune to these attacks. Experimental results show that our secure hashing algorithms are efficient and robust against hash collision attacks.