Steganography
- Imagine your are a spy in a foriegn country and you need to comunicate with your home country
- Encrypting your messages is a good idea, but people might get suspicious when you have lots of email going to cia.gov
- What you need to do is hide that you are even sending messages
- So you post cute cat pictures to your facebook page and you hide your messages home inside of the images
- Hiding messages inside of other messages is Steganography, and it is your lab activity for today
- There are many ways to do the hiding, the one we are going use slightly modifies colors to encode a message
- If you pull up an online color picker and change the red, green, or blue value of the color, it is really hard to see the difference
- So we will encode the message by making small changes to the color values
- For exmample, this image encodes ‘abc’: - P3 1 8 255 122 101 215 42 2 128 200 13 64 203 155 130 36 172 91 180 88 77 55 22 44 66 33 99
- The message is encoded in the parity of pixel data
- Parity is whether a number is even or odd
- If it is even it encodes 0, if it is odd it encodes 1
- The first eight numbers are - 122, 101, 215, 42, 2, 128, 200, 13
- Which have the parity - even, odd, odd, even, even, even, even, odd
- And therefore encodes - 0, 1, 1, 0, 0, 0, 0, 1
- But if all we have are zeros and ones how do we get the characters of the message?
- We must convert the number from binary to decimal and then look it up in an ascii table 
Binary
- In decimal we have 10 symbols to represent numbers, 0 thorugh 9
- When we want to represent larger numbers larger than 9, we use multiple symbols
- The location of a symbol specifies how much it contributes to the numbers value
- For example in the number 253, the 2 is in the represents hundreds, the 5 represents tens, and the 3 represents 1s
- So it could be rewritten as: - 253 = 2 * 100 + 5 * 10 + 3 * 1
- Or: - 253 = 2 * 10^2 + 5 * 10^1 + 3 * 1^0
- In binary we have only 2 symbols, 0 and 1
- To represent numbers larger than 1, we use multiple symbols - 101 = 1 * 2^2 + 0 * 2^1 + 1 * 2^0 = 1 * 4 + 0 * 2 + 1 * 1 = 4 + 0 + 1 = 5
ASCII
- So now we can convert the encoded sequence 0, 1, 1, 0, 0, 0, 0, 1 to decimal - 01100001 = 2^6 + 2^5 + 2^0 = 63 + 32 + 1 = 97
- Notice it is not in the range 0 to 25 as we have previously used to convert between numbers and characters
- This is because it is using ASCII, a standard for encoding characters that includes lots of other things including punctuation
- So we can look 97 up in an ASCII Table to determine that is ‘a’