SHA-1 is a cryptographic hash function that is used to obtain a hash value corresponding to a text or a file. This helps us a lot for verification purposes.
For example you can first find the SHA-1 hash value generated for a critical file that you want to prevent unauthorized modifications to. And then at a later time, if you want to use that file, you can recalculate the SHA-1 hash value for the same file and check whether the two values are the same. The difference of the two values would indicate an unauthorized modification to the file.
Now we will see how we can calculate the SHA-1 hash for a text.
1. Open the Linux terminal.
2. Type the following command in it.
echo -n "the-text-you-want-to-find-the-hash-of" | sha1sum
As shown in the diagram below:
3. Then what you will see as the output on the terminal is the SHA-1 Hash value of your text.
It is simple isn't it?
Comments
Post a Comment