CSC350 - Lab 1
Least Significant Bit


Part 1 - Security

Write your answers to the following questions in a Google Doc and share this with me. State why you feel your answer is correct.

  1. Which security services are guaranteed by the post office when using Certified mail?

  2. Which type of security attack is being used when a student breaks into a professor's office to obtain a copy of the next day's test?

  3. Which security mechanism is provided when a bank requires the customer's signature for a withdrawl?

  4. Is it cryptography or steganography when a student writes the answers to a test on a small piece of paper, rolls up the paper, inserts it in a ball-point pen, and passes the pen to another student?

Part 2 - Least Significant Bit


You will be completing an Android application named Stego. Implement the algorithm discussed on page 11 of the textbook for encoding and decoding messages in the least significant bit of an image file.

Download the following Android project:

This will provide a skeleton for your code. You may write whatever additional methods you feel are necessary to complete this lab, be sure to fully document your code. You should not have to change anything in the code already provided, only add where you find the TODO tag.

You will need to add code to LSB.java for three purposes:

  1. Message Conversion

    When encoding, the message must be translated into binary numbers. When decoding, you will need to translate binary numbers back into text.

  2. Message Decoding

    Start with the first pixel in the upper-left corner, you will need to extract the message from the image. Each pixel should be examined in order of Red, Green, Blue. If the number is odd, record a 1, if the number is even, record a 0.

  3. Message Encoding

    To encode a message, again start in the upper-left corner of the image. In each pixel, proceed through the colors in order Red, Green, Blue. If the value is odd for that color, but should be even according to the current binary digit, subtract 1. If the value is even for that color, but should be odd according to the current binary digit, add 1.

You must decode the following images, and send me a new encoded image chosen by you by email.

In addition, you must encode a message of your own, using an image of your choosing. Save the encoded image as "myimage.png". To hand in your Lab 1 files, create a csc450/lab1 directory in your account on the cs.centenary.edu server.