A lensless optical security system based on double random-phase encoding in the Fresnel domain is proposed. This technique can encrypt a primary image to random noise by use of two statistically independent random-phase masks in the input and transform planes, respectively. In this system the positions of the significant planes and the operation wavelength, as well as the phase codes, are used as keys to encrypt and recover the primary image. Therefore higher security is achieved. The sensitivity of the decrypted image to shifting along the propagation direction and to the wavelength are also investigated.