Homomorphic-Image-Encryption icon indicating copy to clipboard operation
Homomorphic-Image-Encryption copied to clipboard

how to save the encrypted image into .png format

Open zhhhhhh opened this issue 5 years ago • 14 comments

Dear developer,

I want to save the encrypted images into .png format for the further operate the encrypted image. I used to convert the np.array to unit8, but it seems doesn't work, I want to show the encrypted image, the saveEncryptedImg function in ImageCryptography model can save the encrypted image, but when I open it, it shows 'This file format does not appear to be supported'. The decrypted image has the same problem. Can you help me? Thank you very much.

zhhhhhh avatar Jun 23 '20 02:06 zhhhhhh

I have change the value of bitlen to 8, and solve the problem. Thank you!

zhhhhhh avatar Jun 23 '20 03:06 zhhhhhh

I have chosen to save the encrypted object as an array because it works for any key length. By setting the bitlen variable to 8, you have encrypted the image in 8 bits. Larger key lengths provide better security and therefore I had chosen to store it as an array by design.

chronarchitect avatar Jun 23 '20 06:06 chronarchitect

hello, I want to ask ,how to add an image to be encrepted by the code ?

Munirah-kh avatar Jan 12 '21 20:01 Munirah-kh

Could you please help me, I tried to contact you at your email address also. Thank you

Munirah-kh avatar Jan 13 '21 23:01 Munirah-kh

Set the value of n to 8 is ok. 

---Original--- From: "Munirah-kh"<[email protected]> Date: Thu, Jan 14, 2021 07:48 AM To: "chronarchitect/Homomorphic-Image-Encryption"<[email protected]>; Cc: "zhhhhhh"<[email protected]>;"Author"<[email protected]>; Subject: Re: [chronarchitect/Homomorphic-Image-Encryption] how to save the encrypted image into .png format (#1)

Could you please help me, I tried to contact you at your email address also. Thank you

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

zhhhhhh avatar Jan 13 '21 23:01 zhhhhhh

didn't work it damage the image I would like to encrypt the image for further use in ML

Munirah-kh avatar Jan 13 '21 23:01 Munirah-kh

I will send my code for you this afternoon. 

---Original--- From: "Munirah-kh"<[email protected]> Date: Thu, Jan 14, 2021 07:57 AM To: "chronarchitect/Homomorphic-Image-Encryption"<[email protected]>; Cc: "zhhhhhh"<[email protected]>;"Author"<[email protected]>; Subject: Re: [chronarchitect/Homomorphic-Image-Encryption] how to save the encrypted image into .png format (#1)

didn't work it damage the image I would like to encrypt the image for further use in ML

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

zhhhhhh avatar Jan 14 '21 00:01 zhhhhhh

thank you appreciate it, will try it and tell you the result.

Munirah-kh avatar Jan 14 '21 00:01 Munirah-kh

Hello I would like to ask Is this FHE or PHE thank you

Munirah-kh avatar Jan 24 '21 08:01 Munirah-kh

This algorithm is based on Paillier algorithm, which only supports additive homomorphism. You can search 'paillier' for more details.

------------------ 原始邮件 ------------------ 发件人: "chronarchitect/Homomorphic-Image-Encryption" <[email protected]>; 发送时间: 2021年1月24日(星期天) 下午4:08 收件人: "chronarchitect/Homomorphic-Image-Encryption"<[email protected]>; 抄送: "zhhhhh"<[email protected]>;"Author"<[email protected]>; 主题: Re: [chronarchitect/Homomorphic-Image-Encryption] how to save the encrypted image into .png format (#1)

Hello I would like to ask Is this FHE or PHE thank you

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

zhhhhhh avatar Jan 24 '21 10:01 zhhhhhh

This algorithm is based on Paillier algorithm, which only supports additive homomorphism. You can search 'paillier' for more details. ------------------ 原始邮件 ------------------ 发件人: "chronarchitect/Homomorphic-Image-Encryption" <[email protected]>; 发送时间: 2021年1月24日(星期天) 下午4:08 收件人: "chronarchitect/Homomorphic-Image-Encryption"<[email protected]>; 抄送: "zhhhhh"<[email protected]>;"Author"<[email protected]>; 主题: Re: [chronarchitect/Homomorphic-Image-Encryption] how to save the encrypted image into .png format (#1) Hello I would like to ask Is this FHE or PHE thank you — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Could you please send me your code? I also fail to open the png file even setting the bitlen to 8. And if i convert the type of cipher_array to 'uint8' and save as png image. it work but the decrypted img is not the original img. Most pixels in decrypted img is while pixel.

my email is [email protected] Thank you very much!

tianxianhao avatar May 31 '21 13:05 tianxianhao

@zhhhhhh @chronarchitect @tianxianhao

Sorry, I clicked the wrong button and created a new issue, if the project owner sees it, he can delete the wrong issue.

I also have the same problem "convert the type of cipher_array to 'uint8' and save as png image. it work but the decrypted img is not the It works but the decrypted img is not the original img." . How can I convert the type of cipher_array to image and decrypt the original image correctly?

niuniu1230 avatar Jul 07 '21 10:07 niuniu1230

I have change the value of bitlen to 8, and solve the problem. Thank you! Pprogram is compiled but shows no output. Can you please help me. It would be helpful.

Surajkumar573 avatar Nov 16 '22 18:11 Surajkumar573