For some specific fields, such as medical and military fields, image distortion is unacceptable. Therefore, after extracting the hidden data, the medical image must be completely restored. Such methods are referred to as Reversible Data Hiding (RDH) methods [4; 5; 6; 7]. When reversibility is applied to encrypted images, it is called the RDHEI method [8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32].  
[PERSON]'s scheme [25] encrypts the most significant five bits (MSB) in the original pixel through XOR operation with the random bit stream. Later, it compresses the least significant bit (LSB) of the encrypted image to create space for embedding the secret. However, the embedding rate of the test image \"Lena\" is very low, only 0.017 bpp (bits per pixel). The decrypted image is similar to but not the same as the original image. [PERSON] et al. [11] applied side matching information to improve the quality of restoration, which is about 1.21% higher than [PERSON]'s [25]. [PERSON] et al. [16] used a progressive method to achieve concealment and recovery quality of 0.043 bpp and 38.1 dB, respectively. To increase confidentiality, [PERSON] [33] generated two different keys to encrypt images and hide messages in images; the keys were then distributed to different authorized users.  
To achieve reversibility, [PERSON] et al. [14] proposed a reversible data embedding scheme utilizing histogram shifting technology in encrypted images. [PERSON] et al. [17] used error correction codes in Huffman coding to increase the amount of hidden information. Based on the pixel concept, which is similar to surrounding pixels, [PERSON] et al. [8] compressed the image to make room for data embedding. However, the spatial correlation changed after the image was encrypted [12]. To resolve this shortcoming, [PERSON] et al. [12] unitized a key design to maintain the spatial correlation even after image encryption. [PERSON] et al. [32] predicted pixels using neighboring pixels for secret embedding. Unfortunately, the pixels could be fully restored. In order to improve the security, the scheme [10; 30] uses homomorphic encryption to encrypt the image. However, the scheme in [10; 30] has low hiding capacity and encounters the problem of pixel expansion. Using the histogram shifting technique, [PERSON] et al. [12] regard the MSB as the secret embedded in the LSB of the encrypted block.  
To increase the hiding capacity, [PERSON] et al. [22] utilized parameter binary tree labels to mark the redundant relationship between pixels and blocks. In [PERSON] et al.'s scheme [22], the average hidden payload displayed based on the \(2\times 2\) and \(3\times 3\) block sizes were 1.752 and 2.003 bpp, respectively. [PERSON] et al. [24] observed that the MSB of the original pixel and the predicted pixel are usually the same, which can be used to make room for secret embedding. In addition, Huffman coding is applied to reduce the size of the indicator, which is used to indicate the number of MSBs that can be leveraged to embed secrets per pixel. [PERSON] et al.'s scheme [24] provides good pixel predictions to improve the hidden payload. However, an image encrypted through MSB prediction is easily decoded through statistical analysis [34]. To address this issue, a hiding and encryption method [35] integrated with Hamming coding is proposed in this paper. The MSB prediction can be shuffled using Hamming coding with a secret key. To achieve good pixel prediction, the proposed scheme designs two thresholds used in [24] to flexibly adjust the predicted value to be close to the original one. To improve the hiding capacity of the technique in [35], the Hamming code encoding is based on two different image types: smooth and complex images.