I am doing encryption and decryption of an image using 3DES. After encrypting an image I am not able to see an encrypted image. Can any one please tell me why is this happening? I am using a jpeg image to encrypt. All this process has been done in Java.
5
votes
If you encrypt the file, not the image data itself, the output clearly won't be an image anymore. Raw encryption output looks like random bytes, and those are very rarely valid images.
– CodesInChaos
Yes you got it right @CodesInChaos. But I was looking forward to display that image in User interface. Will it be possible??
– user2194175
With a bitmap(or some other lossless format like png) instead of jpeg, you could apply encryption the the actual pixels.
– CodesInChaos
I just have tried the same with bitmap image, still encrypted image is not visible.
– user2194175
Don't encrypt the file. Encrypt the pixels. For this you need to first load the file, and then encrypt the buffer which contains the pixels.
– CodesInChaos