We propose an optical security technique for image encryption using triple random-phase encoding (TRPE). In the encryption process, the original image is first double-random-phase encrypted. The obtained function is then multiplied by a third random-phase key in the output plane, to enhance the security level of the encryption process. This method reduces the vulnerability to certain attacks observed when using the conventional double random-phase encoding (DRPE). To provide the security enhancement of the proposed TRPE method, three attack cases are discussed: chosen-plaintext attacks, known-plaintext attacks, and chosen-ciphertext attacks. Numerical results are presented to demonstrate feasibility and effectiveness of the proposed method. Compared with conventional DRPE, the proposed encryption method can provide an effective alternative and has enhanced security features against the aforementioned attacks.