Please enable JavaScript to use CodeHS

Steganography

In this project, students explore steganography and create their own encryption algorithm to conceal and hide a message within the pixels of an image!

Medium

3 Hours

High School

Project Description

Background

Steganography is the process of concealing a message within another message. In the context of computers, a file, image, or video is concealed within another file, image, or video. An advantage of using steganography over cryptography in some cases is that the intended secret does not attract attention to itself as an object of scrutiny.

Your Task

Using an encryption algorithm that you create in the last activity, you’ll be hiding a message in a picture!

Step 1: Start by creating your own pixel picture! A few things to note when using the color encoding editor:

  • Each line encodes one pixel, which is one square in the grid.
  • The editor fills in the grid row by row, going left to right and ignoring any spaces in your code.
  • Once one row is filled in, the next line of code encodes the first pixel on the next row.
  • You can use the color picker to choose a color. Then, copy and paste the hexadecimal value under “Key” into the code editor.

Step 2: Change the hexadecimal values just slightly to hide the encrypted message you developed in the previous activity. This will take some exploring! You will probably need to play around with the hexadecimal values to determine which numbers you can adjust without changing the color.

Step 3: Finally, once you’ve determined the best course of action, take note of your encryption process: what values are you changing for which pixels? You will need to add this to your encryption algorithm as the final step in the next activity.