How to verify checksum on a Mac - MD5, SHA1, SHA256, etc

Howto Mac

Share

In this tutorial we will learn to find checksum of a downloaded file in Mac using the terminal.

Download the file and get the checksum from the website. Next, depending on the checksum type apply the following checksums.

MD5 checksum

In order to find the MD5 checksum value of a file using the following command in the terminal.

$ md5 /path/to/file

Example:

YUSUF-MBP:Downloads yusufshakeel$ md5 WebStorm-2017.1.3.dmg 
MD5 (WebStorm-2017.1.3.dmg) = d0da4af41337d2e848fa95062ddce702

Using OpenSSL to check MD5

Use the following command to get the MD5 checksum using openssl command.

YUSUF-MBP:Downloads yusufshakeel$ openssl md5 WebStorm-2017.1.3.dmg 
MD5(WebStorm-2017.1.3.dmg)= d0da4af41337d2e848fa95062ddce702

SHA1 checksum

To find the SHA1 checksum value use the following command in the terminal.

$ shasum -a 1 /path/to/file

Example:

YUSUF-MBP:Downloads yusufshakeel$ shasum -a 1 WebStorm-2017.1.3.dmg 
68c0c36605892b3853913619ed51fc91b8ddd490  WebStorm-2017.1.3.dmg

Using OpenSSL to check SHA1

Use the following command to get the SHA1 checksum using openssl command.

YUSUF-MBP:Downloads yusufshakeel$ openssl sha1 WebStorm-2017.1.3.dmg 
SHA1(WebStorm-2017.1.3.dmg)= 68c0c36605892b3853913619ed51fc91b8ddd490

SHA256 checksum

To find the SHA256 checksum use the following command in the terminal.

$ shasum -a 256 /path/to/file

Example:

YUSUF-MBP:Downloads yusufshakeel$ shasum -a 256 WebStorm-2017.1.3.dmg 
0dd1af99b3ad94b0c349652d8a63918d8d3f732f8e194243ab01f6fb7215a49a  WebStorm-2017.1.3.dmg

Using OpenSSL to check SHA256

Use the following command to get the SHA256 checksum using openssl command in the terminal.

YUSUF-MBP:Downloads yusufshakeel$ openssl sha256 WebStorm-2017.1.3.dmg 
SHA256(WebStorm-2017.1.3.dmg)= 0dd1af99b3ad94b0c349652d8a63918d8d3f732f8e194243ab01f6fb7215a49a

SHA512 checksum

To find the SHA512 checksum use the following command.

$ shasum -a 512 /path/to/file

Example:

YUSUF-MBP:Downloads yusufshakeel$ shasum -a 512 WebStorm-2017.1.3.dmg 
c26385bf5583bcd10883ec8107b5b31d8d2c0d30fa00855625ce4922906872a38ff94e13c5150c765302061d6e42ce556650b151444c4dc79d42369a8a2c9c10  WebStorm-2017.1.3.dmg

Using OpenSSL to check SHA512

Use the following command to get the SHA512 checksum using openssl command in the terminal.

YUSUF-MBP:Downloads yusufshakeel$ openssl sha512 WebStorm-2017.1.3.dmg 
SHA512(WebStorm-2017.1.3.dmg)= c26385bf5583bcd10883ec8107b5b31d8d2c0d30fa00855625ce4922906872a38ff94e13c5150c765302061d6e42ce556650b151444c4dc79d42369a8a2c9c10

Example

In this following example I have downloaded WebStrom-2017.1.3.dmg file.

The website from where you download the file will provide you the checksum. In this case the website provided a SHA256 checksum given below.

0dd1af99b3ad94b0c349652d8a63918d8d3f732f8e194243ab01f6fb7215a49a

The downloaded file is in the Downloads directory so I will move to that directory.

YUSUF-MBP:~ yusufshakeel$ cd Downloads

Now type the following command in the terminal to get the SHA256 checksum.

YUSUF-MBP:Downloads yusufshakeel$ shasum -a 256 WebStorm-2017.1.3.dmg 
0dd1af99b3ad94b0c349652d8a63918d8d3f732f8e194243ab01f6fb7215a49a  WebStorm-2017.1.3.dmg


Share

Recently Added