|
@@ -249,44 +249,44 @@ Explain your answer.
|
249
|
249
|
|
250
|
250
|
In today's laboratory experience you will complete a steganography application to extract hidden messages from images.
|
251
|
251
|
|
252
|
|
-###Exercise 1: Extract the binary message
|
|
252
|
+### Exercise 1 - Extract the binary message
|
253
|
253
|
|
254
|
|
-####Instructions
|
|
254
|
+#### Instructions:
|
255
|
255
|
|
256
|
|
-1) Load the Qt project called `Steganography` by double-clicking on the `Steganography.pro` file in the `Documents/eip/Repetitions-Steganography` folder of your computer. You can also go to `http://bitbucket.org/eip-uprrp/repetitions-steganography` to download the `Repetitions-Steganography` folder to your computer.
|
|
256
|
+1. Load the project `Steganography` into `QtCreator`. There are two ways to do this:
|
257
|
257
|
|
258
|
|
-The project contains the skeleton for an application to recover embedded messages from images. The messages that you will be recovering have been embedded using the least significant bit technique. The end of each message was encoded by using the ASCII character with binary code `00000000`.
|
|
258
|
+ * Using the virtual machine: Double click the file `Steganography.pro` located in the folder `/home/eip/labs/repetitions-steganography` of your virtual machine.
|
|
259
|
+ * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/repetitions-steganography` to download the folder `repetitions-steganography` from `Bitbucket`. Double click the file `Steganography.pro` located in the folder that you downloaded to your computer.
|
259
|
260
|
|
260
|
|
-2) Compile and run the program. You should obtain an interface that looks similar to:
|
|
261
|
+ The project contains the skeleton for an application to recover embedded messages from images. The messages that you will be recovering have been embedded using the least significant bit technique. The end of each message was encoded by using the ASCII character with binary code `00000000`.
|
261
|
262
|
|
262
|
|
-![img1.png](images/img1.png)
|
|
263
|
+2. Compile and run the program. You should obtain an interface that looks similar to:
|
263
|
264
|
|
264
|
|
-3) The button `Load Image` has already been programmed to allow the user to load an image and display it. Your task is to program the functionality of the button `Retrieve Message` to analyze the image and extract the hidden message. The hidden message should be displayed in the `Write a message` window.
|
|
265
|
+ ![img1.png](images/img1.png)
|
265
|
266
|
|
266
|
|
-4) You will be working with the `steganography.cpp` file. Complete the `ExtractMessage` function that receives a steganography image so it extracts the digits of the binary message encoded in the image and stores them in a string. The function should invoke another function `binaryStringToMessage` that converts the string from `0`'s and `1`'s in the message's characters and returns the hidden message.
|
|
267
|
+3. The button `Load Image` has already been programmed to allow the user to load an image and display it. Your task is to program the functionality of the button `Retrieve Message` to analyze the image and extract the hidden message. The hidden message should be displayed in the `Write a message` window.
|
267
|
268
|
|
|
269
|
+4. You will be working with the `steganography.cpp` file. Complete the `ExtractMessage` function that receives a steganography image so it extracts the digits of the binary message encoded in the image and stores them in a string. The function should invoke another function `binaryStringToMessage` that converts the string from `0`'s and `1`'s in the message's characters and returns the hidden message.
|
268
|
270
|
|
269
|
|
-For example, if the first few pixels the image were these:
|
270
|
271
|
|
271
|
|
-````
|
272
|
|
-0x98 99 98 0x00 00 01 0x00 00 00 0x01 01 00
|
273
|
|
-0x01 01 01 0x01 00 01 0x01 00 00 0x01 01 01
|
274
|
|
-0xf0 ea 00 0x44 00 f0 0x00 aa 22 . . . .
|
275
|
|
-````
|
|
272
|
+ For example, if the first few pixels the image were these:
|
276
|
273
|
|
277
|
|
-your `ExtractMessage` function would extract the least significant bits of each colors component and construct the `string`: `"010001000110111101100111000000000.."`.
|
|
274
|
+ `0x98 99 98 0x00 00 01 0x00 00 00 0x01 01 00 0x01 01 01 0x01 00 01 0x01 00 00 0x01 01 01 0xf0 ea 00 0x44 00 f0 0x00 aa 22 . . .`
|
278
|
275
|
|
279
|
|
-Notice that your algorithm should have some mechanism for detecting if the last 8 character block were all `0`. When this happens, the algorithm should stop reading the pixels.
|
|
276
|
+ your `ExtractMessage` function would extract the least significant bits of each colors component and construct the `string`: `"010001000110111101100111000000000.."`.
|
280
|
277
|
|
281
|
|
-The string of binary digits should then be sent to another function `binaryStringToMessage` (see Exercise 2) that interprets the `0`'s and `1`'s as the bits of ASCII characters. In the example, the string `”010001000110111101100111000000000”` would be decoded to "Dog" (because `01000100` corresponds to 'D', `01101111` is 'o', `01100111` is 'g', and a `00000000` symbolizes the end of the string.)
|
282
|
278
|
|
283
|
|
-To implement the algorithm for extracting the message, you should understand how the message was encoded. If necessary, review the "Embedding a message into an image" section.
|
|
279
|
+ Notice that your algorithm should have some mechanism for detecting if the last 8 character block were all `0`. When this happens, the algorithm should stop reading the pixels.
|
284
|
280
|
|
|
281
|
+ The string of binary digits should then be sent to another function `binaryStringToMessage` (see Exercise 2) that interprets the `0`'s and `1`'s as the bits of ASCII characters. In the example, the string `”010001000110111101100111000000000”` would be decoded to "Dog" (because `01000100` corresponds to 'D', `01101111` is 'o', `01100111` is 'g', and a `00000000` symbolizes the end of the string.)
|
285
|
282
|
|
286
|
|
-###Exercise 2: Interpreting the message
|
|
283
|
+ To implement the algorithm for extracting the message, you should understand how the message was encoded. If necessary, review the "Embedding a message into an image" section.
|
287
|
284
|
|
288
|
285
|
|
289
|
|
-####Instructions
|
|
286
|
+### Exercise 2 - Interpreting the message
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+#### Instructions:
|
290
|
290
|
|
291
|
291
|
1. Complete the `binaryStringToMessage` function that receives the string of `0`'s and `1`'s extracted from the image so it returns the hidden message. You can use the `binStringToChar` function to convert substrings of 8 `0`'s and `1`'s in its corresponding character.
|
292
|
292
|
|
|
@@ -308,7 +308,7 @@ To implement the algorithm for extracting the message, you should understand how
|
308
|
308
|
|
309
|
309
|
##Deliverables
|
310
|
310
|
|
311
|
|
-Use "Deliverables" in Moodle to upload the `steganography.cpp` file that contains the `ExtractMessage` and `binaryStringToMessage` functions. Remember to use good programming techniques, include the names of the programmers involved, and to document your program.
|
|
311
|
+Use "Deliverable" in Moodle to upload the `steganography.cpp` file that contains the `ExtractMessage` and `binaryStringToMessage` functions. Remember to use good programming techniques, include the names of the programmers involved, and to document your program.
|
312
|
312
|
|
313
|
313
|
---
|
314
|
314
|
|