The invention discloses an encrypted radiation imaging system based on a random thickness liquid mask, which includes an X-ray source, an object to be detected, a liquid metal mask, a thickness control array inside the mask, and an X-ray detector. The thickness control array randomly adjusts the thickness of the liquid mask, realizes random attenuation of the X-rays penetrating the mask, and then encrypts the sensitive information carried in the X-ray imaging, effectively protecting the sensitive information of the items to be inspected, and realizing Encryption measures of physical shielding are used for the energy and position information of the emitted particles, and the proposed security inspection technology encrypts the information carried by the emitted X-rays from the physical field, avoiding the risk of private information being leaked, and will not expose any information about the items to be inspected. For privacy information, the template comparison method is used to facilitate the confirmation of whether the items to be inspected contain contraband, and the security inspection is realized on the basis of protecting the sensitive information of the inspected items.