I have several of my own photos that I need to add a simple watermark to; however, I would like to add stegonography to the watermarked layer in order to put the image information, the page that the image was to be placed on, etc… hidden within the watermarked layer. Is there a way that I can use php to view the stegonography data from the watermarked layer of the completed photo? If so, how?
You can see an Imagemagick example here Stegano
The page is quite large.
Image with the Stegano watermark
The retreaved watermark
Comments:
Can not be used on a compressable image like jpg.
Need to know where on the image the watermark is.
If the image is cropped from the top left you will not be able to find the watermark again.
I have been looking at Microsoft pro tools and you can add data to images through that. As sk89q says you can view the data in a hex editor although I would not know how to remove the data without messing up the image!
Imagemagick has a strip command that removes all EXIF type data but I do not know how far it goes.
On a camera forum there was a discussion about this and the best method seemed to add some transparent watermarks in 4 or 5 places on the page. These could be done so that they were very hard to view but it would be hard to automate.
I have some watermark examples on my site using ImageMagick.
I do not know if any method is fool proof and if your image is that good somebody with the expertese wants it they can remove all watermarks. If they do not have the expertese and do not care they will just use your image anyway with the watermark!
Locking Exif info isn’t going to stop someone with programming knowledge or a hex editor.
You have to choose a stenography algorithm first before you can go about reading or writing it, so you should be asking that first.
No, I don’t think PHP can lock the EXIF info. You could try encrypting it though, before putting in the EXIF tag.
If you had tried searching Google for “php steganography” you may not have started this thread. Quite a few results (I’m surprised) like this.
Note that most of them seem to output in PNG (due to its capacity to be lossless). This means your images will likely become considerably larger in size.
All someone has to do is to edit the exif using an editor or by doing the properties / advanced thing in windows.
I know that Microsoft (and other companies) have the ability to lock some of the exif info. Can we do that with php? If so, that’d be the trick.
If I were to focus on the steg possibility, I need to:
- create a watermark image
- insert stegged data into the watermark image
- layered embed the stegged watermark image onto another image
- attempt to read the stegged data in the watermark layer of a watermarked image.
I can create an image, insert stegged data into the watermark and layer the stegged watermark image onto another image all in php; however, I have no clue where to start with the reading the stegged data in the watermarked layer of the finished image.
If anyone can help me with this, I’d be eternally grateful.
Not really, you’d need an external piece of software for that, like an OCR package. GD or ImageMagick (the two common libraries which handle all the image stuff for PHP) are as far as I know not able to do stuff like this.
The other thing I’d suggest is to use EXIF comments (or perhaps some other metadata format, like perhaps JPEG comments?). This is a neater and less potentially fragile method I think, plus you can probably add a lot more data. It means you’re limited to JPEG, but this shouldn’t be a problem with photographs.