Photoelectric imaging systems usually pursue a small-sized point spread function (PSF) to acquire high-quality images, but it also poses safety hazards for the camera in certain scenarios. For instance, ultrahigh intensity light focused on the sensor may cause irreversible damage when the camera is subjected to unexpected laser irradiation. Furthermore, clear images captured are vulnerable to privacy breaches during online transmission. In this paper, we report a concept of the OpSecureCam with protection capability versus both laser damage and privacy breaches via PSF engineering. The design recipe of the PSF with simultaneous enhancements in energy spread ratio and information flux is derived. An end-to-end framework is developed under theoretical guidance to jointly optimize the PSF and the decoding network, maximizing both protection capability and imaging quality of the OpSecureCam. A wavefront coding system is built to realize the concept, wherein the pupil phase distribution is obtained through a hybrid phase retrieval method based on Gerchberg-Saxton and stochastic gradient descent algorithms. Experiment results demonstrate that the OpSecureCam reduces the peak intensity of the jamming laser on its sensor by 99.73%, while the encoded images are robust against various blind deblurring methods. After being decoded by the matched network, the intricate structures of the image are restored with high quality for target identification or information extraction, including text, QR code, and human face. Our work offers a compact and efficient solution to enhance the adaptability of imaging systems, which holds potential for applications in autonomous driving and security monitoring.