Due to their appealing properties, nanomaterials have become ideal candidates for the implementation of computing systems. Herein, an optical keypad lock based on a Förster resonance energy transfer (FRET) nanodevice is developed. The nanodevice is composed of a green-emission quantum dot with a thick silica shell (gQD@SiO2) and peripheric blue-emission quantum dots with ultrathin silica spacer (bQD@SiO2), on which 5,10,15,20-tetrakis(4-sulfophenyl)porphyrin (TSPP) is covalently linked. The nanodevice outputs dual emission-based ratiometric fluorescence, depending on the FRET efficiency of bQD–porphyrin pairs, which is highly sensitive to the metalation of TSPP: values are 59.7%, 44.8%, and 10.1% for bQD–Zn(ii)TSPP, bQD–TSPP, and bQD–Fe(iii)TSPP pairs, respectively. As such, by using the competitive chelation-induced transmetalation of TSPP, the nanodevice is capable of implementing a 3-input keypad lock that is unlocked only by the correct input order of Zn(ii) chelator, iron ions, and UV light. Interestingly, the reversible transmetalation of TSPP permits the reset (lock) operation of the keypad lock with the correct input order of ascorbic acid, Zn(ii), and UV light. Application of the nanodevice is exemplified by the construction of paper and cellular keypad locks, respectively, both of which feature signal readability and/or high resettability, showing high potential for personal information identification and bio-encryption applications.