Broadband photodetectors covering ultraviolet (UV) to near-infrared (NIR) wavelengths play an essential role in communications, imaging, and biosensing. Developing a single photodetector with a broadband optical response operating at room temperature can significantly reduce the complexity and cost of receiver systems for multispectral applications. In this work, utilizing the porous structure characteristics of Cs2AgBiBr6:Sn thin films, a self-powered detector with broad spectral response (UV-vis-NIR) was achieved by constructing an effective Cs2AgBiBr6:Sn/PDPP3T heterojunction. This photodetector possesses a broad response spectrum from 350 to 950 nm with an average detection rate exceeding 1011 Jones and maintains excellent photoelectric performance over two months. Sn2+ doping effectively reduces the bandgap of Cs2AgBiBr6, enhancing its near-infrared absorption and optimizing energy level alignment with conjugated polymer (diketopyrrolopyrrole-terthiophene, PDPP3T). More importantly, the porous structure derived from Sn doping significantly improves carrier extraction and transport under a near-infrared light response at the heterojunction interface. Utilizing its broad spectral response characteristics in the UV-vis-NIR range, a novel information transfer and encryption system employing full optical modulation has been realized within a single perovskite photodetector. This work provides a new approach to fabricating lead-free double perovskite broadband photodetectors with potential applications in photonic devices.