With the growing number of sensor nodes at edge devices, it is critical to guarantee the security of private data transmitted over the Internet of Things (IoT), especially in image and video applications. Traditional software‐based encryption schemes are vulnerable to advanced attacks based on machine learning or quantum computing, leading to the exploration of hardware‐based solutions. This study proposes a novel in‐sensor encryption technique using a perovskite photodetectors (PDs) array to integrate image acquisition and encryption functions within a single hardware platform. The technique exploits the inherent physical disorder and randomness of perovskite PDs to provide an optimal source of entropy for the generation of cryptographic keys. The MAPbI3 perovskite PDs array is fabricated by a convenient method and passivated by thioacetamide (TAA) to improve the performance in photoresponsivity, response time, spectra response, and stability, enabling sensitive imaging and reliable key generation. The improved perovskite PDs array exhibits remarkable optoelectronic properties and stability, highlighting its potential for in‐sensor encryption and the creation of trustworthy hardware security systems for imaging terminals.