We propose a novel method to achieve the purpose of hierarchical authentication based on two beams interference. In this method, different target images indicating different authentication levels are analytically encoded into corresponding phase-only masks (phase keys) and amplitude-only masks (amplitude keys) with the help of a random phase mask, which is created in advance and acts as the fixed lock of this authentication system. For the authentication process, a legal user can obtain a specified target image at the output plane if his/her phase key, and amplitude key, which should be settled close against the fixed internal phase lock, are respectively illuminated by two coherent beams. By comparing the target image with all the standard certification images in the database, the system can thus verify the user’s identity. In simple terms, this system can not only confirm the legality of a user but also distinguish his/her identity level. Moreover, in despite of the internal phase lock of this system being fixed, the crosstalk between different pairs of keys hold by different users is low. Theoretical analysis and numerical simulation are both provided to demonstrate the validity of this method.