STEG - Identifying a Hidden Picture (Lesson)

APCompSci_LessonTopBanner.png

Identifying a Hidden Picture

Introduction

At the end of the previous activity, we considered how the code would need to be changed in order to allow the secret image to be smaller than the source image. Modify the canHide method in Steganography.java to return true in the appropriate cases where the secret image is the same size or smaller than the source image. Do this before moving forward with this activity.

Click below to begin the Identifying a Hidden Picture Lab.

This lab content is from the College Board.

 

Check Your Understanding

Record the answers to the following questions on a sheet of paper. You will need the answers to complete the Lab Check Quiz.

5. This activity is focused on being able to hide the secret image in a random location within the source image. One aspect that was not mentioned was how to determine an appropriate random location to hide the secret image. Assuming source and secret are both known (and therefore the height and width of each could be determined through method calls), how would you generate random row and column values to start hiding secret?

Complete the following expressions:

int row =

int column =

6. Are your coordinates guaranteed to fit secret within source? If not, modify the expressions to ensure that there is room to fit the entire secret image within source.

APCompSci_LessonBottomBanner.pngIMAGES CREATED BY GAVS