Steganography is the process the science of taking data and hiding it in other data. Now, be careful with this because cryptography is the process of taking data and encoding it in some way so that other people can see that there is data there, but they can't read it was steganography. The data itself may or may not be encoded, a lot of times it's not encoded, but it's hidden and other data so that people don't even know to look there, that that might be the data they're looking for. So when we talk about steganography, the number one way we talk about it is that we take data, usually text, and then we hide it within graphic images. So to help you see how this all works. I've got this great picture of me right here.
Okay. Thanks, camera guy for making such a great picture of me anyway. So what we're going to do is we're going to take this PNG file, and we're going to embed a little bit of text, a little bit of secret text into the piece. itself. So to do that, well, there's a lot of ways to do that. But to start off, we're going to go a little bit old school.
And by talking about old school, what I mean is I'm going to open this up. In this case, I'm going to use a word processing program WordPad. So let's take a look at what we see here. Now, this is interesting, because what we're looking at is, instead of looking at a PNG file through a graphics editor, or through an image viewer or something like that, we're just bringing out the raw text that's within that image. So there's a couple of things that are kind of handy here. For example, you see the PNG up at the top, almost every graphical format on earth starts off with a three letter combination for letter combination, identifying exactly what it is.
Now PNGs, use a lot of headers, and as we scroll through here, we can see there's all kinds of header information, but there is a certain point where the actual data that is the image begins to show up. So what we could do, let's give this a try. I can pick some arbitrary spot. And now watch what I'm going to do. So you can see I've typed in this is secret text. Now there's a couple of downsides to this.
First of all, we're gambling that the image will just see this little bit of text I've written in in and try to interpret a pixel or two to be something different. But things are kind of persnickety in graphics formats, for example, you have a bunch of images, and then you have the end of that line as it begins to draw the next line to the image. If I were to mess that up, well, we could run into trouble. So there's a lot of issues involved with this that can make simply going in in a raw way like this work or not work. So I'm just I'm not going to save that. But let me show you one example.
Here's an example where I actually went in and I just tried to type in this is secret text. And I got a result like this. This is actually a good result. It's still thinks it's a PNG file. It's just Having trouble interpreting it, I've seen a lot of times where you mess up and it's like, I don't even know what this is, and it just blows up. So keep in mind, the whole idea of steganography is that to the normal person will just look like a PNG file.
So to get around this problem, what we do is there's lots of little tools out there that allow us to do steganography. So this one particular program is called image steganography. I like this one, because it's not complicated. What he can do is embed some data into bmps JPEGs PNGs, because the program knows these file formats, and it's not going to let you accidentally put it in a place where it's gonna mess stuff up. So it's actually trivially easy to use. So I'm just going to drag an image over here.
So I can type in this is secret text. And now it's gonna say Where do you want me to put this and I'm just going to say call it Mike pick three and just Dump it to the desktop. So you'll see here, we are actually encoding it. We're not encrypting it, we're just going to leave the actual text there. And these are different ways that it can embed the information. But what is important is we're going to go ahead, and we make this.
And here's the cool part. So we've made this new file, let's take a look at it. So just opening it up. There's nothing really to see here. And that's the whole idea of steganography. You want to hide the data, whether it's encrypted or not unimportant.
The only downside to this is that because I use this tool to perform the steganography, I need to give the other person this exact same tool because he has a proprietary way of hiding that data. So to actually get the data back out. What we're going to do is we take the encoded image, I can output it to a file, I'm just going to say output to text. And if I've done it right, it's able to read the information that was put into that So steganography is actually pretty cool. I've done a lot of work with like the FBI and the DEA. They watch out for stuff like this because it is a great way to hide stuff.
It's an unsophisticated way to do it. But when you're not looking for it, it can be a real challenge. Watch out for steganography