In this study, based on attribute and password, we introduce a new kind of two-factor authentication protocol that has various applications such as anonymous authentication and privacy protection. Specifically, our proposal is constructed by introducing password authentication into the generic framework of attribute-based authentication. Consequently, it not only achieves two-factor authentication, but also enjoys the advantages of attribute authentication and password authentication simultaneously. Furthermore, to formally evaluate the security of the proposed protocol, we present the corresponding security model, within which the detailed security proof of the proposal is given. Copyright (C) 2014 John Wiley & Sons, Ltd.