Page 1 of 1

some kind of steganography with GD

Posted: Thu Jul 23, 2009 4:58 pm
by hecky
Hi, im hecky, i'm from mexico, and im 16 years old. I offer ya'll apologizes if my english is not good enough. I dont like programming very much, but the GD library caught myself. I likje very much this, but i'm just beggining. Well, in some challenges of steganography, i have to use GD. In fact, any challenges are made and solved by GD. I don't know so much of that, but steganography is my passion.

One challenge from yashira, has this ORIGINAL image.

Image ORIGINAL PNG

this image, has a hide message, i solved this, with a little help. And to solve this what yo have to do is to COMPARE the same image, in format jpg, so i open the same image, and save as JPG,

Image SAME IMAGE saved as in JPG FORMAT

Then make a script that compares the differences, and for each different pixel, the script set a black pixel. The script is the following:

Code: Select all

<?php
$original=imagecreatefromjpeg('original.jpg');
$modified=imagecreatefrompng('modified.png');
$size=getimagesize('original.jpg');
$output=imagecreate($size[0],$size[1]);
imagecolorallocate($output,255,255,255);
$cblack=imagecolorexact($output,0,0,0);
for($a=0;$a<$size[0];$a++){
for($b=0;$b<$size[1];$b++){
$colororiginal=imagecolorat($original,$a,$b);
$colormodified=imagecolorat($modified,$a,$b);
if ($colororiginal!=$colormodified) imagesetpixel($output,$a,$b,$cblack);
}
}
imagepng($output,'solved.png');
?>
After that the image result is this one:
Image


Ok everything is allright, but mi doubt, is:

How can i hide some message, like this???? Is obviosly that it can be possible copying the image, and in the second image set differents pixels, with minimun diference (original= 255,255,255 second image= 255,255,254). This way is ok, but in the challenge image, there's just one image, and you have to save it as JPG. How is possible to hide a message, and just saving the same picture in diferent format, get the message???

That is my question. I ask here, cuz i investigate and the author challenge, said that he made the technique with GD. but he doesn't want to tell how.

Hoping my english will be understandable. And hoping you can help me.

Thank you.