With the growing demand of cloud storage for user privacy protection, RDHEI(Reversible Data Hiding in Encrypted Images), as a technology that can embed secret information in encrypted domain, has attracted more and more attention. A good RDHEI method expects to find the best balance between the number of erroneous extracted bits of the secret information, the embedding rate and the quality of the reconstructed image after data-extraction. General RDHEI methods ensure that the embedded secret information can be extracted without error and the original plaintext image can be restored losslessly, thus the embedding rate is the key index to evaluate the performance of an RDHEI method. This paper proposes an effective reversible data hiding method in encrypted images via an adaptive Huffman Encoding strategy, which utilizes diverse Huffman codewords for various images to free up space to accommodate secret information. The proposed method follows EPE-HCRDH(High-Capacity Reversible Data Hiding with Embedded Prediction Errors) method and is an improved method based on MPHC(multi-MSB Prediction and Huffman Coding) method, which provides a high-security level to protect the original image content. Firstly, by exploiting the correlation between the pixels of a natural image, each pixel can be predicted by its neighbors, so as to obtain the entire prediction image. Next, from MSB(Most Significant Bit) to LSB(Least Significant Bit), the same number of bits between each pair of original and predicted pixels is identified and stored in a label map. Then, the label map is compressed by adaptive Huffman encoding with diverse codewords for various images. Using an encryption key, the original plaintext image is encrypted with stream cipher, and the compressed label map is embedded into encrypted image. Finally, according to the extracted label map, after using a data-hiding key, multi-bit secret information can be embedded adaptively in each encrypted pixel through multi-MSB substitution. Due to the reversibility of Huffman encoding and decoding, the secret information can be extracted error-free and the original plaintext image can be restored losslessly by MSB prediction. For different keys, image-recovery and data-extraction can be performed separately. Compared with the experimental results of several state-of-the-art methods, the proposed method has better security performance and achieves higher embedding rate. The average embedding rate of the proposed method outperforms MPHC method 0.09bpp, 0.062bpp and 0.06bpp on three datasets BOSSBase, BOWS-2 and UCID, respectively. In addition, the texture complexity of the original plaintext image has a significant effect on the embedding rate. Generally speaking, smooth images have a satisfactory embedding rate, while texture images have a less ideal embedding rate. For both smooth images and texture images, the proposed method achieves higher embedding rate and outperforms the competitors. On the three datasets, the embedding rate of the proposed method is 0.958bpp, 0.797bpp, 0.320bpp higher than MPHC method in the best case, and 0.01bpp, 0.039bpp, 0.061bpp higher than MPHC method in the worst case, respectively. It is shown that the proposed method of adaptive Huffman codewords encoding has better performance than the MPHC method of predefined Huffman codewords encoding. © 2021, Science Press. All right reserved.