Let's dive deeper into steganography and to see how an image can embed another file, without destroying
the original one or without anything being noticed.
An image is composed of pixels.
Let's take for example an RGB image, sometimes referred to as a true color image.
The color of each pixel is determined by the combination of red, green and the blue intensities stored
in each pixel.
For example this is the RGB code of this color
and the RGB code of this one. RGB
images are stored as 24-bit images where the red, green and blue components are 8-bit each.
This yields a potential of 16 million colors. Usually using an image processing application
you can see each pixel’s color as 3 numbers in base 10, between 0 and 255.
These are the numbers for this color
they are 255, 0 and 102. For this one
the red intensity is 51,
green is 204 and the blue 255. These are the red, green and the blue components.
Note that an 8 bit number is between decimal 0 when all beats are zero and the decimal 255 when all
beats are 1.
These are some examples of colors and they are RGB code.
Note that you can also represent them in hexadecimal if you simply convert these numbers to base 16.
This is the hexadecimal code of this color.
Let's write to the RGB code of color orange! This code! So color orange
RGB 255 , 153 and a 0.
This is its code.
Now let's convert these values to binary or base 2.
This is a very simple operation but I'll use this online tool; so from decimal to binary 255 -
-this is the binary number - and I'll copy paste it here.
Then we have 153.
I'll take the binary number and 0 which means 8 bits of zero 4 6 8.
Okay, this is the color orange in binary.
Perfect!
Now this is a term called the "least significant beat" or LSB of any byte and is the right-most
bit. This right
most one is the least significant bit.
This one! This one for the second bite and this 0 for the last byte.
Now in the context of steganography the secret file will be hidden by manipulating and storing information
in the least significant bits of the image or the sound file; if a user manipulates the least significant
bits of a color in a pixel the effect will be so small on the amount of that color that the human naked
eye will not perceive it at all.
However the more bits a user replaces the more obvious the alteration will appear to both a statistical
and visual inspection. Let's
suppose we want to embed 3 bits 1, 0 and 1 in this pixel.
1, 0 and 1 so the resulting pixel will be this 1.
Here is 1.
Here I'll put 0,
the second bit and 1
So the new RGB code of the color will be
the first byte will remain 255, okay.
Let's see the value of the second byte!
Now I'm converting from binary to decimal.
This is the binary number and it's 152 in decimal, in base
10.
And the last one will be 1.
The user may later recover the secret information by extracting the least significant bits of the manipulated
pixel and recovery the original message.
Let's see how this new color looks like!
This was the original color,
this one, and the new color is this one.
It's the same color for the human naked eye. By the way if you modify the least significant bit it means
you modify one bit in every group of eight bits and that means 1 divided by 8 or 12,
5% so in an image of one megabyte you could embed a file of 125 kilobytes.
In practice steganography tools will allow you to embed the much less information in order not to be
detected.
Okay, that was the theoretical part of steganography.
Of course each tool can use a different algorithm or variation of more algorithms but the fundamentals
are the same.
They have to modify the cover file in such a way that no one can detect it.
I wanted you to deeply understand how it works! In the next lecture
I'll show you a some hands on applications of steganography.
See you in a few seconds.