Okay so now in this section we will try to embed a malicious filing to damage right.
So let's start with that.
So this is modeled like the the executable file that we want to embed.
And this is the test file.
Our image that we will use to embed this malicious code inside.
Our goal is to embed this in this executive.
So we will use this package that we currently downloaded to achieve our objective.
So we need to define two things.
The first thing we need to define is a gay to get file which is the test or debug big fight these files
contain our malicious code.
So let's define this as Gary.
Fine.
And then we need to give the name.
So it would be best not to take the second thing we need is a data file malicious file.
So I am going to call it mendacious by its.
And then I need to provide a name which would be mailed out C before proceeding forward.
Let's go to the explorer
and see the size of the file.
So currently the size of this desk file is 538 KP.
If you go to properties you can see that it's five thirty seven KP every Stipe is chipping.
So and next thing we need to do is we need to define the name of output file that will contain our embedded
code.
So let's call it and coded file and last name it and call it just JPEG.
So now you have three files defined so the rest is very straightforward.
What we need to do is we need to call a function.
I use this package so I'm going to call stack dot and then I need to use the method call in code file
names.
So this function will encode these files.
Uh this malicious code into this carrier your file and if you go to the documentation you can see that
it requires two strings.
Gary had failed to file an end result file.
So we will give these files in sequence.
So our cost would be a year.
Fine.
And then it would be malicious fine.
And last would be encoded file and that's it.
This really isn't an output file which will contain our embedded code work.
Let's just check for an error.
So uh.
Because to me you can say that if a is not equal to men you can simply print out the error from dot
print and then print that and then we can exert our will come here which is not exact.
And so you can show a message that it has been successfully encoded
encoded
to this out.
Yes.
OK.
So now we will run this program and you will see that a new file will be created.
So I am going to run it as go on may not go and you will see that it will take some time and now it
says that file has been successfully encoded.
If you go over there you can see that there is an encoded DNA test file.
If you double click it you can see that it is the same file and there is no difference between these
two files.
This is the test file and.
OK.
So can they split it later vertically.
OK.
So you can see that this is the test file and then this is the encoded.
There is no difference between these two files but if you go to the Explorer you can see that the encoded
text has a huge size which is two point six and b while the original I was just 538 gave me.
If I check it here you can see that it is two point six m b which means that now this data has been
encoded in the next lecture where we learn how to decode this data.