The fluorescence behaviours of a chemical-sensitive fluorescent molecule 1,2-di[5-methoxy-2-(2-pyridiyl)thiazoyl]ethyne (DMPTE) at different protonation and coordination states were studied. Upon addition of protons, metal ions and other chemicals, the fluorescent states can be switched reversibly. On the basis of the changes of fluorescence output signals from particular wavelengths in response to different combination sets of two particular external stimuli, the entire set of 2-bit Boolean binary logic functions were realized at the molecular level, including PASS 0, PASS 1, YES, NOT, OR, NOR, INHIBIT, IMPLICATION, AND, NAND, XOR, XNOR, and different logic functions were integrated reconfigurably within DMPTE. Besides, starting from the same initial state, a series of three-input logic gates and circuits were also constructed. Furthermore, the stepwise recognition process of DMPTE to different chemical input signals can also be utilized to distinguish different input sequences, thus a molecular keypad lock that authenticates three-digit password entries is indicated.