Sign in to follow this  
BoltBait

Steganography (Hidden Images-secret agenty stuff) v3.0 Updated July 12, 2014

Recommended Posts

Awesome!

I believe if you don't give us the source or the algorithm soon, I know, how I'll spend the next nights. :|

Please share

Suggestion: Add a kind of key number which is needed to decode.

Share this post


Link to post
Share on other sites

Ugly, ugly code--I know. But, once something works, I rarely go back and clean it up. Sorry.

For encoding the image:

if (token.FullColor)
{
   point.R = (byte)((((int)point.R + 18) / (int)36));
   point.G = (byte)((((int)point.G + 18) / (int)36));
   point.B = (byte)((((int)point.B + 18) / (int)36));
   point.R = (byte)(((int)(CurrentPixel.R) & 248) + point.R); // 11111000
   point.G = (byte)(((int)(CurrentPixel.G) & 248) + point.G);
   point.B = (byte)(((int)(CurrentPixel. & 248) + point.;
}
else
{
   ColorBgra srcGrey = this.desaturateOp.Apply(point);
   iColor = srcGrey.R / 32;
   if (( iColor & 4) > 0 )
   {
       point.B = (byte)(((int)(CurrentPixel. & 254) + 1);
   }
   else
   {
       point.B = (byte)(((int)(CurrentPixel. & 254) + 0);
   }
   if ((iColor & 2) > 0)
   {
       point.G = (byte)(((int)(CurrentPixel.G) & 254) + 1);
   }
   else
   {
       point.G = (byte)(((int)(CurrentPixel.G) & 254) + 0);
   }
   if ((iColor & 1) > 0)
   {
       point.R = (byte)(((int)(CurrentPixel.R) & 254) + 1);
   }
   else
   {
       point.R = (byte)(((int)(CurrentPixel.R) & 254) + 0);
   }
}

For decoding 1 bit images:

for (int x = roi.Left; x {
   ColorBgra CurrentPixel = *srcPtr;
   GreyLevel = ((((int)CurrentPixel. & (int)1) * 4);
   GreyLevel += (((int)CurrentPixel.G) & (int)1) * 2;
   GreyLevel += (((int)CurrentPixel.R) & (int)1);
   CurrentPixel.R = (byte)(GreyLevel * 32);
   CurrentPixel.G = (byte)(GreyLevel * 32);
   CurrentPixel.B = (byte)(GreyLevel * 32);
   CurrentPixel.A = 255;
   *dstPtr = CurrentPixel;

   ++srcPtr;
   ++dstPtr;
}

For decoding color images:

for (int x = roi.Left; x {
   ColorBgra CurrentPixel = *srcPtr;
   CurrentPixel.R = (byte)((((int)CurrentPixel.R) & (int)7) * 36);
   CurrentPixel.G = (byte)((((int)CurrentPixel.G) & (int)7) * 36);
   CurrentPixel.B = (byte)((((int)CurrentPixel. & (int)7) * 36);
   CurrentPixel.A = 255;
   *dstPtr = CurrentPixel;

   ++srcPtr;
   ++dstPtr;
}

Share this post


Link to post
Share on other sites

Thank you for the effect - It's kind of a fun plug-in, isn't it? I still haven't made a decent banner hiding an uncorrupted image . . . too many transparent pixels and too many blocks of solid color in my attempts so far. I'll keep working at it.

Share this post


Link to post
Share on other sites
Ugly, ugly code--I know. But, once something works, I rarely go back and clean it up. Sorry.

For encoding the image:

if (token.FullColor)
{
   point.R = (byte)((((int)point.R + 18) / (int)36));
   point.G = (byte)((((int)point.G + 18) / (int)36));
   point.B = (byte)((((int)point.B + 18) / (int)36));
   point.R = (byte)(((int)(CurrentPixel.R) & 248) + point.R); // 11111000
   point.G = (byte)(((int)(CurrentPixel.G) & 248) + point.G);
   point.B = (byte)(((int)(CurrentPixel. & 248) + point.;
}
else
{
   ColorBgra srcGrey = this.desaturateOp.Apply(point);
   iColor = srcGrey.R / 32;
   if (( iColor & 4) > 0 )
   {
       point.B = (byte)(((int)(CurrentPixel. & 254) + 1);
   }
   else
   {
       point.B = (byte)(((int)(CurrentPixel. & 254) + 0);
   }
   if ((iColor & 2) > 0)
   {
       point.G = (byte)(((int)(CurrentPixel.G) & 254) + 1);
   }
   else
   {
       point.G = (byte)(((int)(CurrentPixel.G) & 254) + 0);
   }
   if ((iColor & 1) > 0)
   {
       point.R = (byte)(((int)(CurrentPixel.R) & 254) + 1);
   }
   else
   {
       point.R = (byte)(((int)(CurrentPixel.R) & 254) + 0);
   }
}

Is this "codelab code"? I get errors at line 13 (wrong token) when I use it with codelab...

How about moving all steganography effects to the new "advanced" submenu?

Share this post


Link to post
Share on other sites

I don't believe there is a need to move the entire set into the Advanced category for two reasons.

Firstly, the Steganography plugin is unique by the fact it uses different 'effects' to do the different tasks, therefore having them all in one folder would both be logical and contain them in one location - its own submenu.

And secondly, Steganography, or at least how BoltBait has created it, isn't 'advanced' in any way, not like ScriptLab and Code Lab is. Think of it this way, which would be more complicated to the average user, Code Lab or Steganography?

If you're wondering why I keep associating Code Lab with the Advanced sub menu:

I think CodeLab should go in the "Advanced" sub-Menu :)

I agree.

Next release of CodeLab will move it into the Advanced submenu.

Share this post


Link to post
Share on other sites

Of course I know what's discussed about "advanced". That was only a new attempt to get rid of one submenu. I don't know why I'm so into this as time will bring me victory. When I reached the point that I only have 4/5 submenus but all plugins via 3.20, I have to block my access to my money as there is the massive danger that I would donate all of it because of my deep feeling of satisfaction... :D

However, the reason for my post was mainly the code issue.

Share this post


Link to post
Share on other sites
I'm getting some wonky results, what can I do to fix it?

Define "wonky".

I can not "fix it" if you don't specifically tell me what is wrong. Include screenshots, etc.

Share this post


Link to post
Share on other sites

I used the plug-in to hide a color photo in the picture that I attached to my last post. When I "reveal" the hidden picture, it does not come out the same way it went in. The colors are blurred and the detail is lost. It's still identifiable, but the quality is way down. Can I only hide one photo in another, or does the type of pictures matter at all? Thanks.

Share this post


Link to post
Share on other sites
I used the plug-in to hide a color photo in the picture that I attached to my last post. When I "reveal" the hidden picture, it does not come out the same way it went in. The colors are blurred and the detail is lost. It's still identifiable, but the quality is way down. Can I only hide one photo in another, or does the type of pictures matter at all? Thanks.

The reason for this is that the picture you are hiding is being reduced from 24 bits to 3 bits. You have to expect a great deal of quality loss during that process.

You can see what your picture will look like by using the Preview check box.

Also, you can dither your picture before encoding it since dithering will yeild a higher quality than what I'm doing.

So, basically, it is working as designed.

Share this post


Link to post
Share on other sites

So do you guys think it would be possible to print out a steg'd picture, give it to a friend, he scans it and removes noise etc. (makes it look exactly like the pic) and STILL be able to recover the message?

Share this post


Link to post
Share on other sites

No. It's stored in the code of the image, not the pixels itself.

It would have to be an absolutely perfect printout, and an absolutely perfect scan. Neither of those exist.

But good idea! :-)

Share this post


Link to post
Share on other sites
No. It's stored in the code of the image, not the pixels itself.

An image is made up solely of pixels. There is no "code of the image." The steno is being done by manipulating the pixels.

Share this post


Link to post
Share on other sites
No. It's stored in the code of the image, not the pixels itself.

An image is made up solely of pixels. There is no "code of the image." The steno is being done by manipulating the pixels.

Oh, wow...I can't believe I typed that. Just woke up from a nap...wow. Okay, yes.

The stenography is achieved by hiding the secondary image in the least significant parts of the pixels that form the primary image, at the code level. It's not supposed to be visible in the pixels themselves until revealed. Since it's designed to be invisible to the naked eye, then, a printer (which always damages an image as it prints it) would completely destroy the secondary image.

As I'm thinking about it more, the scanner wouldn't be able to scan it as individual pixels, anyway, and it would have to be very lucky to render the scan as the exact pixels that were printed.

Sorry for the confusion.

Rick, I swear I'm not an idiot...

Share this post


Link to post
Share on other sites

Yeah, I tried several distortions to the steg'd image. Even if you slightly change the brightness (Which WILL happen if you scan) the hidden image is destroyed.

It WAS a nice thought though. :P

UPDATE:

OoOoOoOoO.

I just tried this: I took an image and set the transparency ADJUSTMENT to about the first setting so it wasn't visible but technically barely opaque.

Then I put this image on top of a white canvas.

Then I ran the reveal tool and it came up. (kinda light, just use the levels tool to fix that)

This method let's the image survive twist, oblique, ANY rotation and more.

Sadly, noise still kills it. It's a start though.

Sorry if I seem kind of obsessed. I'm truly fascinated with this steganography concept :)

Thanks for listening :P

Share this post


Link to post
Share on other sites

So don't encode any state secrets, and you should be fine. :-)

You just need to realize, this isn't for any professional thing. It's just for fun.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this