The internet is amazing. You're streaming movies, downloading games, uploading files
to the cloud, and somehow, all that data, mostly, gets from one place to another without
getting corrupted. I mean, it's a miracle, isn't it? No, it's not. It's computer science.
In particular, we owe this modern marvel to checksums, numbers that are used to verify
that a file got sent or copied properly. But how does a simple number manage to perform
this essential function? Well, it works thanks to cryptography. Even if the data that you're
transmitting isn't encrypted, or even particularly sensitive, in applications that use checksums,
the protocol will run the contents of the file through a cryptographic hash function, which
is basically a complicated math function that produces a lengthy and unique string of characters.
The reason this works well for generating checksums is that if you change even one
byte of data, even in a very large file, that string of characters, or hash, will change
completely. And this is actually the same way that passwords are stored securely on websites.
Except, instead of storing the password in plain text, they're run through a hash function
that is virtually impossible to reverse. That way, if a hacker breaks into the server,
they only see a pretty much meaningless hash rather than your plain text password.
So coming back to checksums, they play an important role in digital security as well.
If you download a file from the internet, you make the assumption that the host is providing
you a safe, non-malicious file. But bad actors can sometimes attempt to attack PCs by replacing
files that are commonly downloaded. That's why many responsible websites will provide
a checksum so that you can verify that the file you download is exactly what it's supposed
to be. So, with this level of importance, you would think that checksums are ubiquitous
in computing. But actually, that's not the case. In fact, in Windows, File Explorer
doesn't use checksums by default when performing a file transfer. Even though generating a checksum
would take a trivial amount of time for small files like Word documents, it can take a lot
more time if you're trying to move around many gigabytes worth of data. However, there
are ways to work around this. If you want to compare the checksum of a copied file to
the original in Windows, all you have to do is fire up a command prompt and type in this
command followed by the file path. Because checksums will be very different if the file
contents don't match, you can usually just glance at them instead of tediously comparing
them character by character. You can also get third-party tools that do generate and
validate checksums when you copy files, and we're going to have one of those linked down
below. Did you know that you can select Validate files in Steam if one of your games isn't
running correctly? The service stores checksums of known good game files, so when you click
this button, it compares them to the checksums of the files that are stored on your PC. If
there's any discrepancy, the altered file can be quickly downloaded and replaced with
the original rather than forcing you to reinstall the entire game like we had to do in the old
days. And if you're a video editor, popular editing programs like Adobe Premiere support
the use of checksums to verify large media files to ensure that they don't get corrupted
when you're copying them. Microsoft's OneDrive cloud storage solution for Windows also makes
use of checksums, in this case to make sure that your photos and documents were uploaded
properly. And if you need to transfer lots of files at once, you can use checksums for
zipped folders to quickly verify that all of your files are in good shape. In fact,
TCPIP, the data transmission protocols that underpin the internet, use checksums on every
packet of data to make sure that no bits were flipped in transit. If the checksum that
was sent doesn't match the checksum generated by the receiver, that packet gets dropped
and retransmitted. So basically, every bit of data that you get from the internet goes
through this verification process. Which is cool, but keep in mind that this kind of checksum
doesn't really improve your security. As, like I said, a file could contain malware
from its origin, whether on purpose or due to a bad actor. So it's still very important
that you take caution when dealing with files from unknown sources, as we learned ourselves
the hard way recently. So go watch this video next to learn about how we recently got our
channel hijacked, because it could happen to you too. Thanks for watching, like or dislike,
check out our other videos, and leave a comment if you have a future TechWiki video suggestion.
We don't call it that anymore. I'm rusty.