How is steganography implemented in php
Asked Answered
S

4

7

Somewhere I found out steganography .. the way of storing or hiding information within another information.. at times certain images are also used to hide the information.. Can i get an example or any thing further to know more about how this is implemented... or if at all is it possible to use this in php

Striated answered 9/12, 2009 at 5:55 Comment(4)
That's one very broad question, and not well categorized. Please add the appropriate tags (PHP, etc.).Amosamount
Can you clarify why you want to hide information in your images. If you're wanting to protect your images then you will have to use techniques that are somewhat robust to image transformation. Lots of naive steg techniques can easily be broken with basic image transformations.Allembracing
In fact you don't explicitly state that you want to hide information in images. We're all assuming that's the case so far.Allembracing
i am juz a bit curious to know how this is done..Striated
G
5

You want the GD library in PHP to manipulate JPG images: http://php.net/manual/en/book.image.php

For an understanding of Steganography and Steganalysis, read this article: http://www.securityfocus.com/infocus/1684

Gasperoni answered 9/12, 2009 at 5:56 Comment(0)
F
7

Generally , if your talking about steganography, then basically you are stuffing information into the nooks and crannies of the image file. You can use nearly any image library out there as long as the image library doesn't validate the image file strictly against a schema. You can use nearly any programming language you fancy.

There are numerous techniques. Here are some which are easy to program.

  • Use an image format which stores the image in chunks. You can move the chunks to allow gaps in the file. You can then hide strings of information in the gaps.
  • Convert the image to an indexed image. Declare a pallete larger than the number of colors. Now you can hide extra information in the pallete colors not used in the image.
  • If you are using an image format which has layers, you can declare a layer in which the alpha channel is maximum. This causes the layer to be fully transparent. You can use another color channel to hide your data.

There are numerous more techniques. Remember to use generous amounts of compression and random misleading data to make the image file look legitimate.

Fusion answered 9/12, 2009 at 6:4 Comment(1)
thanks :). My browser spellcheck doesnt have steganography in the dictionary (opera 10 english). Answer correctedFusion
G
5

You want the GD library in PHP to manipulate JPG images: http://php.net/manual/en/book.image.php

For an understanding of Steganography and Steganalysis, read this article: http://www.securityfocus.com/infocus/1684

Gasperoni answered 9/12, 2009 at 5:56 Comment(0)
D
4

One common way to do steganography:

Think about a 1024 x 768, 24-bit color (i.e. 8 bits of red, 8 bits of yellow, 8 bits of blue) image. Now, the least-significant bit of the colors in the image doesn't matter much. Therefore, one can hide three bits of information in each pixel.

That makes for 1024 * 768 * 3 / 8, or 294,912 bytes of information that can be hidden in a large image without degrading the image much.

Diarthrosis answered 9/12, 2009 at 6:6 Comment(3)
24 bit-color bitmaps are not very common on the web though.Allembracing
@Tom. PNG use lossless compression, so I would assume a 24-bit PNG, which isn't uncommon, could be used in this way?Cheerful
Yes that's true. Thanks for clarifying. This would be true of any lossless compressed bitmap.Allembracing
B
4

Here is a class from phpclasses.org for

Hide encrypted data in images using steganography

Some useful links from Steganography page at wikipedia

At last one more demo & source code over here

Brote answered 30/12, 2009 at 8:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.