VLT-Website-Heading

How to check the checksum of a file on your Mac

Oct 30, 2021 10:00:00 PM / by Vu Long Tran

This is a brief guide on how to check the checksum of a file you download to install on your computer. I will be showing you how to do this on your Mac.

A checksum is a value that represents the number of bits in a transmission message.

We want to check the checksum to detect high-level errors within data transmissions. Prior to transmission, every piece of data or file can be assigned a checksum value after running a cryptographic hash function.

How to check the checksum on your Mac

On your Mac, go open up "Terminal" and go to the folder that has the file you want to check the checksum for. In my example, my file is in my Downloads folder.

download-file

Open your "Terminal" or command line software (e.g. iTerm, etc.).

cd Downloads

ls

shasum -a 256 openjdk-16.0.2_osx-x64_bin.tar.gz

checksum-check

Notice that it has the checksum:

e65f2437585f16a01fa8e10139d0d855e8a74396a1dfb0163294ed17edd704b8

checksum-check2

This is your sha256 checksum output. 

Alternatively, we can use the OpenSSL version to check.

openssl sha256 openjdk-16.0.2_osx-x64_bin.tar.gz

checksum-check3

Typically, the next step now is to compare this detail to the sha256 checksum with where you downloaded the file from. 

 

Example of how you can check the checksum of a download

Here is an example of how we can check the checksum of a download. 

We will use the example of downloading JDK 16 to your Mac, as you can also follow this as well.

  1. Go to https://jdk.java.net/16.
    jdk-16-0.2-ga
  2. Download JDK16 for your Mac.  for Mac.
  3. We can find out what the checksum SHA256 for the download file should be by clicking on the sha256 link that is noted there.
    jdk-16-0.2-ga3
  4. Let's click on it to display the SHA-256 checksum. It will show you something like this:
    jdk-16-0.2-ga4
    Note that the sha256 checksum is:
    e65f2437585f16a01fa8e10139d0d855e8a74396a1dfb0163294ed17edd704b8

If we compare to the sha256 checksum from our Terminal earlier:

checksum-check2

That's it, you're all set now. 

Topics: tech, cybersecurity

Vu Long Tran

Written by Vu Long Tran

Solutions Engineer APAC. ex-@Forrester consultant. Writing on #cloud #howto guides and #tech tinkering!