Is there an algorithm or program that can take an image, be encrypted, still be opened by an image viewer, but is restored when decrypted?
Basically I want the ability to secure images but still have them seen as "image files".
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It only takes a minute to sign up.
Sign up to join this communityIs there an algorithm or program that can take an image, be encrypted, still be opened by an image viewer, but is restored when decrypted?
Basically I want the ability to secure images but still have them seen as "image files".
This might come in handy : https://github.com/AtheMathmo/ImageEncryptor
It uses AES in CCB mode so with a key of long enough bitlength, you should have a fairly secure encryption.
I wrote several papers on such a topic. I called it end-to-display encryption. But it is more commonly called "pixel-domain encryption" There are several easy ways to do this. My way included adding a header with RSA encrypted AES Keys.
In essence, you take the picture, extract the pixels, XOR with the bitstream created through AES in Countermode, increase the counter with every iteration, convert that to pixels, save as PNG (important, not jpeg or any other lossy compression, you lose bits with that, and decryption needs every bit to work properly). Thats it. And the same way back.
But sorry, no tool available. But its easy to implement.
I may extend on the thing with the JPEG in the question. Encrypting JPEG in the pixel domain will not work properly. The compression is lossy, so you lose information. There are compression methods on JPG, but they are much more complex, because they work mostly on the DCT factors, not on the pixels itself. These can also be viewed as pictures. That said, its another application field, as i wanted to decrypt pixel streams in the HDMI cable, that would not have worked as intended, or only with much more complex systems.
You could combine encryption and steganography.
Steganography is the practice of concealing a message within another message. There is software available on many platforms that can embed a plaintext or encrypted message inside a jpeg image. Search for steganography.
You could encrypt your first image then embed that encrypted text (it may need to be Base64 depending on the software) into another decoy image.
The second image generally needs to be a bigger image (in terms of complexity, resolution etc.) than the first.
However you should be aware that steganography can be detected with special software but is usually imperceptible to the human eye.