I have tried to encrypt an image using paillier. But I can't decrypt it. Please help me to findout.
from phe import paillier
from PIL import Image
import cv2
import PIL
import numpy
openfilename = "greyscale.png"
img2 = cv2.imread(openfilename,0)
public_key, private_key = paillier.generate_paillier_keypair()
encrypted_number_list = [[public_key.encrypt(int(x)) for x in row] for row
in img2]
encrypted_number_array = numpy.array(encrypted_number_list)
print(encrypted_number_array)
decrypted_number_list =[private_key.decrypt(x) for x in
encrypted_number_array]
decrypted_number_array = numpy.array(decrypted_number_list)
print(decrypted_number_array)
Here is the image I am using:
Image encryption/decryption with pailer: