Hello and welcome to this fundamentals of cryptography course, in this section of the course we've
been talking about, hash functions started out with a discussion of what a hash function is covered,
some of the security assumptions of hash functions and how those tied into the deprecation of previous
hash functions.
In the previous video, we switch gears a little bit from theory and talked about one concrete application
of hash functions that we use every day.
The use of hash functions for secure credential management.
In this final video of the section, we'll be talking about another application of hash functions for
data integrity protection.
We've seen this a lot throughout this section.
But going to dive into it a little bit more detail and discuss some concrete applications of hash functions
for data integrity protection.
And so in this video, we've got three main topics of discussion going to start out with a quick overview
of why we use hash functions to protect data integrity.
Then we'll discuss some concrete applications of hash functions for data integrity protection before
closing out with a discussion of some of the assumptions you make when using hash functions to protect
data integrity.
And so hash functions are very, very commonly used for data integrity protection.
And the reason why is that they have a couple of useful properties for doing so.
One of these is that they're one way functions, meaning that from the output you cannot reverse engineer
the hash function to get to the input that was used or other inputs that could produce that same hash
output.
And this is an important component of collision resistance.
The other useful property collision resistance says that.
Given a particular input to a House function or really any input to a hash function, it's computationally
infeasible to find another input that produces the same hash output.
Certainly true that a no other input exists.
And in fact, due to the nature of hash functions, there's actually an infinite number of inputs that
produce the same hash output.
But hash functions are designed to make finding any of that infinite set more difficult.
And the reason why is that we have that large state space and hash function on locality that we talked
about in the second video in this section.
And so with all of these useful properties, it's not surprising that hash functions are commonly used
to protect data integrity.
And how this typically is implemented is by providing the hash of data alongside the data itself.
This makes it easier to detect either tampering or other issues and data transmission.
If the hash of the data doesn't match the provided hash, it could indicate either intentional tampering
by an attacker or some sort of transmission error or encoding error that nonetheless results in the
data not matching what was originally intended by the sender.
And so these can serve as warning signs that it might be worth going back to the original data creator
and saying something's wrong with the data and we need to fix this before moving forward.
And so now let's talk about some actual real world applications of hash functions for data integrity
protection.
One of these is digital signatures.
When we're talking about public key or asymmetric cryptography, we brought up the topic of digital
signatures.
They're very useful for providing authentication of data and protect providing non repudiation, i.e.,
the making it impossible for someone who has generated a signature to deny having done so.
And so we brought up digital signatures in the context of public key cryptography, because public key
cryptography is essential for digital signatures.
However, it's not the only cryptographic primitive used in digital signatures.
When we talked about digital signatures originally, we also mentioned hash functions.
And the reason why is that when generating a digital signature, you don't sign the original data.
You actually sign a hash of that data.
And the reason why is this is more compact and produces a more manageable signature size.
However, by doing so, you're also certain that you haven't impacted the security of the signature.
Hash is as good as the original data itself in a signature due to the properties of collision resistance.
Be very difficult for someone to find another version of the data that produces the same hash used in
the digital signature.
And so, once again, one real world example of digital signatures that you might use every day is code
signing.
So for software in, say, IOW, so Andrew, are Apple's iPhone operating system.
You cannot run that code on the device unless it's digitally signed by a public key or private key.
That was issued by Apple or endorsed by Apple.
And so without hash functions, this doesn't work.
Another application of hash functions for integrity protection is malware detection.
So you may have heard of signature based antivirus.
This is the more older traditional method of detecting malware on a machine.
And how it works is by comparing any file that's entering the machine against hate list or dictionary
of signatures or indicators of potential malware.
And there are a bunch of different indicators, including IP addresses, domain names, et cetera.
But one of these indicators is actually the hash of the pile.
And the reason why is for certain malware variants that don't get modified very much.
It may be simplest to just store a hash of the actual file and compare the hash of the file coming in
with the stored hash.
That stored hash is a unique summary of the file.
Due to collision resistance, it's unlikely that you have a benign file that matches that hash.
And by storing just a hash of the file, you've got a fixed sized signature, much more compact than
trying to store complete copy of the actual malicious code.
Hash functions are also used from malware detection from a reporting standpoint.
If you ever read a analysis of a particular malware family, somewhere in that file is probably going
to be a list of associated file hashes.
And these provide a unique indicator of the map, malicious files associated with this particular report
or different variants of a particular piece of malware.
However, there's stored in a more compact way and a safer way.
If you're writing up malware reports on the Internet, you don't really want to save a copy of them.
Our source code or a complete executable of the malware on your site make it far too easy for someone
else to download it and use it for malicious purposes.
Hashes are much safer because they're just as unique.
But you can't reverse engineer the original malicious code from that file hash.
A third everyday application of hashes is the secure sockets layer or transport layer security is shown
up earlier in this course.
And as a quick reminder, this is the protocol that's used every day on the Internet for confidentiality
and authentication, among other purposes.
Your Web traffic, when you're moving from HTP to HTP s, which gives you that lock icon, you're wrapping
your traffic in SSL or T.L. s.
And these protocols use all three types of cryptographic algorithms we've discussed so far.
When we talked about it previously, we discussed how SSL and TALUS use asymmetric encryption for key
exchange and then symmetric encryption for bulk data transfer.
However, they also use hash functions to ensure the integrity of the data in transit.
And so by mixing all three of these together, we actually get the protocols that we use on the Internet
every day.
And then a final application of hash functions for data integrity production.
That we'll talk about here is block chain.
So you probably heard a block chain and how it's the new hype in the new technology that can solve a
wide variety of problems.
And one of the fundamental principles of block chain is transferring trust from an organization or a
centralized authority to the security of cryptographic algorithms.
And so as part of this block chain uses public key cryptography and hash functions very heavily, public
key cryptography provides digital signatures and authentication and hash functions, ensure the integrity
of the distributor ledger, making sure nobody can modify its contents after a block has been added
to the ledger.
And so these are four major applications of hash functions for data integrity protection.
It certainly isn't an exhaustive list, but I hope it provides a view of how widely you how widely we
really use hash functions in everyday life.
And so now let's close out this discussion with some of the security assumptions associated with hash
functions when we're using them to protect data integrity.
And so there are two major security assumptions that we're making.
The first is that the hash has not been modified.
And so, for example, it's not uncommon if you want to download a program or a file off of the Internet
that alongside the actual file download, you'll see the associated hash of the file.
And this is provided so that you could download that file and then compare the hash to make sure that
they match.
And the assumption here is that if they match, you got the right file.
However, you're assuming that that hash value that you're seeing on the site is actually the one provided
originally by the organization that you're downloading the file from.
It's entirely possible that an attacker who substituted malicious code in for the file download could
also substitute in the hash of their malicious code for the hash value provided by the site.
If there aren't protections in place against this, then if you download the file provided, compare
it to the hash, you'll find that it matches.
However, you're not downloading the file that you think you are.
The other main security assumption is that the hash function that you're using is secure in an earlier
video.
We talked about how some of the most well-known hash functions in existence MDT five and SHA one, actually
aren't secure.
They've been demonstrated to be no longer completely trustworthy because somebody has found a hash function
collision, meaning that their collision resistance no longer is perfect and someone with sufficient
motivation and finances could actually break it.
For example, at the time of filming, the cost of breaking a SHA one hash is about fifty thousand dollars.
And because of this actually open SSL, one of the main cryptographic libraries in use, is actually
starting to transition away from SHA one hashes because they're no longer trusted.
And if someone was motivated enough and had fifty thousand dollars to burn, they could find a hash
collision on SHA one.
And so if you're relying on MDG five or SHA one or other broke hash algorithms for your data integrity,
then those hashes really aren't providing the same protection that you think they are.
And so this concludes this video.
It's a quick recap of some of the key points, data integrity protection is one of the main applications
of hash functions.
And we saw a few different real world cases where we'll see hash functions used to protect data integrity
on a daily basis.
And then finally, when we're relying on hash functions for these guarantees, it's important to keep
that in mind that we're making certain assumptions about security, namely that the hash itself is actually
the original legitimate one, and that we're using a hash function that's secure and that still has
strong collision resistance.
And so this concludes this last video on hash functions.
And this section of the course.
Thank you.