what-are-checksums-and-how-to-calculate-them-for-downloads

 

File fingerprint

 

Checksums are a traditional way of verifying a download’s file integrity. In this blog, we look at what checksums are and how to use them. Specifically, we walk through how the Webmaster uploader and the user downloader can generate checksums on Microsoft Windows, macOS, and Linux based machines.

What is a checksum?

A checksum is a value used to verify the integrity of a data transfer or a file. Typically, checksums appear as a long, alphanumeric string of characters that acts as a digital fingerprint of sorts. They are used as a way to compare an original file to a copied version of that file in order to ensure they are the same. If the checksums calculated don’t match, even if they are just slightly different, the data has either been corrupted or (maliciously) tampered with.

 

How to Use Checksums

Now let’s see how to use a checksum from both the uploader and downloader’s perspective. Here we cover SHA256 as its considered a best practice.

 

As a Webmaster or “Uploader”

Create or obtain the file from your trusted source and use a checksum tool that fits your operating system:

 

On Microsoft Windows

SHA256 checksum can be generated in the console using the following command:

 

certutil -hashfile C:UsersYOUR_USERNAMEUploadfile.exe SHA256

 

Instead of typing the path to the file, you can just drag and drop:

 

  1. Press Windows Start Menu
  2. Type cmd
  3. You should see command (cmd) execute (.exe) option in the list of results. Click on it to launch.
  4. Type or paste: certutil -hashfile
  5. Press space
  6. Drag and drop the file from Explorer to Terminal
  7. Press space
  8. Type or paste: SHA256
  9. Press enter key
  10. You should see the resulting string output on the second line is the SHA256 checksum

 

macOS

SHA256 checksum can be generated using the following command:

 

$ shasum -a 256 ~/Upload/file

 

Instead of typing the path to the file, you can just drag and drop:

 

  1. Open Terminal
  2. Type or paste: shasum -a 256
  3. Press space key
  4. Drag and drop file from the Finder to Terminal
  5. Press enter key

 

Linux

Generate the SHA256 hash by entering:

 

$ sha256sum ~/Upload/file

 

Upload the file and the Checksum

After uploading the files to the intended location, you need to create a website with the download links. Also, you should include a file link to the created checksums or have them integrated it into the website.

 

One issue to be aware of here is the download location and the checksum location should be on separate server systems. Additionally, a best practice is to require different credentials for accessing either location. However, doing so makes the Webmaster’s life pretty tough, especially when they have a significant amount of files available for download.

 

As a “Downloader”

When you download a file from any website on the web, you need to generate the checksum using the same hashing algorithm as the “Uploader” and compare your result to the result posted on the download website. Though the process is essentially the same for calculating the checksums, we re-illustrated it below for clarity.

 

On Microsoft Windows

SHA256 checksum can be verified using the following command:

 

certutil -hashfile C:UsersYOUR_USERNAMEdownloadsfile.exe SHA256

 

Instead of typing the path to the file, you can just drag and drop:

 

  1. Press Windows Start Menu
  2. Type cmd
  3. You should see command (cmd) execute (.exe) option in the list of results. Click on it to launch.
  4. Type or paste: certutil -hashfile
  5. Press space
  6. Drag and drop the file from Explorer to Terminal
  7. Press space
  8. Type or paste: SHA256
  9. Press enter key
  10. You should see the resulting string output on the second line is the SHA256 checksum

 

macOS

SHA256 checksum can be verified using the following command:

 

$ shasum -a 256 ~/downloads/file

 

Instead of typing the path to the file use drag and drop:

 

  1. Open Terminal
  2. Type or paste: shasum -a 256
  3. Press space key
  4. Drag and drop the file from the Finder to Terminal
  5. Press enter key

 

Linux

Verify the SHA256 hash:

 

$ sha256sum ~/downloads/file

 

Check Checksums Easy With CodeNotary Drag & Drop

CodeNotary’s drag and drop verification page is used to verify a digital asset’s integrity. It checks to see if the asset has been signed by CodeNotary and has had it’s unique ‘fingerprint’, its hash, immutably added to the blockchain.

 

A bonus is that the page has the added benefit of being a hash calculator. For any asset, signed or unsigned, that is drag and dropped onto the page here, it will display and automatically calculate the MD5, SHA1, and SHA256 hashes for that asset.

 

CodeNotary - Drag & Drop - Verification - Verified

 

One of the nice aspects of the calculator in comparison to online checksum tools is that you don’t have to upload the file you want to check.  You just drop it.

Final Thoughts

Calculating checksums is not a difficult process and is mathematically sound, but it does take time away from what you would rather be doing. If you are constantly downloading or uploading files, calculating and comparing checksums can become a cumbersome annoyance.

 

For more on the truth about checksums and what current best practices are for ensuring file integrity when downloading from the web as well as what potential dangers they have, check out our blog on ‘The Problem with Using Download Links.’

 

 

Yes, I’d Like to Read That

CNIL
Metrics and Logs

(formerly, Opvizor Performance Analyzer)

VMware vSphere & Cloud
PERFORMANCE MONITORING, LOG ANALYSIS, LICENSE COMPLIANCE!

Monitor and Analyze Performance and Log files:
Performance monitoring for your systems and applications with log analysis (tamperproof using immudb) and license compliance (RedHat, Oracle, SAP and more) in one virtual appliance!

Subscribe to Our Newsletter

Get the latest product updates, company news, and special offers delivered right to your inbox.

Subscribe to our newsletter

Use Case - Tamper-resistant Clinical Trials

Goal:

Blockchain PoCs were unsuccessful due to complexity and lack of developers.

Still the goal of data immutability as well as client verification is a crucial. Furthermore, the system needs to be easy to use and operate (allowing backup, maintenance windows aso.).

Implementation:

immudb is running in different datacenters across the globe. All clinical trial information is stored in immudb either as transactions or the pdf documents as a whole.

Having that single source of truth with versioned, timestamped, and cryptographically verifiable records, enables a whole new way of transparency and trust.

Use Case - Finance

Goal:

Store the source data, the decision and the rule base for financial support from governments timestamped, verifiable.

A very important functionality is the ability to compare the historic decision (based on the past rulebase) with the rulebase at a different date. Fully cryptographic verifiable Time Travel queries are required to be able to achieve that comparison.

Implementation:

While the source data, rulebase and the documented decision are stored in verifiable Blobs in immudb, the transaction is stored using the relational layer of immudb.

That allows the use of immudb’s time travel capabilities to retrieve verified historic data and recalculate with the most recent rulebase.

Use Case - eCommerce and NFT marketplace

Goal:

No matter if it’s an eCommerce platform or NFT marketplace, the goals are similar:

  • High amount of transactions (potentially millions a second)
  • Ability to read and write multiple records within one transaction
  • prevent overwrite or updates on transactions
  • comply with regulations (PCI, GDPR, …)


Implementation:

immudb is typically scaled out using Hyperscaler (i. e. AWS, Google Cloud, Microsoft Azure) distributed across the Globe. Auditors are also distributed to track the verification proof over time. Additionally, the shop or marketplace applications store immudb cryptographic state information. That high level of integrity and tamper-evidence while maintaining a very high transaction speed is key for companies to chose immudb.

Use Case - IoT Sensor Data

Goal:

IoT sensor data received by devices collecting environment data needs to be stored locally in a cryptographically verifiable manner until the data is transferred to a central datacenter. The data integrity needs to be verifiable at any given point in time and while in transit.

Implementation:

immudb runs embedded on the IoT device itself and is consistently audited by external probes. The data transfer to audit is minimal and works even with minimum bandwidth and unreliable connections.

Whenever the IoT devices are connected to a high bandwidth, the data transfer happens to a data center (large immudb deployment) and the source and destination date integrity is fully verified.

Use Case - DevOps Evidence

Goal:

CI/CD and application build logs need to be stored auditable and tamper-evident.
A very high Performance is required as the system should not slow down any build process.
Scalability is key as billions of artifacts are expected within the next years.
Next to a possibility of integrity validation, data needs to be retrievable by pipeline job id or digital asset checksum.

Implementation:

As part of the CI/CD audit functionality, data is stored within immudb using the Key/Value functionality. Key is either the CI/CD job id (i. e. Jenkins or GitLab) or the checksum of the resulting build or container image.

White Paper — Registration

We will also send you the research paper
via email.

CodeNotary — Webinar

White Paper — Registration

Please let us know where we can send the whitepaper on CodeNotary Trusted Software Supply Chain. 

Become a partner

Start Your Trial

Please enter contact information to receive an email with the virtual appliance download instructions.

Start Free Trial

Please enter contact information to receive an email with the free trial details.