Hello and welcome to command line
basis. In this video, we learned
Lennix final commands five.
I'm Christopher.
And let's begin
so our lending objectives for this
video, we're going to do a quick
refresh on hashes and encoding
the differences between them and
what you can expect.
We're going to understand the basics
for command, learn the modify
some command and learn the shell one
command.
And if you're not very familiar with
any cryptography, hashing or
encoding, don't worry about it too
much. This is a very brief
overview to help you feel
comfortable at it from the command
line.
So assessment, once a file
is encoded with base64,
it can't be read.
This is true or false.
The answer is false, so
including by itself, it will
change it, so it's not human
readable, but the encoding is always
reversible.
So even though we encoded it
with base64, we can decode
it with base64 again.
That way it can be human readable,
readable compared that
with encryption, unless we have
the key, we cannot read an encrypted
file.
So kind of refreshing on HACHIGIAN
encoding, encoding changes,
plain text, and it is easily
reversible.
So imagine
I speak English and let's say
there's somebody else in the room
that speaks French, even though
they may be speaking French to me.
I can't understand it because it's
not plain text to me.
Now, if I had an interpreter,
someone who spoke French and
English, they could change
that encoding for me.
That way I can understand the French
through that encoding scheme.
And this is a very useful,
easy way to kind of remember how
encoding works.
And it's important to understand
that encoding is reversible.
So it's not a valid way to
store secret.
Now, hashing is a one way algorithm
and hashing is used
to verify integrity
for either a string or for a file.
And hashes uses all sorts
of these different algorithms
running over and over again in order
to be able to specifically
output a fixed string of characters.
And that is used to validate
integrity. It cannot be reversed.
So hashing is not encryption
when it is used to verify
the integrity of history.
All right, so basically for
what we're going to do, we're going
to take standard input, standard
output, pipe it into the base,
sixty four command and it will
encoded into these non
human readable characters.
So this is used for file transfers,
emails and all sorts of different
things that you'll see on the
Internet.
And it's also commonly
used to obfuscate malware commands
or hide different powerful commands.
So this is something you will see in
your cybersecurity career pretty
often.
So it's important to be comfortable
with base64 and know how
to decrypt or decode
base64 in the command line as well.
So let's give a demonstration
of this in my machine
and say I'm going to echo
this is my
encoded
strength.
And we can see it echoes this
properly to the term.
Now, I'm going to
encode this with base64
and look at that.
If you did not know
that I typed this is my encoded
string, don't even begin
to tell me that you can understand.
That is what that means.
This is not human readable.
I can't understand this.
You can't understand it.
Computers can understand if we tell
it how to.
So let's say we have
this output.
This is our base.
Sixty for encoding.
I'm going to copy this
and I'm going to echo this
into our shell.
And in order to decode basically for
it's going to be the base. Sixty
four cm in space
D for Decode
and check it out.
It decoded this
non human readable string
and it decoded it to This
is my encoded string.
So this is a very useful way to
quickly encode and decode
these strings.
So empty five some is a hashing
algorithm, and he uses the
empty five hashing algorithm
and provides a hash of either a file
or standard input or for string
theory, useful way to determine the
integrity of something.
So let's say
you're going to do the hash
of this basically for
encoding. So we're going to do Indy
five
and check it out.
That's our Andy Fivesome for that
string.
Now, we can run this on a final as
well. So let's say I want to do
maybe five some on
my program
and then we go.
So this is the empty five for this
program that I wrote for myself.
So this is a very useful way to
determine the integrity of a file.
And just like the empty files, so
we have to show one some.
And this is another command, just
like the previous one,
where except it will use the show
one algorithm instead of
the empty five some.
And there's also the issue two fifty
six some as well.
If you want to do a show, two fifty
six hash and
just like the base.
Sixty four, the ninety five some.
It will be used on standard output,
standard input and
on a file as well.
So this is going to be very similar.
I'm going to do this on
our base. Sixty four encoded string
section one.
And as you can see, the shell one
sums are longer than the empty
five as well
because it's running more difficult
and longer.
Different types of encryption or not
encryption excuse me, algorithms
to create this
hash. And if you're interested in
this kind of stuff, I highly
recommend looking it up online,
learning more about this type of
cryptography.
Suppose to assessment hashes can
be reversed to read the encrypted
message.
Is this true or false?
The answer is false.
Hashes cannot be reversed.
So this is something you'll see
if you haven't learned already.
Hashes are used to store passwords
in a system because they cannot
be reversed.
The system always hashes
the password that it provides and
compares it with the hash
inside of the password or the
shadow file.
So this can be very useful to
validate the integrity of
a password, validate the integrity
of a file that it wasn't changed or
modified.
So hashes are very important to
understand in your career.
All right. So in this video, we
learned a refresher on hashes
and encoding.
Understood the base.
Sixty four comen, one of the
five some command and learned the
shell ones, some command.
And I hope to see you in the next
video.