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?
Mason wheeler
source share