To improve the security of encrypted image as well as the quality of decrypted image, this paper proposes a neighborhood-prediction based reversible data hiding method in encrypted image (RDH-EI) which is generated by XOR-permutation encryption. In this paper, XOR-permutation is conducted to encrypt original image, which can reduce the risk of encrypted content disclosure due to the fact that both statistical information and location information of original pixels are hidden. According to the data hiding key, some encrypted pixels are pseudo-randomly chosen for data hiding, and secret information is embedded into the most significant bit (MSB) of chosen pixels by the bit replacement operation. In the image decryption phase, the possible marked pixels are predicted and corrected by comparing the difference between each pixel and its neighborhood average value to improve the quality of decrypted image. In the image recovery phase, for each marked pixel obtained by the data hiding key, five neighborhood templates are designed to compute its fluctuation value, which is used to deduce whether the MSB of it is changed or not. This paper discusses and analyzes the threshold selection, the prediction accuracy and the security of encrypted image contents. Experimental results demonstrate that the proposed neighborhood prediction method can correctly predict at least 96% marked pixels. The proposed RDH-EI scheme can not only enhance the security of encrypted image content, but also improve the quality of decrypted image, evidenced that the PSNR is about 5~23dB higher than the existing similar RDH-EI methods with the same embedded payload.