Systematic design of a family of attack-resistant authentication protocols