We present a generalized theory for describing encryption and decryption by using the double random phase encoding (DRPE) technique under the framework of the Collins diffraction transform formalism. The theory covers to a variety of diffraction domain which includes the Fourier domain (conventional 4f-optical processor), the Fresnel domain and the fractional Fourier transform (FRFT) domain. From the theoretical basis developed in this work, we present novel optical DRPE systems such as Gaussian imaging DRPE, inverse operation DRPE and Fresnel diffraction DRPE systems, which are plausible to implement. It is shown that the maximum number of degrees of freedom (or independent design parameters) of proposed DRPE system increases four times, when compared with the conventional 4f-optical system, which guarantee much more secure encryption and decryption.