Blog | G5 Cyber Security

Hashing a File: Does it Change It?

TL;DR

No, hashing a file does not alter the original file itself. Hashing creates a unique ‘fingerprint’ of the file’s contents. The original file remains unchanged.

What is Hashing?

Hashing takes any amount of data (like a file) and turns it into a fixed-size string of characters, called a hash or digest. Think of it like a blender: you can put anything in, but the result will always be the same size smoothie.

Why Use Hashing?

Does Hashing Modify the File?

Absolutely not! The hashing process is one-way. It calculates a value *based on* the file, but doesn’t change the file itself.

How to Hash a File (Examples)

  1. Using Command Line (Linux/macOS):
  • Using PowerShell (Windows):
  • Online Hash Calculators: Many websites allow you to upload a file and calculate its hash. Be cautious about uploading sensitive files to unknown sites!
  • Example Scenario

    Let’s say you download a software program.

    1. The website provides the SHA-256 hash of the file (e.g., a1b2c3d4...).
    2. You download the file to your computer.
    3. You use sha256sum or GetFileHash to calculate the SHA-256 hash of the downloaded file.
    4. If the calculated hash matches the one on the website, it confirms that the file hasn’t been altered during download. If they don’t match, something went wrong (e.g., corrupted download) and you should not use the file.

    Important Considerations

    Exit mobile version