Home Page
Projects > Picture Encrypt
Picture Encrypt
75% organized
Encrypts text within a picture using a password as a secondary key, requiring it and the exact original picture for decryption.
Rating: 6 (Didn’t turn out as well as I hoped quality wise. See content section about RGB to HSL possibility. Also turns out all my ideas were already existent.)
Project Time: -: 30
Languages: C++
Downloads: No downloads currently available (See any updates below for prior versions)
Sections: Information, Content, Concepts, Notes, Updates, Comments
Good for hiding secret conversations in something that people won’t find suspicious.

I had just read “Digital Fortress” (DF, about cryptography) by Neal Stephens, author of “The Da Vinci Code” (DVC, about Jesus having a wife) and many other such “thriller”/informative niche books. While I found DVC to be excellent, and “Angels and Demons” (A&D, about Knights Templar legends IIRC) to be slightly less so, but still nifty, DF just plain sucked. I often wonder if DVC and A&D are just as horrible to history scholars as DF was to me... anyways, I digress...

DF stressed very often that there is “no such thing as an unbreakable code”, which seemed like bull to me, so I played with it and came up with something. Unfortunately, my idea was first introduced in 1917 as the “one time pad”, which I found out about after writing this program. This basically states you use a random set of data as the key that only you and someone else have, and never use it again. In this case, it’s using a picture, which has the added benefit of not being suspicious. Unfortunately, hiding stuff in pictures also already had a name :-)... Steganography, which I also found out about after I programmed this. But as far as I’m concerned, I came up with this stuff myself, heh.

The basic idea of the algorithm goes something like (it’s been a while...):
  • NewKey=Password padded to 128 bits xored against a constant 128bit key for obfuscation
  • EncodedText=Text message encoded into a 6 bit alpha-numeric encoding with a few extra symbols allowed
  • NewEncodedText=EncodedText xored against NewKey
  • Picks a sudo-random spot in the image to start storing data based upon the original image data and the password as a seed
  • Sequentially xors the lower (least important) 2 bits of each pixel against the next 2 bits of NewEncodedText until NewEncodedText is finished.
  • Randomly flips the lower 2 bits of the non used pixels
By changing non used pixels and starting the string at a random location, it is too computationally expensive to try and get the encrypted message without both the password and the original picture.

One thing I could have done better was use HSL conversion instead of RGB which could have made the final encrypted image look not as “artifacted”. One obstacle to overcome with doing that would have been having to account for color space data loss when converting from RGB to HSL and back, since exact precision must be maintained.

For obvious lossy reasons, while the original image can be in any format, the encrypted image must be a lossless format like PNG or 24+ bit bitmap.

Pictures: (Screenshots to follow later)

Original Image Image with Encrypted Text
Original Image Image with Encrypted Text
Cryptography, image and graphic manipulation
#1 Whenever you think you’ve come up with an original thought, someone else has most likely had it, and there’s a good chance it has already been written/ acted upon /done.

#2 One fortunate advantage of reinventing the wheel, or writing your own classes for things, is that you understand and delve into them far deeper than anyone who is just taught about them, and uses other peoples compilations/results. You might even come up with original approaches on concepts that are better than what’s already out there by not having your mind tainted by “what’s currently right.”
Contact page and removed projects @ 2015-11-20 21:33:18
  1. Email contact has been removed from the Contact page, in lieu of using the forum. Explanation is on the contact page.
  2. I have removed all the projects from my projects page and site map that I will never finish and aren’t far enough along to be of any use to anyone. Most of these were written before I was 13 (in 1997). I had originally intended this site to be a collection of everything I have ever started and done, but I now see a lot of this as useless fluff. Projects removed are:
    • Personal Libraries: Old C++ libraries that are very outdated
    • Picture Encrypt: This was just an image steganography encrypter using the picture as a one time pad. I made this as a kid before I knew image steganography and one-time-pads were things that were already known.
    • WebRoute: This was a Windows file system driver that allowed grabbing files from different directories in tiers. Its functionality is easily matched with symbolic links and apache redirects.
    • FileSync: A visually interactive rsync type program. Rsync is a better solution anyways, and I’m sure frontends for it are out there.
    • File Functions: Old C++ CLI libraries that are very outdated and all have better alternatives out there
    • Web Rich Text Editor: While I was way ahead of the curve on making this, I never polished and released it. There are so many out there nowadays anyways...
    • Midi: This was the very first “large” project I built as a kid (Probably ~11). Essentially, I wanted to create a competitor to what was then the only solution (I think) for creating midis/sheet-music, Cakewalk Studio.
    • Web List Creator: Old and outdated JS library
    • eBay Content Creation: An old project I never finished, which was used to quickly create eBay pages with widgets and precompiled graphical designs.
    • RubixSolver: A program I never even really started to implement due to technological constraints of the time.
    • Icon Run: A novel gimmick from when I was very young that I never got working very well
    • MP3 Tagger: Pretty useless old program that uses a file format trick I should not have utilized in the first place
    • Logic Puzzles: Silly knock-offs of puzzles from the game Journeyman 2 (you have to be pretty old to remember these)
    • File Sender, QuickChat, Collage Maker: Outdated with much better solutions out there
    • College Crap, QBasic Crap, Highschool C++ Class: Like they say, old useless crap
    • Process Saver, All-In-One Networking Kit: Programs I never even got started
  3. I added MySQL replication ring status reporting script to the Other Web Scripts page
To add comments, please go to the forum page for this project (guest comments are allowed for the Projects, Posts, and Updates Forums).
Comments are owned by the user who posted them. We accept no responsibility for the contents of these comments.

No comments for this Project