Compression and encryption/decryption are necessary for secure and efficient storage and transmission of image data. We present an optical encryption technique that takes advantage of both the massive parallelism inherent in optical systems and the flexibility offered by digital electronics. The encryption is performed using a phase mask and Fresnel propagation. We nonunifomily quantize the complex-valued encrypted hologram pixels using an artificial neural network. The in-line digital holograms of three-dimensional objects were created using phase-shift interferometry. With our lossy data compression technique we achieved good quality decryption and reconstruction from objects with a compression ratio of 32.