đ How to Use SHA256 on macOS â
đ What is a SHA256 Checksum? â
SHA256 (Secure Hash Algorithm 256-bit) is a cryptographic hash function that generates a unique, fixed-length string for a file. Use it to:
- â Verify file integrity (detect tampering).
- đ Authenticate downloads by matching checksums.
âī¸ Generate a SHA256 Checksum â
1ī¸âŖ Open Terminal â
- Search for Terminal using
Cmd + Space
(Spotlight).
2ī¸âŖ Navigate to the File â
- Use the
cd
command to locate your file:bashcd /path/to/your/file
3ī¸âŖ Run the Checksum Command â
- Replace
yourfile
with the file name:bashshasum -a 256 yourfile
- Example output:
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 yourfile
4ī¸âŖ Compare Values â
- Match the checksum from the output with the source-provided value.
đ Use SHA256 with curl
â
1ī¸âŖ Download the File â
- Use
curl
with the file URL:bashcurl -O https://example.com/myfile.pkg
2ī¸âŖ Generate the Checksum â
- Run the SHA256 command:bash
shasum -a 256 myfile.pkg
3ī¸âŖ Verify Integrity â
- Compare the generated checksum with the one provided by the source.
đ Example Workflow â
- Download the file:bash
curl -O https://example.com/software.pkg
- Generate SHA256 checksum:bash
shasum -a 256 software.pkg
- Compare checksum:
- Provided:
abc123...
- Output:
abc123... software.pkg
- â Match means the file is secure.
- Provided: