What is Hashing

Hashing is a process of mapping the data size of any file to a fix value (called hash value) with random strings characters which contains alphabets & numeric. Different algorithms  are used in order to generated the hash values for a file.

A hash value will be same for a file for a given algorithm until it modifies. if file will modify the hash value for that file will be completely different.

Hash Value For A Text File Pic 1

Hash Value For Same Text File When Modified Pic 2

Why Hashing Useful

Hashing is important while transferring the data from source  to destination point to make data persistent , authenticated & tempered proof. just assume if you are downloading the data from a site & some how connection  is compromised with some anonymous connection/hacker & he added a little code to your file which you are downloading. that is very dangerous , you will be in trouble if you run that program without checking the authenticity of that file. so developer/server host provider provide the a hash value or a hash public key file of that particular downloadable file. so you can verify the that the file you have downloaded is the same copy which they are provided. Because once the file modified by anonymous person the hash value of that file is different compare to the original one.

What Are SHA , MD5

SHA or MD5 are the algorithms which are used to generate the hash value for a file. Different algorithms generates the different length of hash value. And as long a hash value is it is hard to break the encryption of that algorithm. There are many popular algorithms which are used to generate the hash files but SHA & MD5 are the top most which are commonly used.

Version of MD5 : MD2,  MD4, MD5, MD6
Version Of SHA: SHA-0 to SHA-3

How To Verify The Hash Value In Windows : 

In Windows you can use the command prompt or power-shell tool to verify the hash values of a file.

In CMD : There is a utility called 'certutil'  which can be used to verify the hash value as shown in below example:

certutil -hashfile c:\Users\JDoe\Desktop\abc.exe SHA512

In this example, hash value of abc.exe is beign verify using algorithm SHA512

In Power-shell: To get the hash value of a file using power shell there is any inbuilt command.

Get-FileHash .\abc.txt -Algorithm SHA256

In this example, hash value of abc.txt file is being evaluated using algorithm SHA256

Note: SHA256 is 32 bytes hash string & SHA512 is 64 bytes hash string.


Post a Comment