Hey everybody.
Welcome back.
So this in this video we're talking about base64.
Now what is base 64.
We briefly touched on this in previous videos.
However I want to talk about this a little bit more in-depth now.
This was an encoding scheme mainly built for the HDTV protocol.
Now this was how this was done to help transfer data a little bit more safely with a correct with a
similar format.
Now this was invented as part of the main content transfer encoding set which I'll leave to you guys
to look up a little bit more details but understand that was a basic base64 was a HDP related invention
now as we talked about before we could use this to transfer data because it takes Unicode data are unprintable
characters over to a principle set which is what we use.
Now what this happens is as you see the chart at the bottom of the screen here.
These are all the characters that are available in base64.
So everything will be converted to one of these characters which is all principal characters on the
ascii table.
So it's very easy to take a string of this and copy it over to another machine and in turn.
Now you have your full executable.
So a base64 will do is it will do.
It will divide the bytes of the dataset you provide it into six bits and then every six bits goes into
a group and then every group will provide a specific character based on the following chart.
Now or go over this a little bit more in detail so what we have is we have a string called out right.
So we'll convert each of these characters to hex which will go.
We're going to go over hex in a video in this module.
However just bear with me for this particular case this is just so you can visibly see it.
So we converted to hex so we get our 0 x 4 0 7 7 0 x 21 which converts to the O W exclamation point
respectively.
Now we'll convert these three bytes into twenty four bits.
So these are the bits total and then we'll grouped them in sets of six so you can see here it's just
taking the first six.
Hacking off their next six hacking at there and we continue on where we go.
Now when we convert all of these into a digit like for example the six bits at a time will always be
between zero and sixty three.
And when we convert this based on the chart up here we can get our find the output of T three C H.
Now this is just a quick representation there's hundreds of converters online.
So in most cases you're not going to be doing this by hand ever.
And also there's the command line option as well which we've already we've already shown about.
Now what's important understand is that it must be groups of it must be groups of six bits.
Another important bit is the at the end of it if it doesn't completely match into six bits.
So let's say you had another exclamation point at the end.
That would not fit into six bits completely.
So what's going to happen is it's going to pen zeros to the end of those bits which we see right here.
So if this one wasn't here it would be set to a zero.
When that's done you're going to commonly see an equal sign at the end of the base 60 for string a quick
way to identify the base 64 encoded string is that equal sine at the end.
And this common care the amount of characters here just a quick quick way to identify it.
We've already played around with this before but feel free to look a little bit more into it.
Try converting some of that yourself.
But what you're going to have to do is learn how to convert it to hex convert that hex to binary or
bits which is what you're seeing here and then converting those splitting them into six groups and then
converting the binary back to decimal.
Now you can do this manually.
It's not going to be the quickest option to do it but feel free to go ahead and give it a try.
It's always good to kind of do things manually sometimes just to understand the process that happens
behind it.