welcome to section 3 we have mainly focused
on encryption in section 2
However, cryptography is not only about ensuring
confidentiality.
Integrity and authentication are very important
Security Services required in several applications.
In this section, we'll discuss how we can
achieve integrity and authentication using symmetric
key cryptography.
In this first video, we will see what is
a cryptographic hashing and formally Define the
security guarantees that the hashing function should
provide to be called the cryptographic hashing function.
We'll discuss through examples to Applications of
cryptographic action.
We'll see what are today the secure hash
functions among the long lines of hash functions that
were standardized by nest and that many
of them are today vulnerable or completely broken.
Hash function Maps the data of arbitrary length
into bitstreak or fixed length.
We call that bit string hash or digest of
the data.
In the figure, we see examples of digests.
the digest of the image of Linux penguin
the digest of the string ET phono
and the digest of the Ubuntu 21.10 image
Of course, this objects have very different lengths but using
the hush function shot 256.
We obtained their digests which are all 256 bitlock.
A cryptographic hash function is a hash
function that aims to guarantee a number of
security properties.
First Security property is related to
collisions.
Collisions happen when two distinct data x and
x Prime have the same digests.
Collisions always exist as the space of digests is
finite. So there exist always two data
that that collide.
So we don't want collision-free hashing but
rather a collision resistant hashing.
Which means that it is
difficult competitionally difficult for an
adversary to find these collisions.
The second property is related to
reversing the hash function.
So an adversary that was given a digest
y of some X.
We want him to be unable to find X.
X is called the image of Y with respect to
the hash function h
That's why we call this attack pretty image attack. So we would
like resistance to premage to first image attacks.
The last property or guarantee is resistance to
Second pre-image attacks.
So an adversary that was given a brimage
x
is unable to find another primage X
Prime such that each of
X is equal to H of X Prime.
Through examples of use cases will clarify these
guarantees and convince you why this properties
are important.
The first application of cryptographic hashing
is integrity check.
Let's imagine the scenario of
Bob that is about to download in OS image.
Let's say Ubuntu 21.10
Unfortunately, there is the malicious men in
the middle that would like to modify this image into a
malicious image and let Bob install
it.
If Pope installs the malicious image.
The adversary might see Bob's activity.
And gets access to his private data.
However, Bob is cautious and follows
Integrity check practices.
He obtained from the official website of Ubuntu the
shadow256. They rest
of the version of the osc intends to install.
And before launching the installation, he computes
the shadow56 stages of the
malicious image.
And sees that it does not match with the digest that is
displayed on the official website of Ubuntu.
He then concludes that it didn't download a valid
image.
so in this scenario
there is not
able to find or to construct
Malicious image such that. It's try
to five six stages corresponds to
the shadow56 stages of the
valid Ubuntu image.
And this is thanks to the fact that shot 256
is resistant to Second pre-image attack.
Our second application for cryptographic hashing
is the commitment.
To introduce. What is a commitment? Let's go back to
our good old friends Alice and pop.
This time Alice and Bob want to play
Rock Paper Scissors game remotely.
In physical world the two players Revere their
values simultaneously or Kazi simultaneously
in a way that none of
them is able to choose a winning value after seeing the
value of the other player.
Remotely, this will be difficult to implement as
one of them will send his Value
First.
The issue here. Is that the one who will send first
let's say Alice is going for sure to lose as
Bob will know her value before revealing
his own value and will on purpose truth paper.
So we need commitment commitment is
a protocol that allows Alice to stick
to value that will remain hidden until
the moment. It must be revealed.
And there would be no going back.
Using a box analogy. Alice keeps her
chosen value Rock
in a locked box
and gives the box to Bob.
Without the key Bob cannot read her value
and select the value that makes him win.
Alice as well cannot change it because the box is in
Bob's position.
When she will give him the key he can open
the box and then read the value.
Let's see how we can construct commitment using cryptographic
eruption.
Alice speaks some random value
and she commits to the Rock value by sending Bob the
shadow256 stages.
of the concatenation of the random and The
Rock Valley
as soon as Bob sends his own value paper to
Alice.
She knows that she has lost.
But she's unable to cheat.
Now she has to open the commitment in other
words.
She reveals to Bob what was the value she
committed to?
So she sends the random as well as the
value Rock.
Bob discovers that you want and can verify
that at least did not cheat and did not change the
value.
Obviously Bob is more motivated to do this
verification if he loses.
But the protocol the commitment allows him
to do this verification whether he loses or humans.
If Alice wants to cheat after she discovered Bob's value.
and let's say she will change it to the value scissors
which
can win
then the dangerous computed by Bob and the one initially sent
by Alice do not much and Bob
will be able to detect the cheating.
In this protocol the commitment constructed using
cryptographic hashing provided two
guarantees.
The first guarantee is hiding is called hiding.
Bob is not able to determine that Alice has
committed to given value as Bob
doesn't know the random value used and
Bob is enabled to reverse the hash function.
This is thanks to the property of resistance of first
to First premature attack that chapter
56 has.
The second guarantee is called biding.
Alice is unable to cheat.
Since for tricking Bob, she would have to invent in
your random value a random Prime.
That collides with the first digest that
she set.
But this fraud would imply that Alice can't
find collisions in the hash function
shadow56, which is considered computationally impossible.
Commitments are not only useful to play Rock
Paper Scissors remotely.
It represent an important cryptographic primitive or
tool in several security protocols.
For example, they are used in zero knowledge
proofs that provide blockchains with
privacy.
I invite you to look at this topic. It's very exciting
topic and consider today a quite hot research
topic in the area of blockchain and
privacy in blockchains.
Okay, now that we understood some of the applications of
cryptographic hashing. Let's see in
the list the main cryptography cache
functions that were standardized by nest.
First md5 it was designed in 1993 and
has a digest of 128 bits.
Shaziru was published in 1993 and
has digest of 160 bits.
Shaun was published two years later with also
160 bit length of Digest.
Several vulnerabilities were found in md5. She
has zero and Shawan.
And today they are considered completely broken and
not recommended for use.
Today the recommended hash functions are Chateau
and shatri.
the both of them come with different digest
sizes either 224 256
384 and 512 bits so
there are different modes. You can use which
mode corresponds to your application.
The naming Chateau entry might be
misleading as we might think that these two
hash functions belong to the same
family of hash functions while it's not
the case.
Chateau is build on the design that belongs to
the same family of designs as the previous track while
schatri started a completely.
new internal design
Chateau is built using Miracle
dumgar structure.
Chatri is built using the sponge structure with the
ketchak permutation.
In terms of security both Chateau and share 3 are highly
secure hash functions.
They provide security against Collision attacks
and pre-image attacks.
However, chethri provides higher resistance
to the category of attacks that
we not discussed today.
They are called the length extension attacks.
So if in your use case this attacks are
applicable then share 3 is a better choice.
We reach the end of our first video that was
dedicated to cryptographic hashink.
Where we also have seen some of its applications.
In the next video, we will continue with applications of
cryptographic caching.
And we will study the message authentication codes
that were build to provide
Authentication.
So see you in the next video.