Selaa lähdekoodia

Fixing markdown README.md. Removed most of the diagnostics

Rafael Arce Nazario 9 vuotta sitten
vanhempi
commit
cf43906dc4
1 muutettua tiedostoa jossa 51 lisäystä ja 74 poistoa
  1. 51
    74
      README.md

+ 51
- 74
README.md Näytä tiedosto

@@ -9,7 +9,7 @@
9 9
 Una de las ventajas de utilizar programas de computadoras es que podemos realizar tareas repetitivas fácilmente. Los ciclos como `for`, `while`, y `do-while` son estructuras de control que nos permiten repetir un conjunto de instrucciones. A estas estructuras también se les llama *estructuras de repetición*.  En la experiencia de laboratorio de hoy completarás una aplicación de esteganografía para practicar el uso de ciclos anidados en la manipulación de arreglos bi-dimensionales.
10 10
 
11 11
 
12
-##Objetivos:
12
+## Objetivos:
13 13
 
14 14
 1. Aplicar ciclos anidados y estructuras de control para manipular arreglos bi-dimensionales y  extraer mensajes escondidos en imágenes.
15 15
 
@@ -18,7 +18,7 @@ Una de las ventajas de utilizar programas de computadoras es que podemos realiza
18 18
 3. Utilizar la representación binaria de caracteres.
19 19
 
20 20
 
21
-##Pre-Lab:
21
+## Pre-Lab:
22 22
 
23 23
 Antes de llegar al laboratorio debes haber:
24 24
 
@@ -67,7 +67,7 @@ Al elemento más pequeño de una imagen se le llama un *píxel*. Esta unidad con
67 67
 
68 68
 ![figure1.png](images/figure1.png)
69 69
 
70
-**Figura 1.** Distribución de bits para las tonalidades de rojo, verde y azul dentro de la representación RGB.  Cada tonalidad puede tener valores entre 0x00 (los ocho bits en 0) y 0xFF (los 8 bits en 1). 
70
+**Figura 1.** Distribución de bits para las tonalidades de rojo, verde y azul dentro de la representación RGB.  Cada tonalidad puede tener valores entre 0x00 (los ocho bits en 0) y 0xFF (los 8 bits en 1).
71 71
 
72 72
 ---
73 73
 
@@ -176,11 +176,11 @@ Ahora, comenzamos a recorrer la imagen píxel por píxel, empotrando en cada pí
176 176
 Podemos hacer lo siguiente para empotrar cada trío de bits  `b2, b1, b0`:
177 177
 
178 178
 ```
179
-Datos de entrada: p: un píxel 
179
+Datos de entrada: p: un píxel
180 180
     b2,b1,b0: el trío de bits
181 181
 Dato de salida: modifiedPixel: el píxel con el trío empotrado
182 182
 ========
183
-1. r = componente rojo de p 
183
+1. r = componente rojo de p
184 184
 2. g = componente verde de p
185 185
 3. b = componente azul de p
186 186
 4. "limpiar" o apagar" los bits menos significativos de r,g,b
@@ -232,13 +232,13 @@ Los siguientes son los códigos de los colores de los primeros ocho píxeles de
232 232
 | `0x00 00 00` | `111`  | `0x01 01 01`  |
233 233
 
234 234
 
235
-Pregunta: 
235
+Pregunta:
236 236
 ¿Qué mensaje está escondido (usando la técnica del bit menos significativo) en una imagen cuyos primeros 8 píxeles son:
237 237
 
238 238
 
239 239
 ```
240 240
 0x545554 0x666667 0x444544 0x333232
241
-0xff0000 0x0100ff 0x00ff00 0x10aaba 
241
+0xff0000 0x0100ff 0x00ff00 0x10aaba
242 242
 ```
243 243
 
244 244
 Explica tu respuesta.
@@ -247,36 +247,24 @@ Explica tu respuesta.
247 247
 
248 248
 ---
249 249
 
250
-!INCLUDE "../../eip-diagnostic/steganography/es/diag-steganography-01.html"
251
-
252
-!INCLUDE "../../eip-diagnostic/steganography/es/diag-steganography-02.html"
253
-
254
-!INCLUDE "../../eip-diagnostic/steganography/es/diag-steganography-03.html"
255
-
256
-!INCLUDE "../../eip-diagnostic/steganography/es/diag-steganography-04.html"
257 250
 
258 251
 !INCLUDE "../../eip-diagnostic/steganography/es/diag-steganography-05.html"
259 252
 
260
-!INCLUDE "../../eip-diagnostic/steganography/es/diag-steganography-06.html"
261
-
262
-!INCLUDE "../../eip-diagnostic/steganography/es/diag-steganography-07.html"
263
-
264 253
 ---
265 254
 
266 255
 ---
267 256
 
268 257
 
269
-##Sesión de laboratorio:
258
+## Sesión de laboratorio:
270 259
 
271 260
 En la experiencia de laboratorio de hoy completarás una aplicación de esteganografía para extraer mensajes ocultos en imágenes.
272 261
 
273
-###Ejercicio 1: Extraer el mensaje binario
262
+### Ejercicio 1: Extraer el mensaje binario
274 263
 
275
-####Instrucciones
264
+#### Instrucciones
276 265
 
277 266
 
278 267
 1. Carga a QtCreator el proyecto `Steganography` haciendo doble "click" en el archivo `Steganography.pro` en el directorio `Documents/eip/Repetitions-Steganography` de tu computadora. También puedes ir a `http://bitbucket.org/eip-uprrp/repetitions-steganography` para descargar la carpeta `Repetitions-Steganography` a tu computadora.
279
- 
280 268
 
281 269
     El proyecto contiene el esqueleto de una aplicación para recuperar mensajes empotrados en imágenes. Los mensajes que estarás recobrando se empotraron utilizando la técnica del bit menos significativo. El final de cada mensaje se codificó utilizando el caracter ASCII con código binario `00000000`.
282 270
 
@@ -291,7 +279,7 @@ En la experiencia de laboratorio de hoy completarás una aplicación de estegano
291 279
     Por ejemplo, si los primeros píxeles de la imagen fuesen los siguientes,
292 280
 
293 281
     ````
294
-    0x98 99 98 0x00 00 01 0x00 00 00 0x01 01 00 
282
+    0x98 99 98 0x00 00 01 0x00 00 00 0x01 01 00
295 283
     0x01 01 01 0x01 00 01 0x01 00 00 0x01 01 01
296 284
     0xf0 ea 00 0x44 00 f0 0x00 aa 22 . . . .,
297 285
     ````
@@ -305,9 +293,9 @@ En la experiencia de laboratorio de hoy completarás una aplicación de estegano
305 293
 Para poder implementar el algoritmo de extracción del mensaje, debes entender cómo fue empotrado el mensaje. Si es necesario, repasa la sección “Empotrando un mensaje en una imagen”.
306 294
 
307 295
 
308
-###Ejercicio 2: Interpretar el mensaje
296
+### Ejercicio 2: Interpretar el mensaje
309 297
 
310
-####Instrucciones
298
+#### Instrucciones
311 299
 
312 300
 
313 301
 1. Completa la función `binaryStringToMessage` que recibe el "string" de `0`'s y `1`'s extraido de la imagen para que devuelva el mensaje oculto. Puedes aprovechar la función `binStringToChar` para convertir "substrings" de 8 `0`'s y `1`'s en el caracter que le corresponde.
@@ -328,7 +316,7 @@ Para poder implementar el algoritmo de extracción del mensaje, debes entender c
328 316
 
329 317
 ---
330 318
 
331
-##Entrega
319
+## Entrega
332 320
 
333 321
 Utiliza "Entrega" en Moodle para entregar el archivo `steganography.cpp` que contiene las funciones `ExtractMessage` y `binaryStringToMessage`. Recuerda utilizar buenas prácticas de programación, incluir el nombre de los programadores y documentar tu programa.
334 322
 
@@ -358,7 +346,7 @@ Utiliza "Entrega" en Moodle para entregar el archivo `steganography.cpp` que con
358 346
 
359 347
 One of the advantages of using computer programs is that we can easily implement repetitive tasks. Structures such as the `for`, `while`, and `do-while` allow us to repeat a block of instructions as many times as needed. These structures are also referred to as *repetition structures*. In today's laboratory experience you will complete a steganography application to practice the use of nested loops and the manipulation of bidimensional arrays.
360 348
 
361
-##Objectives:
349
+## Objectives:
362 350
 
363 351
 1. Apply nested loops and decision structures to manipulate bidimensional arrays and extract messages hidden in images.
364 352
 
@@ -367,7 +355,7 @@ One of the advantages of using computer programs is that we can easily implement
367 355
 3. Use the binary representation of characters.
368 356
 
369 357
 
370
-##Pre-Lab:
358
+## Pre-Lab:
371 359
 
372 360
 Before coming to the laboratory session you should have:
373 361
 
@@ -388,24 +376,24 @@ Before coming to the laboratory session you should have:
388 376
 ---
389 377
 
390 378
 
391
-##Steganography
379
+## Steganography
392 380
 
393
-Steganography is the science of camouflaging the presence of hidden messages in legitimate carriers (seemingly harmless files). This science has been used by cybercriminals to inflict damage to computer systems and by (old style) terrorists to encode hidden messages transmitted through the internet. There is claim that Al-Qaeda may have used steganography to encode messages into images, and then transport them via e-mail, and possibly via USENET, to prepare and execute the September 11,  2001 terrorist attack. 
381
+Steganography is the science of camouflaging the presence of hidden messages in legitimate carriers (seemingly harmless files). This science has been used by cybercriminals to inflict damage to computer systems and by (old style) terrorists to encode hidden messages transmitted through the internet. There is claim that Al-Qaeda may have used steganography to encode messages into images, and then transport them via e-mail, and possibly via USENET, to prepare and execute the September 11,  2001 terrorist attack.
394 382
 
395 383
 Steganography has some lawful uses too [1]:
396 384
 
397
-* A medical imaging laboratory can embed a patient's information into the images, thus preventing against fraud and/or patient misdiagnosis. 
385
+* A medical imaging laboratory can embed a patient's information into the images, thus preventing against fraud and/or patient misdiagnosis.
398 386
 * We can use hidden information to identify the legitimate owner of a document or image. If the document is leaked, or distributed to unauthorized parties, one can trace it back to the rightful owner and perhaps discover which party broke the license distribution agreement.
399 387
 
400 388
 In this laboratory experience you will implement a simple algorithm to extract hidden messages from steganography images.
401 389
 
402 390
 ---
403 391
 
404
-##Image Editing
392
+## Image Editing
405 393
 
406 394
 In this laboratory experience, you will recover secret messages that have been hidden in an image. To be able to carry out your task, you should understand some concepts related to images, be familiar with the methods of the `QImage` class in `Qt`,  and with functions to work with data of the `QRgb` type.
407 395
 
408
-###Pixels
396
+### Pixels
409 397
 
410 398
 The smallest element in an image is called a *pixel*. This unit consists of a single color. Since each color is a combination of tones for the primary red, green and blue colors, it is coded as an unsigned integer whose bytes represent the tones of red, green and blue of the pixel (Figure 1). This combination is called the color's *RGB* which is an acronym for "Red-Green-Blue". For example, a pure red pixel has an RGB representation of `0x00ff0000`, while a white pixel has an RGB representation of `0x00FFFFFF` (since the color white is a combination of tones of red, green and blue in all of their intensity).
411 399
 
@@ -419,7 +407,7 @@ The smallest element in an image is called a *pixel*. This unit consists of a si
419 407
 
420 408
 `Qt` uses the `QRgb` type to represent `RGB` values. Using the functions that are described below we can perform important operations to analyze images, such as obtaining the RGB of each pixel in an image, and to obtain the red, green and blue components of the `QRgb` value of the pixel.
421 409
 
422
-###Library
410
+### Library
423 411
 
424 412
 In today's laboratory experience you will use the `QImage` class. This class allows you to access the data in the pixels of an image to manipulate it. The documentation for the `QImage` class can be found in http://doc.qt.io/qt-4.8/qimage.html.
425 413
 
@@ -430,8 +418,8 @@ The code provided in the file  `steganography.cpp`  contains the following objec
430 418
 
431 419
 The objects of the `QImage` class have the following methods that will be useful for today's laboratory experience:
432 420
 
433
-* `width()`      // returns the positive integer value for the image's width 
434
-* `height()`      // returns the positive integer value for the image's height 
421
+* `width()`      // returns the positive integer value for the image's width
422
+* `height()`      // returns the positive integer value for the image's height
435 423
 * `pixel(i, j)`       // returns the `QRgb` for the pixel in position `(i,j)`
436 424
 
437 425
 
@@ -443,7 +431,7 @@ The following functions are useful to work with data of type `QRgb`:
443 431
 
444 432
 
445 433
 
446
-####Examples:
434
+#### Examples:
447 435
 
448 436
 1. If the following `4 x 4` image of pixels represents the object `origImage`,
449 437
 
@@ -483,7 +471,7 @@ int main() {
483 471
 ---
484 472
 
485 473
 
486
-###Embedding a message into an image
474
+### Embedding a message into an image
487 475
 
488 476
 One of the simplest methods of *hidding* a message in an image is by encoding the message into the least significant bits of the image pixel's colors. This method effectively hides the message in the image because changing the least significant bit of a 8-bit color is barely noticeable by the human observer.  
489 477
 
@@ -502,7 +490,7 @@ Let's illustrate the embedding procedure of the word "Dog" into the following im
502 490
 
503 491
 ![main3.png](images/main3.png)
504 492
 
505
-Assume that each square is a pixel of the image. 
493
+Assume that each square is a pixel of the image.
506 494
 
507 495
 The first step would be to obtain the ASCII representation of the message. The bits of the ASCII representation are the bits we will encode into the colors of the pixels. The ASCII representation of `Dog` is:
508 496
 
@@ -527,7 +515,7 @@ Input: p: a pixel
527 515
 b2,b1,b0: the trio of bits
528 516
 Output: modifiedPixel: the pixel with the embedded trio
529 517
 ========
530
-1. r = red component of p 
518
+1. r = red component of p
531 519
 2. g = green component of p
532 520
 3. b = blue component of p
533 521
 4. clear the least significant bits of r,g,b
@@ -576,12 +564,12 @@ The following are the color codes for first eight pixels of the original and mod
576 564
 | `0x00 00 00` | `111`  | `0x01 01 01`  |
577 565
 
578 566
 
579
-Question: 
567
+Question:
580 568
 What message is hidden (using the least significant bit technique) in an image whose first 8 pixels are:
581 569
 
582 570
 ```
583 571
 0x545554 0x666667 0x444544 0x333232
584
-0xff0000 0x0100ff 0x00ff00 0x10aaba 
572
+0xff0000 0x0100ff 0x00ff00 0x10aaba
585 573
 ```
586 574
 
587 575
 Explain your answer.
@@ -591,19 +579,8 @@ Explain your answer.
591 579
 
592 580
 ---
593 581
 
594
-!INCLUDE "../../eip-diagnostic/steganography/en/diag-steganography-01.html"
595
-
596
-!INCLUDE "../../eip-diagnostic/steganography/en/diag-steganography-02.html"
597
-
598
-!INCLUDE "../../eip-diagnostic/steganography/en/diag-steganography-03.html"
599
-
600
-!INCLUDE "../../eip-diagnostic/steganography/en/diag-steganography-04.html"
601
-
602 582
 !INCLUDE "../../eip-diagnostic/steganography/en/diag-steganography-05.html"
603 583
 
604
-!INCLUDE "../../eip-diagnostic/steganography/en/diag-steganography-06.html"
605
-
606
-!INCLUDE "../../eip-diagnostic/steganography/en/diag-steganography-07.html"
607 584
 
608 585
 ---
609 586
 
@@ -614,45 +591,45 @@ Explain your answer.
614 591
 
615 592
 In today's laboratory experience you will complete a steganography application to extract hidden messages from images.
616 593
 
617
-###Exercise 1: Extract the binary message
594
+### Exercise 1: Extract the binary message
618 595
 
619
-####Instructions
596
+#### Instructions
620 597
 
621 598
 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.
622 599
 
623
-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`. 
600
+   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`.
624 601
 
625 602
 2. Compile and run the program. You should obtain an interface that looks similar to:
626 603
 
627
-![img1.png](images/img1.png)
604
+    ![img1.png](images/img1.png)
628 605
 
629 606
 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.
630 607
 
631 608
 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.
632 609
 
633 610
 
634
-For example, if the first few pixels the image were these:
611
+    For example, if the first few pixels the image were these:
635 612
 
636
-````
637
-0x98 99 98 0x00 00 01 0x00 00 00 0x01 01 00 
638
-0x01 01 01 0x01 00 01 0x01 00 00 0x01 01 01
639
-0xf0 ea 00 0x44 00 f0 0x00 aa 22 . . . .
640
-````
613
+  ````
614
+  0x98 99 98 0x00 00 01 0x00 00 00 0x01 01 00
615
+  0x01 01 01 0x01 00 01 0x01 00 00 0x01 01 01
616
+  0xf0 ea 00 0x44 00 f0 0x00 aa 22 . . . .
617
+  ````
641 618
 
642
-your `ExtractMessage` function would extract the least significant bits of each colors component and construct the `string`: `"010001000110111101100111000000000.."`.
619
+  your `ExtractMessage` function would extract the least significant bits of each colors component and construct the `string`: `"010001000110111101100111000000000.."`.
643 620
 
644
-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.
621
+  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.
645 622
 
646
-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"
647
-(because `01000100` corresponds to 'D', `01101111` is 'o',  `01100111` is 'g', and a `00000000` symbolizes the end of the string.)
623
+  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"
624
+  (because `01000100` corresponds to 'D', `01101111` is 'o',  `01100111` is 'g', and a `00000000` symbolizes the end of the string.)
648 625
 
649
-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.
626
+  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.
650 627
 
651 628
 
652
-###Exercise 2: Interpreting the message
629
+### Exercise 2: Interpreting the message
653 630
 
654 631
 
655
-####Instructions
632
+#### Instructions
656 633
 
657 634
 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.
658 635
 
@@ -661,7 +638,7 @@ To implement the algorithm for extracting the message, you should understand how
661 638
     * `pug.png`, contains the message "Hello World !"
662 639
     * `uprTorre.png`, contains the message "CCOM3033 - Steganography Lab Rules!!!"
663 640
 
664
-3. Once you validate your program using the test images, use the program to analyze the following images. 
641
+3. Once you validate your program using the test images, use the program to analyze the following images.
665 642
 
666 643
     * `gallito.png`
667 644
     * `puppy.png`
@@ -672,7 +649,7 @@ To implement the algorithm for extracting the message, you should understand how
672 649
 
673 650
 ---
674 651
 
675
-##Deliverables
652
+## Deliverables
676 653
 
677 654
 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.
678 655
 
@@ -681,6 +658,6 @@ Use "Deliverables" in Moodle to upload the `steganography.cpp` file that contain
681 658
 ---
682 659
 
683 660
 
684
-##References 
661
+## References
685 662
 
686
-[1] Rocha, Anderson, and Siome Goldenstein. "Steganography and steganalysis in digital multimedia: Hype or hallelujah?." Revista de Informática Teórica e Aplicada 15.1 (2008): 83-110.
663
+[1] Rocha, Anderson, and Siome Goldenstein. "Steganography and steganalysis in digital multimedia: Hype or hallelujah?." Revista de Informática Teórica e Aplicada 15.1 (2008): 83-110.