As network applications such as electronic commerce proliferate, complex communications protocols that employ cryptographic building blocks, such as encryption and authentication, will become more common. We view a cryptographic protocol as a process by which information is transferred among some users and hidden from others. The collusion problem determines whether a subset of users can discover, through collusion, the information that is designed to be hidden from them after a protocol is executed. Earlier we introduced a model for cryptographic protocols and its collusion analysis, and solved a special case of the collusion problem. In this paper we present an algorithm that solves the general case.