Open Source Windows Apps: How to Verify Source and Hash
In this article
To safely use an open source Windows application, you must verify that the binary you downloaded matches the source code provided by the developer. This is achieved by comparing the cryptographic hash (a unique digital fingerprint) of the downloaded file against the official hash published on the project's release page or by compiling the source code yourself. Verifying the hash ensures the file has not been tampered with or corrupted during the download process.
What You'll Need
- A Windows PC with the application installer (.exe or .msi) already downloaded.
- Access to the official project repository (e.g., GitHub, GitLab) or the official developer website.
- The official checksum/hash string provided by the developer (usually found in a "checksums.txt" file or listed in the release notes).
- Windows PowerShell (built into Windows 10 and 11).
Step-by-Step
- Locate the Official Hash: Navigate to the official release page where you downloaded the app. Look for a section labeled "Checksums," "Hashes," or "SHA-256." Copy the long string of alphanumeric characters associated with the specific version and architecture (e.g., x64) of the file you downloaded.
- Open PowerShell: Right-click the Start button and select Windows PowerShell or Terminal. Note that menu labels may differ slightly depending on your Windows version or region.
- Identify the File Path: Locate the downloaded file in File Explorer. Right-click the file and select "Copy as path" to ensure you have the exact location and filename.
- Run the Hash Command: In the PowerShell window, type the following command, replacing
[path]with the path you copied (keep the quotation marks):Get-FileHash [path]
Example:Get-FileHash "C:\Users\Name\Downloads\app-setup.exe" - Press Enter: PowerShell will calculate the hash. By default, Windows uses the SHA-256 algorithm, which is the industry standard for security.
- Compare the Results: Look at the "Hash" column in the PowerShell output. Carefully compare this string to the official hash you copied from the developer's site. You can paste both strings into a plain text editor (like Notepad) one above the other to check for differences.
- Verify the Source Code: If the project is open source, visit the "Source" or "Repository" link on the release page. Ensure the code is hosted on a reputable platform and check the "Commits" or "History" to see that the project is actively maintained and transparent.
- Execute the App: Only run the installer if the hashes match exactly. If even one character is different, delete the file immediately and do not run it.
Common Mistakes
- Using the Wrong Algorithm: Some developers provide MD5 or SHA-1 hashes. PowerShell's
Get-FileHashdefaults to SHA-256. If the developer provides an MD5 hash, you must specify it by adding-Algorithm MD5to the end of the command. - Comparing the Wrong File: Ensure you are hashing the actual installer (.exe) and not a compressed archive (.zip) unless the developer specifically provided the hash for the archive.
- Ignoring Case Sensitivity: While hashes are generally hexadecimal and not case-sensitive, some users get confused by uppercase vs. lowercase letters. Focus on the characters themselves.
- Downloading from Third-Party Mirrors: Downloading from "free software" portals instead of the official repository increases the risk that the hash will not match because the file was modified.
Tips
- Use a Text Comparison Tool: For very long hashes, use a diff tool or a simple text editor to avoid human error when scanning the string.
- Check Digital Signatures: Right-click the downloaded file, select Properties, and look for a "Digital Signatures" tab. If it exists, click the signature to verify that the certificate is valid and issued to the correct developer.
- Verify via Multiple Sources: If the project is high-profile, check community forums or official documentation to ensure the release hash hasn't been flagged as compromised.
Troubleshooting
If the hashes do not match, follow these steps in order:
- Redownload the File: A mismatch often occurs due to a corrupted download (packet loss). Delete the file and download it again using a stable connection.
- Check the Version: Ensure you are comparing the hash of the 64-bit version against the 64-bit hash, not the 32-bit hash.
- Verify the Algorithm: Double-check if the developer used SHA-256, SHA-512, or MD5. Adjust your PowerShell command accordingly using the
-Algorithmflag. - Avoid the File if it Still Fails: If multiple downloads from the official source result in a hash mismatch, the release may be compromised or the developer may have uploaded the wrong checksum. Do not run the application.
Frequently Asked Questions
What is a hash and why does it matter?
A hash is a unique digital fingerprint of a file. If a single bit of data in the file is changed, the resulting hash changes completely. This allows you to verify that the file you downloaded is identical to the one the developer created.
Is SHA-256 better than MD5?
Yes. MD5 is considered cryptographically broken because it is susceptible to collisions (where two different files produce the same hash). SHA-256 is significantly more secure and is the current standard for file verification.
Does an open source app always need a hash?
While not every developer provides one, reputable open source projects provide hashes so users can verify the integrity of the binaries without having to compile the code themselves.
What happens if I run a file with a mismatched hash?
You risk installing malware, spyware, or a corrupted version of the software that may crash your system or steal your data. A mismatched hash is a primary red flag for a compromised file.
Can I verify the hash without using the command line?
Yes, there are third-party GUI tools that can calculate hashes, but using the built-in Windows PowerShell is the safest method as it requires no additional software installation.