A portable device with password verification function includes several input units, a storage unit and a processing unit. The input device is configured to receive a succession of digital input signals, each characterized by having high level and low level portions. The photographed image can be correctly matched with the background image through only one-time photographing, even when the shaking of the user’s hand occurs or the object to be photographed moves.