Steganography can be used to hide text in an image by modifying the least significant bit (LSB) of the image pixels. Here’s a basic overview of how this can be done:

  1. Convert Text to Binary: Convert the text you want to hide into binary format. Each character in the text will typically be represented by 8 bits (1 byte). This is done using ASCII, a character encoding format that assigns standard numeric values to letters, numerals, punctuation marks, and other characters used in computers. For example, a lower case “m” is assigned the number 109, which in binary is represented by 01101101 (each 0 or 1 is a bit).

  2. Select Image: Choose an image that will be used as the carrier for the hidden text.

  3. LSB Modification: Starting with the first pixel of the image, replace the least significant bit of one of the color channels, either red, green, or blue, with the first bit from the binary representation of your text. Then do the same for the other two color channels, one at a time, continuing each time to the next unused bit from the binary representation of your text.

  4. End-of-Message Marker: Use a special marker to indicate the end of the hidden message, so the decoder knows when to stop decoding.

  5. Save the Image: Save the modified image with the hidden text.

  6. Note: Encoding schemes can differ. Decide on a scheme to determine which pixels and which color channels will carry the hidden message. For example, you might decide to use only the least significant bit of the red channel for encoding. You also typically choose pixels in a specific order, such as left to right and top to bottom.

If you’re concerned about this process altering the image, don’t worry. The changes made are so minuscule that the difference between the two photos is undetectable to the human eye. Since this process only changes the least significant bit for each color channel in the pixels used, there will only be very very slightly more or less red, blue, and green. 

Visual of steganographic process

Above is a hand-drawn image, created by me, further demonstrating this process.

 

—————————————————————————–

 

ChatGPT Prompt: how can steganography be used to hide text in an image by modifying the least significant bit?

Original Output from ChatGPT:

Steganography can be used to hide text in an image by modifying the least significant bit (LSB) of the image pixels. Here’s a basic overview of how this can be done:

  1. Convert Text to Binary: Convert the text you want to hide into binary format. Each character in the text will typically be represented by 8 bits (1 byte).
  2. Select Image: Choose an image that will be used as the carrier for the hidden text.
  3. LSB Modification: For each pixel in the image, replace the least significant bit of one of the color channels (e.g., red, green, or blue) with a bit from the binary representation of your text. This is typically done in a specific order, such as left to right and top to bottom.
  4. Encoding Scheme: Decide on a scheme to determine which pixels and which color channels will carry the hidden message. For example, you might decide to use only the least significant bit of the red channel for encoding.
  5. End-of-Message Marker: Use a special marker to indicate the end of the hidden message, so the decoder knows when to stop decoding.
  6. Save the Image: Save the modified image with the hidden text.

 

——————————————————————————

 

I would estimate that there is about a 50/50 split between how much of the explanation is from ChatGPT and how much is from me and my notes. I added some more in detail and easy to understand explanations for some steps. I also reorganized some of the information.