In this lesson,
we're going to learn a little bit about steganography,
including how to perform steganography
and what tools may be used to do steganography.
Steganography is this hiding technique
where we're trying to hide data in plain sight.
Essentially, steganography
is the practice of concealing data
within another file, message, image, or video.
Now, there are lots of modern tools out there
that can help you hide digital information,
so the human eye cannot tell the difference.
For instance, there's this Java tool
called LSB Steganography,
and you can put a secret message of text
in the top part of this blank.
You'll upload an image,
which is the original image on the left side,
and then you will end up saving that text into the image.
Now, if you look at that image with the naked eye,
you cannot tell the difference.
But what's ended up happening here
is that in the background, those words of ASCII text
have been converted into ones and zeros,
and they have slightly modified one pixel here
and one pixel there in that final image.
And those single pixels are only being changed
by a fraction of a bit.
So it might be yellow,
and now it's a little bit of a lighter yellow.
This one might have been a green color,
and now it's a little bit of a darker green.
And all those ones and zeros are put throughout that image.
And it does affect the image quality just a little bit,
but it doesn't really add to the file size
or change the file much at all.
And so it's very easy to hide information in these files.
Now the reason we call it hiding in plain sight
is because there is no encryption here.
Anybody who has this tool
can actually take that steganography image,
load it into the tool,
and then pull out the data back to the text as well.
Now, the reason I wanted to bring up steganography to you
is not because it's used
heavily inside the attacker workspace.
In fact, it's one of the least common ones
that I've seen out in a while.
But it is important to think about
because data loss countermeasures
do inspect outgoing packets
for a lot of different signatures,
and they're looking at those signatures
to see if they match a database of known file signatures.
But if I take that file
and I put it inside another file,
such as I did here with this text,
putting it inside the image,
that will actually be circumvented
from that countermeasure signature matching
because we are not going to match that text.
That text now became this image,
or we're not going to match the original image
because now we have the text embedded in it
and that changes the file a little bit.
So this is something to keep in mind
as you're looking at it.
In addition to using text and images,
you can use audio files, video files,
pretty much whatever you want,
and you can hide other data inside of those type of files
and then pull it out using steganography.
If you've ever seen an old spy movie
where one spy takes out a classified ad in the newspaper
and the first letter of each word
makes up the secret message, something like "meet at six,"
this is a version of steganography.
Note that data isn't going to be encrypted when you do this.
It's just going to be hidden inside another message.
And if you know what the key and what you're looking for,
then it's really easy to see the message
inside wherever it's being hidden.
So in the case of my newspaper example,
writing down the first letter of each word
gives you the secret message.
Now basically, if anybody knows where to look,
they can easily pull that data back out.
So let's jump into the lab environment
and see how easy it is to hide some data
inside a standard photograph using a steganography tool,
and then getting that back out on the other side.
To conduct this demonstration,
we're going to load a steganography program
up inside our web browser.
You can try this at home if you want to.
All you have to do is go to this website
as you see on the screen,
stylesuxx.github.io/steganography/, and hit "enter."
When you get to the screen,
you're going to be asked to choose a file.
So I'm going to go ahead and choose a file off my desktop,
which is my logo, Dion Training.png,
and then you're going to type in
whatever the messages you want to hide.
"This is a secret message for my students only.
Steganography is fun."
Okay, so we're going to go ahead and hit "encode."
And when you do that,
you'll see what your binary representation
of your message is.
You'll see the original you had.
You'll see the normalized version of it.
And notice these logos all look the exact same,
and then you'll have the hidden message version.
If you right click that and save it,
you can go ahead and save it to your desktop.
And I'm going to do it as "Dion Training message,"
and you'll see it there on my desktop.
Now, if I look at these two files side by side,
we'll have the Dion training one up here,
and the hidden message one right here.
They look identical in every way, don't they?
Right, exactly. They do.
And so if we go ahead and close these,
we can actually look at the file size of them.
And so here we have on the left is Dion Training.png,
which is the original.
And you can see the file size
or the dimensions of it are the exact same as the new one.
We haven't changed that at all,
but we did change the file size
and we went from 74 kilobits down to 57 kilobits.
Why if we put more information, did the file size shrink?
Well, it's because the way they re encoded it
to make sure the images looked exactly right
and the compression they used,
sometimes the file size will get bigger as well.
But it is very infrequent
that you'll see the same file size.
So this may be one way
that we know the file has been changed.
Now, if we want to see the actual message inside of it,
let's go over here to decode
and let's go ahead and choose the original file.
And if we hit "decode,"
you'll see that there is no message inside that one.
See, there was no hidden message.
It came out garbage because there was no hidden message.
But if I choose the one that we hid the message inside of,
we hit "open" and hit "decode,"
you'll see that our hidden message comes right back.
"This is a secret message for my students only.
Steganography is fun."
And so if you want to play with this, you can.
You can go through and do some of this
and send it to your friends
and have them send you messages back.
But remember, the information isn't encrypted
when you're doing this steganography.
You're hiding it in plain sight.
So if I actually decided to open up
Dion Training message.png,
the one that has this hidden message in it,
inside of a hex editor,
you could actually find that message hidden inside of it.
It's not encrypted.