Image encryption with optical means has attracted attention due to its inherent multidimensionality and degrees of freedom, including phase, amplitude, polarization, and wavelength. In this paper, we propose an optical encoding system based on multiple intensity samplings of the complex-amplitude wavefront with axial translation of the image sensor. The optical encoding system is developed based on a single optical path, where multiple diffraction patterns, i.e., ciphertexts, are sequentially recorded through the axial translation of a CCD camera. During image decryption, an iterative phase retrieval algorithm is proposed for extracting the plaintext from ciphertexts. The results demonstrate that the proposed phase retrieval algorithm possesses a rapid convergence rate during image decryption, and high security can be achieved in the proposed optical cryptosystem. In addition, other advantages of the proposed method, such as high robustness against ciphertext contaminations, are also analyzed.