In this paper, the function of parallel encrypting multiple images and reproducing arbitrary layers of images is realized by improving the double pupil function in optical scanning holography. In an optical scanning holography (OSH) system, a dual-pupil heterodyne incoherent image processing technique is used to record holographic images. By adjusting the two pupil functions in the optical system, the interference fringes can be modified to achieve different imaging effects. In this paper, the ring pupil and random phase plate are used to act as two pupil functions to interfere to form a ring random phase plate, and thus realizing the fast scanning of multi-layer images. Then the multi-layer images can be quickly encrypted by one imaging technique. The scanned signals are quickly collected by photoelectric detectors, and they synthesize encrypted holograms by computer. By using the digital holography to decrypt the holograms, the precise reproduction of any layer image can be achieved. The OSH system with random phase pupil is strongly dependent on the longitudinal position of the system in digital reconstruction. The defocusing noise can be converted into random noise and the effect of defocusing layer on imaging can be effectively suppressed. However, in practice, it is necessary to average multiple images to achieve better imaging effect, and the accuracy of random phase plate is required. In this paper, most of the random noise can be filtered with the aid of ring pupil, and all the information about multi-layer graphics can be recorded and reconstructed by one scan. In the process of reconstruction, the influence of defocusing image can be effectively eliminated, and the decryption of any layer image can be realized. This method collects encrypted image by photoelectric detector, and does not need complex algorithm reconstruction nor phase iteration, which greatly reduces the time expended in the encryption process. In the process of encryption, the key space of the system is increased, and the encrypted image obtained has high security. In this paper, correlation coefficient is used to evaluate the encryption effect of this method, and the effectiveness and security of this method are verified by simulation experiments. For cutting resistance, when 75% of the information is lost, the correlation coefficient can still reach more than 0.5. For the sensitivity of information, the integrity of decrypted image will be seriously damaged when the wavelength and distance shift very little. For the anti-noise ability, under the influence of Gauss noise and salt and pepper noise, the correlation coefficient and image recognition degree are high. This method is very time-saving, and the result of encryption has high security, high sensitivity, strong ability to resist clipping and noise.