Page 1 of 5

LSB Image Steganography

Posted: Tue Nov 17, 2015 6:33 pm
by JHPJHP

Re: LSB (Least Significant Bit) File Embedding

Posted: Tue Nov 17, 2015 8:27 pm
by juror
Nice.

Another fine share :D

Re: LSB (Least Significant Bit) File Embedding

Posted: Tue Nov 17, 2015 8:52 pm
by davido
Very interesting and instructive.
Thank you for sharing.

Re: LSB (Least Significant Bit) File Embedding

Posted: Tue Nov 17, 2015 10:39 pm
by Kurzer
Cool JHPJHP!

This looks like my abadoned project "ImageStega".
I tried to write a tolerant LSB encoding and encryption system using last the 1 to 4 bits and a encryption key which will survive a JPG compression. But unfortunately I lost the motivation.

Nice to see a working pendant. :D

Image

Re: LSB (Least Significant Bit) File Embedding

Posted: Wed Nov 18, 2015 12:52 am
by walbus
Very nice,
But, it is not so simple 8)

Looking the picture analyse.
Typical is the moire and the defined location.


Image

Re: LSB (Least Significant Bit) File Embedding

Posted: Wed Nov 18, 2015 3:33 am
by JHPJHP
Hi juror, davido,

Thank you for posting your comments, they are very much appreciated.

-------------------------------------------------------

Hi kurzer,

ImageStega looks very good with some nicely added features.

All my posted projects were done for the fun of programming, maybe someday you'll return to ImageStega for the same reason.

Thank you for your comments.

-------------------------------------------------------

Hi walbus,

Looking at the image you posted, I think the problem was embedding to an 8 or 16 bit image, where the minimal requirement is 24 bits.

Please download and test the updated version, posting your results.

Thank you.


-------------------------------------------------------

Updated:
- added code to test for bit-depth
-- minimum requirement: 64 x 64 x 24 (width x height x depth)

NB*: Some additional improvements have been made, but nothing worth documenting.

Re: LSB (Least Significant Bit) File Embedding

Posted: Wed Nov 18, 2015 10:17 am
by walbus
Yep, the results are equal.

You musst fill the picture complete, and you must mixed the bits with random about patterns or moire.
And encrypt the data before you hidden these.

So, nobody can extract a content from a picture in my quick-aes-256 tool, it is absolutely impossible.
You see only a noise, but nobody can define what this is.

Re: LSB (Least Significant Bit) File Embedding

Posted: Thu Nov 19, 2015 7:03 am
by JHPJHP
Hi walbus,

Sorry I'm not sure I fully understand what you're reporting...

Is the application not working with some images?
- if so please post a link to the images in question

Was it an observation that hidden data using this method of steganography is less secure without encryption?
- adding encryption and a wider method of embedding (encompassing the entire image) would be fairly simple

There are many steganalysis tools that indicate an image may contain hidden data in the LSB (Least Significant Bit), but my intention was to demonstrate a basic version of security through obscurity. To be honest I was watching an episode of Blindspot where steganography was mentioned and decided to try it myself.

Re: LSB (Least Significant Bit) File Embedding

Posted: Thu Nov 19, 2015 7:03 am
by JHPJHP
Updated: added the option of embedding multiple files into a single image.
- display image is now updated to match changes to the imbedded image (useful for noticing distortions)

Included is a TrackBar Gadget that allows you to change the bit-section you want to store the file into.
- also used to select the file you want to extract

You'll notice the deeper you move up the bit-latter the more noticeable the embedding.
- try adding an embedded file to bit position 7 to see the full (distortion) effect

NB*: Update also includes numerous changes and improvements.

Re: LSB (Least Significant Bit) File Embedding

Posted: Sat Nov 21, 2015 1:17 am
by JHPJHP
Updated:
- added compression to the embedded file (both original and compressed file sizes are displayed)
- spread out the embedded pixels to the entire image
- added a context menu (right-mouse-click image to open)
- added a "Reset Image" button to remove recently embedded information
- added a bit indicator showing used and current bits
- optimized and improved the main algorithms

* Previously an embedded file name was truncated to 48 characters, but has been reduced to 24 characters.

One of the biggest changes to the code from the previous version is a fix to the amount of space available to embed information.
- previously only 20% of an images space was available, restricting the allowed size of an embedded file
- the addition of compression allows for larger embedded files and better security against steganalysis tools

Using the context menu or double-clicking the image opens it in the default viewer allowing for closer examination.
- the image is saved to the temp folder as a JPEG to destroy any embedded information

To better view the spread of pixels embed a file into bit-position 7, then either double-click the image or use the context menu to open it in the default viewer.
- the context menu also includes the functionality of the various buttons

Re: LSB (Least Significant Bit) File Embedding

Posted: Sat Nov 21, 2015 9:59 pm
by JHPJHP
Updated:
- added an additional button / context menu item: Extract All
-- duplicate files will be overridden without warning (does not apply to Extract File)

NB*: Update also includes a fix to the context menu and a few cosmetic changes.

Re: LSB (Least Significant Bit) File Embedding

Posted: Sun Nov 22, 2015 9:27 am
by walbus
It looking now very good.
Except for two things.
The pictures have a start sequence and now a typical moire all over.

Re: LSB (Least Significant Bit) File Embedding

Posted: Sun Nov 22, 2015 5:40 pm
by JHPJHP
Hi walbus,

Thank you for your comments and for taking the time to post them.

I see your point about the start sequence, but I believe the amount security is enhanced by a random spread of pixels compared to a uniform spread of pixels is insignificant against a professional steganalysis tool; used largely to determine by percentage if a file contains hidden data, but not what is hidden.
wikipedia.org wrote:...
many simple steganographic systems simply modify the least-significant bit (LSB) of a sample; this causes the modified samples to have not only different noise profiles than unmodified samples, but also for their LSBs to have different noise profiles than could be expected from analysis of their higher-order bits, which will still show some amount of noise.
NB*: My intention is not to create a complete steganography tool, but to provide the forum a method for creating their own.

--------------------------------------------------------------

Updated:
- added encryption to the header information (algorthiums taken from my post: Services, Stuff, and Shellhook)
- fixed some minor issues including various cosmetic changes
- embedded filenames are now truncated to 32 characters

Re: LSB (Least Significant Bit) File Embedding

Posted: Sun Nov 22, 2015 6:59 pm
by walbus
Many thanks JHPJHP,
you have maked a very good thing.

You want see patterns or moires, use a simple way.

Make a white picture, now increase the contrast and change the brightness.
Repeat this often.

This is very helpfull for debugging and optimization.

My way is, i make a container.
To time i include one hidden file.
But is it simple for making automatic a ZIP container for including in the picture,
or i use my File Merge function automatic before.

My way is :
I make a empty space, fits of maximum hidding size in the image.
But important, the space for the content with a padding divisible by 16 , minus 16.
I fill the rest with randoms.
Now you always know how big your container is.
Now copy all content in this container.
You can or must now (very simple) including in the container all what you want - Size of content, a hash from the content for a automatic authentication.
Now encrypt this divisible by 16 container with AES.
The litle rest are randoms, it looking same as the container.
Now you have a exactly in your image matching container, consisting only of white noise.
All patterns and moires, headers or extenders are gone.
For decrypt all, now extract simple your container from the picture and make a AES decrypting from it.
Extract then your content from the container (ZIP file or/and all other)
This size is now simple, also the content, including paths and all over.

Best regards Werner

Re: LSB (Least Significant Bit) File Embedding

Posted: Sun Nov 22, 2015 10:57 pm
by JHPJHP
Hi walbus,

Thank you for the information, your methods are very smart.

-------------------------------------------------------

Updated:
- fixed a couple calculations
-- minimum image size is no longer restricted by width / height
-- embedded file spread is more accurately calculated to fill the entire image
-- text area information better represents the available file sizes