Welcome back all.
So today I'm going to go ahead and bring about the creation of the decryption program.
A lot of you have asked me for this and I did promise you this and I am really sorry that it took a
while to get this out but yeah I've had some problems my life with a lot of other things that required
my attention and I just couldn't find the time at all.
I am so sorry to everybody that was the first thing that I wanted to say.
Now with that out of the way let's go ahead and create decrypt the program for decrypting the encrypted
files that the key logger actually sends.
OK.
So I'm hoping you have code locked installed by this point in time.
So we just open up code locks and wait for it to start.
OK so click on then go ahead and click on Create new projects select the console application next.
Make sure you have C++ selected next and name your file name or name your project.
I'm going to name my decrypt name yours but if you want to set the path to be to go to the desktop sort
of finish.
Yep there we go.
Excellent.
So we go into the main see Peepy and we zoom this in.
Delete this part and delete this part.
Also I would like to address another another question and some of you have raised concerns that the
code of the key logger is not the same in the cores as it is on the Get hub there are some trivial changes
like for example instead of actually plugging in the general namespace like that instead of plugging
in the namespace in a general sense like this so using name space as namespace SDD.
I didn't do that.
I just did this so SDD colon colon string.
So instead of instead of actually plugging it in here I've been plugging it in like this.
It makes no difference in terms of the code.
It just just my way of coding.
You can use both ways.
It doesn't actually make any difference in regard to the code.
So in regard to the functionality of the code and I haven't included the same things as I did in the
course but again it doesn't matter because a lot of the includes here during the course were for demo
purposes it's like Shontelle except for.
So some of them are not needed for the proper functioning of the Kilger.
But whether you plug them in or not it's still going to work no problem.
So those are the those are some really minor trivial differences that exist.
But either way whether you do this or dad or both combined it's it shouldn't affect the code in any
way.
Not as far as I can see both versions work just fine for me and they still work just fine for me and
they still do.
I mean I didn't just write this without any sort of without conducting any sort of test tests.
I can I've tested this in a series of environments and a series of different machines and it worked
on all of them anyway.
Let's go ahead and begin writing our decryption programs so we're going to need a string and extreme
in addition to this case so to include and we're going to do stream and then we're going to conclude
I'm going to write out a section of this code simply because there isn't a lot of it that's fairly simple
to actually type it out.
So it needs upstream and we need string.
Ok so those are those are two additional includes which we need to make here.
Now we need to make some modifications in regard to the main function.
So the main function will each take arguments it's going to be in art.
SEE ups are see and just need to turn on the light.
So because I can't I don't have a backlit keyboard and it's very dark.
Anyway thank you for allowing me that break.
Let's go ahead and continue.
So char then we're going to get a pointer here or V.
And that just close and open blocks.
OK.
So this will allow us to actually pass a string to our code to our program and we actually run it.
We don't need to recompile 100 times just compile it once and then you keep on passing the arguments
to the two arguments that this program will receive are basically the file based.
It needs to two parameters so two arguments needs input and needs output.
So you need an input file and you need an output file just give two parts and that's it.
So the files that you wish to decrypt and the file that you wish to use as a storage place for decrypted
content of the encrypted file.
Simple as that.
No big deal.
So let's go ahead and begin off with the if statement here.
First we need to check the amount of arguments.
So if c is not equal to 3 going to see a return see out and then we wish to print something out onto
the screen like that there was an error message or whatever.
Let's say that program needs to.
It's been a it's been a while since I actually wrote this code I have it in my notes but I've written
it and I just didn't have the time to cast that.
So bear with me here if I make some errors
or arguments and then type in later input and output exclamation mark for the melodrama.
So let's just go ahead and move everything that comes afterwards into the into the next line so.
And in addition to this printout we're going to return error code to it.
So the error code 2 will symbolize will be symbolic to this message that we have passed insufficient
arguments to the to the to the to the to the main function to the program that runs.
OK.
So let's go ahead proceed.
So the string and then space and we're going to name the string in and this string will be initialized
with the following things.
So are the are going to put one here.
Swear to god it was so many simpler ways to write this.
I didn't know what was going through my mind.
I must have been really late at night or something like that.
We're going to do our V one and
this needs to actually go into parentheses.
Apologies.
OK so there we go.
And we're going to leave.
Let's just rewrite this one so out and then space.
So string it will be initialized with the argument one and the string out which is the next string and
the line will be initialized with the argument number two.
So are v
two k so close that and let's go ahead and clue and do a line terminator.
Let's go into the next line.
We have initialized two strings.
Basically the arguments that are passed on the command line to the program at the time of the program's
execution.
OK so then we type in if stream and we're going to name this one.
If I know the names for the strings are arbitrary you can use pretty much what you want to make sure
that if you change the name of the string the changes are reflected in the rest of the code.
And then we're going to go in to another if statement so which is if phi is false meaning if it's empty
if it's empty it will be null or something like that.
In any case it will be evaluated to false if it if there is something in it if there is some sort of
value into it in it that will be evaluated as true.
So if there is something in the input.
I mean if there if the input is actually empty then we're going to return an error code so return C
out.
There's a bit of a redundant airchecks here as this is a simple program but I guess it's just a programming
habit so cannot read input file like I just can't do this.
In
OK so was like awesome typing skills and just give it another quote mark so the street the file will
be in the quote marks.
A single quote marks and then we're going to do and L comma here and we're going to return the error
code 3 so error code 3 will symbolize that it cannot read the input file for whatever reason.
Maybe you don't have a permission maybe doesn't exist except for so it cannot read the input file it
just can throw this error for whatever reason.
OK so next thing we need to do is string data.
OK.
And if UPS so we're going to stream this stream into data are we going to output into.
We're going to input into data.
Okay.
But is getting a little bit dry but it's nothing too terrible.
I have just neglected to write a few things here.
So SDD could colon and one with C out also needs SDD colon colon because I didn't include the name space
at the top so string if stream
right this out.
E code and call on.
And we need string steek the colon colon.
I don't know I could have I could have enabled at the top but you see when you start including name
spaces here there wouldn't be a problem in a program like this but if you have a program where you need
to include multiple names spaces including custom name spaces and if those name spaces contain types
with the same names for example you have your own custom type string and then you have a system string
that's going to be a problem because when you call a string.
I'm not sure which one will call or really get actually confused.
Well it's called the system one or we'll call your own custom one except for that's why it's kind of
a better practice to state from which namespace are you calling what in in such a way.
You insure yourself to far greater extent so Endal also needs a CD.
And of course they can.
Been awhile since I did this so bear with me.
Lately I've just been programming in Java.
It's completely different.
I got to tell you that.
OK so anyway we can do a semi-coma here if there is a mistake up there somewhere that the compiler will
tell us and we'll go over any possibilities of logical mistakes as well.
If I notice any.
OK so just one more thing I forgot right here so SDD.
Colin Colin this one needs also the namespace SDD Anyway now we can move on because in my notes I've
actually plug the SDD namespace up there.
And here I would like to plug them in as is.
OK so moving on.
Now we're going to do another one.
So
if I is once again empty or if there is some sort of problem with it I mean if it's not empty if after
attempt to stream into data input into data if there was a problem just go ahead and do a return and
tell us basically this.
So see out there is a bit of redundant debugging here.
Debugging statements here and a lot of cases were taken into consideration for a program of this magnitude
which is not very large.
So input file and then we're going to go ahead and space
SDD colon colon
kick.
So let's go ahead and do this in
open up the quote to Gants will quote marks space
corrupted.
OK let's say that it's corrupted here
and L and this will result in the error code for.
So this will be the return code for if it's corrupted or something like that.
OK so now we're going to need to basically decrypt the given data and we're going to type in data.
We're going to state that it equals and we're going to type in just
decrypt
the script is 64.
OK so this is a call to a function which actually will be returning a string which we still haven't
actually made.
So we need to actually make the function decrypt base 64 and we can do that by opening up get up and
on get help these repositories are open.
So anybody can access them without the need to log in or register anywhere.
You have the link right here.
It's a shitty piece colon slash slash get hub dot com slash creator 69 slash keylogging dash.
And we need to go into base 64 are H and this function exists.
I just didn't utilize it.
It was written here and there you go it says decrypts 64 base 64.
It is a string and it returns a string.
So you can just go ahead and copy it.
No big deal.
It was actually in your C++ code but inactive and dormant because it wasn't called at all so control.
See I haven't written it in the course itself but I did upload it to get help so that people can actually
see.
Keep in mind that I mean just go ahead and zoom in even more.
That was my Linux system telling me that I need to updated the sound the perfect unsounded you heard
in the background so there is encrypt be 64 and decrypt be 64.
So these two functions need to match each other's procedures and decrypt base 64 is basically a reverse
of encrypt base 64 be 64.
So what if you have modified this in any way form a manner that those ups.
OK let's do it like this.
Those changes need to be reflected here.
If they are not reflected here this secret function will not decrypt properly.
So this is the encryption process.
And as I've explained in the previous lectures of the Clogher course and I'm going to be uploading these
videos to the article hacking as well so that people have access there as well because I've used the
clogger for certain things.
This part is heavily customizable so this part is actually intended to be customizable so that people
can formulate their own encryptions well not their own encryption but sort of people can put their own
souls and obscured by 64 encoding with their own Salt's.
If you have made any changes there.
Do you need to make sure that those changes are reflected here.
Because this is the decrypt the 64 is reversing the process of encrypt the 64.
Keep that in mind so you can just go ahead and so lact all of this right.
Press Control see and then go into code blocks and we can actually I'm going to put it down below.
I'm going to prototype it up above.
So just do that and then go ahead and Control-C this and put it up here.
And you need to change the name.
But because actually it's simpler to change the name down below so instead of base 64 just type in be
64 and pass the string data.
Press Control as to save all of this and I bid you farewell now because I'm running a little bit short
in terms of time and I'll see you in the follow tutorial where we will continue onwards with this.