The efficacy of a miniaturized unimolecular analytic system is illustrated. The easily accessible therapeutic chromophore “temoporfin”, which responds differentially to bound metals at multiple wavelengths of Q-band absorption using chemometric analysis, expeditiously detects and discriminates a wide range of metals regarded as priority pollutants in water and hence may also be used for diagnosis of medically relevant metals in human urine. The molecule was further investigated as an electronic logic device, e.g. keypad lock device, to authorize multiple highly secure chemical passwords for information protection.