Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This a C problem, here is the overview Thank you very much. Overview: This program embeds a text file into an image, or decrypts an
This a C problem, here is the overview
Thank you very much.
Overview: This program embeds a text file into an image, or decrypts an image that contains text within it. For our images, we use basic black-and-white (greyscale) P2 images. We use a graphics format that uses ASCII (text) width-in-pixels files. Most graphics programs use binary files (gif, jpeg height-in-pixels etc) which promote smaller file sizes. Since this is just CS maximum-grayscale-value (always 255 for this project) 100, we'll stick with ASCII (text files, even though they pixel-1-1-intensity pixel-1-2-intensity pixel-1-3-intensity pixel-2-1-intensity pixel-2-2-intensity pixel-2-3-intensity take more space. The ASCII format we use is called pgm and is shown at the right. The first line is always P2. After pixel-N-1-intensity pixel-N-2-intensity pixel-N-3-intensity that, you have three values (width, height, grayscale levels) that can be on a single line or separate lines. Finally, you have the actual pixel values for each pixel in the image. A pixel with a value of 0 is black (absence of light and a pixel with a value of 255 is white (all light) As an example of a pgm image, consider the file shown at the left (data.pgm) P2 This image is seven columns wide and six rows high. It has 255 grayscale 7 6 255 values (all the images used in this project will have 255 possible grayscale 0 0 0 0 0 0 values). This image has a one pixel border in black (zero absence of light 0 255 255 255 255 255 0 o 255 255 255 255 255 0 and a white interior (255 all light) 0 255 255 255 255 255 0 0 255 255 255 255 255 0 This program uses, and creates pgm images. To see 0 0 0 if your program is working properly, you need to be able to view pgm images. Your system might (or might not have a viewer that supports pgm images. If not, download the free program GIMP (GNU Image Manipulation Program) at ht downloads. Using GIMP that you can actually see it, as the actual image is only six pixels high by seven pixels wide Encoding a Message into an Image Now that you understand a bit about how pgm images work, we need to understand how to embed a message into these images. We want to make the modified image (containing an embedded message) look no different than the original image so that no one will suspect it contains an embedded message. Given this, we only modify the last (or rightmost or least-significant bit of the pixels in the image. We use the last/rightmost/least-significant bit as changes to that bit do not drastically impact the color displayed by that pixel. Distinguishing between pure black (a pixel value of zero and almost pure black a pixel value of one is difficult, if not impossible, for the average person. Similarly distinguishing between pure white (255) and almost pure white 254) is equally difficultStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started