LSB Image Steganography

Developed or developing a new product in PureBasic? Tell the world about it.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: LSB (Least Significant Bit) File Embedding

Post by walbus »

I have forget.
Bevore padding come also a randomized IV with 16 Bytes for the AES CBC Code.
Now you can mace pictures with hidden content which are in each Byte other, but all with the same content and all in the same picture and all looking same.
Nobody can compare this pictures for exploring your method or content.
Last edited by walbus on Mon Nov 23, 2015 4:16 pm, edited 1 time in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: LSB (Least Significant Bit) File Embedding

Post by JHPJHP »

Hi walbus,

Thank you for the additional information, it should benefit anyone wanting to create their own similar type application.

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

Updated:
- added bit selection from the bit-indicator
- added additional error handling
- enabled the threadsafe switch

NB*: Update also includes a small bug fix.
Last edited by JHPJHP on Tue Feb 27, 2018 5:18 am, edited 1 time in total.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: LSB (Least Significant Bit) File Embedding

Post by walbus »

Hi JHPJHP,
what you think for making additional a progress bar for looking the available free space for the hidden files ?
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: LSB (Least Significant Bit) File Embedding

Post by JHPJHP »

Hi walbus,

Are you speaking for your application or mine?

If you're referring to my application it's a good idea, but would only apply if I modified the code to allow multiple embedded files in a single bit, or large embedded files to cross bits.
- currently each bit can hold the MAX EMBEDDED SIZE calculated from the number of pixels in the loaded image

If I've misunderstood your idea please elaborate.

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

Updated:
- added Drag & Drop
- added a context menu item: Set Window Top (default)

Drag & Drop
- drag files onto the image (max. 8 files)
- more than 8 files and the operation is cancelled
- folders will be ignored
- previously embedded files are overwritten without prompt
- press the "Reset Image" button to return to the previous state
Last edited by JHPJHP on Tue Feb 27, 2018 5:35 am, edited 1 time in total.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: LSB (Least Significant Bit) File Embedding

Post by walbus »

Yep, sorry, i have not looking your code.
But, a other way, i think, is available.
You can make from my code and your code a new thing, with all features are possible.
I use for each RGB pixel 8 bit, as sample 2-3-3, this bits i mixed with random - as sample : 3-2-3 3-3-2 2-3-3 This fix moire, color distortion and you can make a lot hidden bytes in a picture.
My code is tricky, very little and simple.
For this we must write with PN, you want.
You make a very good job and we can make a amazing tool within, i think.
Last edited by walbus on Wed Nov 25, 2015 11:57 pm, edited 1 time in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: LSB (Least Significant Bit) File Embedding

Post by JHPJHP »

Updated:
- included type BMP (Bitmap Image) to the Save Requester
- added an ADS (Alternate Data Streams) Procedure
- fixed the OpenImage Procedure to use the correct plugin

Tested code with a large image (8000 x 4000 x 24):
- saving it as a PNG takes a considerable amount of time
- saving it as a BMP is quick, but the size of the saved image is considerably larger
- switch the "save as type" to suit your requirements

ADS (Alternate Data Streams)
- I'm using this method to save the Window State (StickyWindow status) to the default image
Last edited by JHPJHP on Tue Feb 27, 2018 5:36 am, edited 2 times in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: LSB (Least Significant Bit) File Embedding

Post by JHPJHP »

Updated:
- added a context menu item: Enhanced Bit View
-- can also be opened by double-clicking the image while holding down the shift key

Enhanced Bit View
- a visual test to try and determine if an image contains a hidden file or message
- ignoring all but the value of the selected bit, the byte is set to 0 or enhanced to 255

The image content should be used to narrow down the type of discrepancies to look for.
- too much noise, unusual noise, or some sort of pattern
- unusual pixel alignments that seem out of place
- solid colors or lack thereof are a good place to start

It can take a practiced eye to know what to look for.
- this can be developed by comparing the differences between images before and after embedding

NB*: Update also includes some minor cosmetic and other changes.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: LSB (Least Significant Bit) File Embedding

Post by JHPJHP »

Updated:
- added a context menu item: Convert Image to JPEG
- various cosmetic and other changes

Convert Image to JPEG
- I noticed that an image with the LSB modified will closely return to its original state when saved as a JPEG
- comparing the image in question with a copy saved as a JPEG can assist with determining if it's been compromised

If a small file is embedded into a large image, an Enhanced LSB visual test most likely won't reveal anything; a statistical analysis is required.
- if I can find the time and the interest I may add some sort of statistical analysis via the Chi-squared test

NB*: This option is only available if the loaded image is not already a JPEG, or if the JPEG recently had a file embedded into the active bit.
Last edited by JHPJHP on Sun Nov 29, 2015 10:17 pm, edited 1 time in total.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: LSB (Least Significant Bit) File Embedding

Post by walbus »

Very nice !
Now, it is ever available localize hidden data in a LSB picture.
I self say, OK, i can not absolutely hidden, but you can not say what you found, or if you have ever found something.
You see, but you see absolutely nothing.
Nobody on this world can extract the hidden data from QAES, or can say, i have found hidden data.
Each same picture with the same hiddden content looking same, but each from this same pictures are different on each byte.
Last edited by walbus on Fri Jan 22, 2016 2:38 pm, edited 1 time in total.
User avatar
Keya
Addict
Addict
Posts: 1891
Joined: Thu Jun 04, 2015 7:10 am

Re: LSB (Least Significant Bit) File Embedding

Post by Keya »

Chi-squared test sounds great! google suggests nobody has done it in PB before :)
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: LSB (Least Significant Bit) File Embedding

Post by walbus »

JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: LSB (Least Significant Bit) File Embedding

Post by JHPJHP »

Hi Keya,

I've always meant to get back to this, anyways nice job applying the Chi Squared Test; I still may get around to applying a version of it to this project.

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

Hi walbus,

Yes that was a good read.

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

Based on comments from wilbert (Spider Web Drawing) I've updated the code and binaries for better cross-platform compatibility.
Last edited by JHPJHP on Tue Feb 27, 2018 5:19 am, edited 2 times in total.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: LSB (Least Significant Bit) File Embedding

Post by walbus »

Many thanks JHPJHP.
You make fantastic, cool, usefull and very helpfull things.
And your new Spider Web Drawing is very impressive !
http://www.purebasic.fr/english/viewtop ... 12&t=65601

Best regards Werner
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: LSB (Least Significant Bit) File Embedding

Post by JHPJHP »

Hi walbus,

Thank you again for your kind words.

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

Updated for better compliancy between platforms.
- based on comments from wilbert and idle (Spider Web Drawing)
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: LSB (Least Significant Bit) File Embedding

Post by JHPJHP »

Updated:
- added encryption
-- Header / Bit Security window will open when the application is first executed
-- Header / Bit Security window can be opened from the context-menu
-- if a password field is left blank then the default password is used

There are two points of encryption...

Header Password:
- set once for each image container
- set before any file has been embedded or the default password used

Bit Password:
- can be set for each embedded file (8 bits / 1 bit per file)
- set before embedding a file otherwise the previous or default password is used

NOTE:
- dragging & dropping multiple files will use the previous or default password
- passwords cannot be changed on embedded files, but files can be re-embedded with a different password

NB*: Bit capacity can be increased by compressing (zip, rar, 7z) multiple files before embedding.
Last edited by JHPJHP on Fri Oct 14, 2016 4:15 pm, edited 2 times in total.
Locked