How to use Steganography in Xojo?

Has anyone used Steganography to store information within an image? I need to write a project for Windows and Mac for a client that wants to be able to store extra information (about 2000 to 3000 characters) within image files. The files will always be JPG images but will be different each time.

That is not difficult.
You could have picture and use RGBSurface to access pixels. Than alter colors, e.g put in lowest bit of red one bit of the text.
Save as png not JPEG!

I love the way you say that it isnt difficult when you already lost me in the two sentences you wrote :wink: Any chance I could pay you to a it to your plugin?

that should be “add it to your plugin”

Let me take a look into this tonight

Great, thanks.

Just for culture :

http://en.wikipedia.org/wiki/Steganography

I thought only BMP would lend itself to Steganography…
In a JPG you can alter bits… but when it recompresses, you lose specific bit level content.
and if you twiddle bits in a pre-compressed image, you might break the RLE encoding

Any loss less format will do. PNG, BMP, TIFF (without JPEG compression).

per the OP

For JPEG; it’s even easier by embedding stuff in the JPEG file.
I did that in other projects.

for JPEG with next plugins (14.2pr9) you can do:

[code]dim j as new JPEGExporterMBS

j.Picture = LogoMBS(500)
j.Markers(5) = “Hello World”
j.File = SpecialFolder.Desktop.Child(“test.jpg”)
j.Export

// now open jpeg file in text editor and you see hello world near beginning[/code]

This will embed a given string in the file. You can encrypt data and store it there as you like.
Of course this will not survive if image is loaded and saved again. But can work as a container to hide data and user sees only image.

[quote=94688:@Christian Schmitz] j.Markers(5) = “Hello World”
[/quote]

I tried to add MBS Xojo JPEG Plugin.xojo_plugin and run, but

This triggers a ‘This item does not exist’ error.

Mac OS X command line :

cat image1.jpg text.txt image2.jpg > image.jpg

image1.jpg and image2.jpg are identical.

the resulting image.jpg can be opened in TextEdit and shows the text in the middle of the new picture gibberish. Seems possible instead of clear text to insert an encrypted message, surrounded by tags which allow extraction of the significant part for decryption.

I think the point is to insert a message without anyone being able to tell that anything at all had been done to the picture.

For example, the image below has an unencrypted message in it, but a cursory examination of the file wouldn’t tell you that.

The message, btw, is “Now is the time for all good men to come to the aid of their country!”. It’s encoded in the least significant bit of each Pixel.Blue starting at 0, 0 and moving horizontally. It’s terminated with a null.

In short, read the first eight Blue values and use the last bit to assemble a byte. Repeat until the byte = 0, then join the characters and define the encoding.

How does that fair with a lossy compression, such as JPEG or PNG?

[quote=94713:@Michel Bujardet]I tried to add MBS Xojo JPEG Plugin.xojo_plugin and run, but

This triggers a ‘This item does not exist’ error.[/quote]
you need 14.2pr9 plugins.

No mention of that on your site ?

there
http://www.mbsplugins.de/archive/2014-06-03/MBS_Xojo__Real_Studio_Plugins_