File hashing is the process of calculating a fixed-size bit string value called a “hash” from a file using a mathematical algorithm. It transforms data into a far shorter hash or key representing the original string. As such, the hash value can be considered a distilled summary of everything within that file.
Read More about File Hashing
Also known as “cryptographic hashing,” file hashing has become critical to cybersecurity amid the ever-growing threat landscape. Learn more about it here.
How Does File Hashing Work?
Try this out. Create a Microsoft Word document containing the text Hello, world! and save it as Hello.docx. You can go to the site https://hash-file.online/ and hash it. You should see these results for various algorithms:
- MD5 (128-bit): 7b7799e88d4b06e70b7575118c2939de
- SHA-1 (160-bit): 0ba43ebe6f8885dfc4b9a3f2416da6a49124b1f2
- SHA-256 (256-bit): 330531f1160efc689c1c8723e55c4c61f8e3bf55d59855eb73b46bf8ce2f226d
- SHA-512 (512-bit): fcbc158658755185dab0de0f3406a5deac7a7126b7b614bf973095565b9dd541a0ca7e64f13f00622965eaf16eb53842a1de9e008e5280328b503d6f305880c8
Below the hash, you will also find a description of the file you created it for. Note that only the one who created the hash can see this information. Here is an example.
File description: “Hello.docx,” with size of 16,232 kb (kilobytes), and file hash using the hashing algorithm SHA-512 has the value: fcbc158658755185dab0de0f3406a5deac7a7126b7b614bf973095565b9dd541a0ca7e64f13f00622965eaf16eb53842a1de9e008e5280328b503d6f305880c8.
What Are the Uses of File Hashing ?
File hashing has several uses.
First, it can help owners verify if their files have been corrupted or tampered with. They can do that by comparing the hash of the questionable file with the original hash. If they match, then the integrity of the file they obtained is intact.
It also detects and removes duplicate files. Users can identify identical files by comparing their hashes and automatically deleting copies.
In addition, the process tracks changes made to files over time. If you create a new hash every time you modify a file, you can see the changes made and who made them.
What Algorithms Are Commonly Used in File Hashing ?
While many hash algorithms exist, the most commonly used ones for file integrity checks are MD5 and SHA-2.
MD5
The message-digest algorithm (MD5) is a cryptographic hash function algorithm that takes a message of any length as input and changes it into a fixed-length message of 16 bytes. It was developed by Ronald Rivest in 1991 to imbibe MD4 with advanced security features. Its output or digest size is always 128 bits.
SHA-1/SHA-2
Secure Hash Algorithm-1 (SHA-1) takes an input and produces a 160-bit (20-byte) hash value known as a “message digest.” This message digest is then rendered as a hexadecimal number that is 40 digits long. It is a U.S. Federal Information Processing Standard designed by the National Security Agency (NSA).
SHA-1 has been considered insecure since 2005. In fact, the browsers of tech giants like Microsoft, Google, Apple, and Mozilla stopped accepting SHA-1 Secure Sockets Layer (SSL) certificates by 2017.
As such, the NSA developed SHA-2, which includes significant changes. The SHA-2 family consists of six hash functions with digests or hash values with 224, 256, 384, or 512 bits (i.e., SHA-224; SHA-256; SHA-384; and SHA-512, SHA-512/224, and SHA-512/256, respectively).
—
Given the ever-increasing number of threats, users have begun hashing every bit of information sent online, including passwords. That’s because while hashes serve as unique file identifiers, they do not reveal data about a file’s actual content unless you created the hash, of course.
Key Takeaways
- File hashing is the process of calculating a fixed-size bit string value or hash from a file using a mathematical algorithm.
- The process helps with file integrity verification, duplicate file removal, and file modification tracking.
- While many algorithms exist, two of the most commonly used are MD5 and SHA-2.
Sources
- https://www.cisa.gov/sites/default/files/FactSheets/NCCIC%20ICS_Factsheet_File_Hashing_S508C.pdf
- https://www.indeed.com/career-advice/career-development/what-is-hashing
- https://www.linkedin.com/pulse/why-file-hash-important-ashok-bhadrappa/







