PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Nov 14, 2018 1:39 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Jul 23, 2009 4:58 pm 
Offline
Forum Newbie

Joined: Thu Jul 23, 2009 12:59 pm
Posts: 1
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:

Syntax: [ Download ] [ Hide ]
<?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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group