Verifying the Hash: SHA-256 & MD5

CE
2 min readApr 15, 2018
Image from Pexels.com

Laptop used: Macbook Air
File to download: Orcale VirtualBox

What is Hashing?

Hashing is an algorithm performed on data such as a file or message to produce a number called a hash sometimes called as a checksum. The hash is used to verify that the data isn’t modified, tampered with, or corrupted. (Integrity!)
A key point about a hash is that no matter how many times you execute the hashing algorithm against the data, the hash will always be the same if the data is the same. — CompTIA Security + SY0-501 Study Guide By Darrel Gibson.

In the website where you can download the VirtualBox, they have posted there the “checksums to verify the integrity of downloaded packages”. They have the SHA-256 and the MD5 which are both hashing algorithms.

Verifying MD5 Checksum

  1. Open Terminal from Mac
  2. Type in the command and press Enter
    MD5 /path/to/the/file/VirtualBox-5.2.8–121009-OSX.dmg
From the Terminal

3. Gives you the result
MD5 (/Users/path/to/the/file/Downloads/VirtualBox-5.2.8–121009-OSX.dmg) = e4e0cf599c17f9038615ab072342346b

4. Then compare the MD5 Hash/Checksum to the ones in the website

From https://www.virtualbox.org/download/hashes/5.2.8/MD5SUMS

5. If both numbers are the same, then integrity is intact.

Verifying SHA-256 Checksum

  1. Open Terminal from Mac
  2. Type in the command and press Enter
    shasum -a 256 /path/to/the/file/VirtualBox-5.2.8–121009-OSX.dmg
  3. Gives you the result:
    97764ad37c5fafdeccecfb660ce056f625e9048890af772befe0330ed2def1d8 /Users/path/to/the/file/Downloads/VirtualBox-5.2.8–121009-OSX.dmg
From Terminal

4. Then compare the SHA256 Hash/Checksum to the ones in the website if it’s the same or not.

From https://www.virtualbox.org/download/hashes/5.2.8/SHA256SUMS

5. If the same, we have verified the integrity of the file

*I researched the steps and followed them for the purpose of learning. :)

--

--