Editorials

Encrypting In An Image

Encryption is one of the hardest things to do in a way that can’t be decrypted by a hacker. So, if you can do one way encryption, that’s a real plus. But, when you need to have something you can decrypt, the problem is more difficult. I wrote about this quite a bit a few weeks back. Today I wanted to circle around and talk about a couple of really weird encryption methods that work for smaller things needing encryption.

Years ago I remember reading in a developer magazine, I don’t remember which one, or who was the author, about encrypting data inside of something that was a binary object that could be rendered in a way that it made sense. For example, you could use a bitmap image such as a jpeg file or any file type for that matter, and using an algorithm, alter bytes in the image, injecting bytes (or even bits) from the data you are wanting to encrypt. If the ratio of data to encrypt is small enough, the modifications to the image would be so minute the human eye would probably not recognize the change.

An alternative would be to use a movie file, because it is much larger, or even a music file. Again, the altered bits would not be changed enough to alter the contents in a way that the modification would be noticeable. Think of how you have a difficult time hearing the difference between music with different sample rates. After a while, even though the quality is much higher, the ear cannot differentiate the difference, or we would simply think the quality of the sound file is low, not that it is hiding something.

So, if you have a really small amount of data to encrypt, the smaller the digital image or sound byte needs to be. You don’t want to encrypt a 10 character password into a 50 meg image.

Maybe you combine encrypting your data with an SHA 256 and then store that encrypted data in an image. Then you can print them out and use them for wallpaper, or reCaptcha prompts (maybe that isn’t as funny as I think it is).

Well, now you have something to play with.

Cheers,

Ben