Image Steganography

Image Steganography in C

Page 1 of 1

2 Replies - 24556 Views - Last Post: 03 December 2007 - 10:15 PM Rate Topic: -----

#1 Guardianva  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 2
  • Joined: 03-December 07

Image Steganography

Post icon  Posted 03 December 2007 - 01:07 PM

I'm working on a masters in Modeling & Simulation and have found myself in a Digital Imaging class that requires a fair amount of C programming. I have made to the end, but the final project has taxed my very limited (read basic) C/C++ programming skills.

The program is two fold. Write a program that will embed an image (in my case a PGM grey scale file) into a (PPM) color image. The second part will be to write an extraction program, but until I know how I got it in I can't pull it out.

I have finally figured out how to read two files, without corrupting the data. The image to be inserted (imageb) and the host image (imagea) is the target PPM file.

I have a check routine to make sure there is enough space for the image to fit. I also output the size of the grey image so that I have the parameters to pull it out when I write the extraction program.

The file reading code is class provided, so that doesn't need adjusting. It reads to know if the file is a PPM or PGM file.

I am going to use the least significant bit method when I am finished, but for now I am embedding on the MOST significant bit in order to see if the embedding is happening. When that is successful I will shift the the least significant bit.

To keep everything simple I am also dropping the two least significant bits of the gray image so that I can pair the gray image bits 7 & 6 to band O (red), bits 5 & 4 with band 1 (green), and bits 3 & 2 with band 2 (blue).

The logic, as I understand it, and what I am having trouble with is sequencing from band 0 after loading the new bits and writing, then going to band 1 to do the same, and then on to band 2 to finish the routine and then advance the grey image to the second pixel. The color image advances three times for each single advance of the grey image.

Attached is my CPP code file.

Thanks,
Guardianva

Attached File(s)

  • Attached File  Code.txt (11.07K)
    Number of downloads: 4232


Is This A Good Question/Topic? 2

Replies To: Image Steganography

#2 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Image Steganography

Posted 03 December 2007 - 09:29 PM

Although the code is Java, I feel this may help.
http://www.dreaminco...wtopic27950.htm
It explains the general logic of adding bytes to an image, if you modify some of the basic functions into C++ code to deal with your image types, the switch should be rather trivial.
I have not had time to finish a Steganography in C++, I would be very interested to see how you make out, or help you out here as you go along :)
Was This Post Helpful? 0
  • +
  • -

#3 Guardianva  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 2
  • Joined: 03-December 07

Re: Image Steganography

Posted 03 December 2007 - 10:15 PM

View PostWilliam_Wilson, on 3 Dec, 2007 - 09:29 PM, said:

Although the code is Java, I feel this may help.
http://www.dreaminco...wtopic27950.htm
It explains the general logic of adding bytes to an image, if you modify some of the basic functions into C++ code to deal with your image types, the switch should be rather trivial.
I have not had time to finish a Steganography in C++, I would be very interested to see how you make out, or help you out here as you go along :)


Thanks WW, there may be something in here I can use. I'll study it in detail as soon as I am able. Again, thanks. G
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1