Image obfuscation

I want to distribute several images and not let others see them if they are not using my program. My intention will be to use JPG files in which I will change the title so that other image viewers can no longer read them. For example, I can remove bytes 7-10, which are the magic signature for JPG. Later, my program will restore the title and show the jpg file.

Question: how can I do this on the fly without reading the β€œbroken” JPG file, restoring the header, saving the good file to disk, and then reloading it as a β€œgood” JPG file?

+6
image delphi jpeg
source share
6 answers

Load the broken file into TMemoryStream, fix the bytes in memory and use TGraphic.LoadFromStream () to load the fixed JPG file.

+16
source share

Encrypt them. Download the encrypted image, decrypt it in memory, and then execute loadfromstream, as mghie suggested.

+6
source share

Why not just encrypt the images with your private key and distribute the public key to the people you want to view? It is much easier to distribute the public key than to write some special software and distribute it. Do not forget; everything that is displayed on the screen can be captured by the screen. The fact that custom JPEG can only be displayed with your application is not protection. Also do not forget; People can simply distribute your distorted image software.

+4
source share

Mghie's answer is about as good as you find, but it is unlikely to be too effective. If someone wants to see your images and they don’t know anything about image formats, they will open it in a hex editor and most likely they will see what they see as JPEG with the magic header removed.

If you really want someone to view your images, create your own image format (it’s not as difficult as it sounds) and put as little metadata as possible, and then hope that it works. Either encrypt them or archive them (create your own archive format for best results) and hope that it works.

Ultimately, in the end, everything encoded must be decoded before it is shown, and any talented hacker can trace the path through your decoding procedure and find out how it works. Why are you still trying to hide things from your users?

+2
source share

You may have difficulty for them, bytes pack images into encrypted resources. But, like everything else, if they have access to files that can receive images. It only depends on how much effort you are ready to use.

+1
source share

Depending on how securely you need it, you can do something as simple as obfuscating a file extension to an extension that only opens with your application. This will only work if your top-secret images that you change.

0
source share

All Articles