Hi people, did you ever check md5, sha-256, sha-512 from a file or generate it with the help of (Linux or Mac os) command-line tools?This
quick tutorial help you compute and check cryptographic hash functions and message digest ,with the help of command-line tools in Linux or Mac os
You probably want to make sure about data integrity of your downloaded software(wallet or a file)
-> First of all search and open an application called terminal on your Linux/Mac Pc.
1 To print 512-bit checksum to standard-output: (if no /path/to/myFile specified or - used it reads the file from standard-input)
$ sha512sum /path/to/myFile
or
$ cat /path/to/myFile | sha512sum
-> It is possible to pass many files you want:
$ sha512sum file1 file2 file3
2 If you want to check a sha-512 from a file, you need to have second file which hold hash string of that file
in the same directory where the original file is.
you shuld use:
-c , --check$ sha512sum -c second_file
output ----> myFile: OK (if it matches) ✔︎
----> myFile: FAILED (if not matches) ✗
-> Using [--status] prints nothing but, 0 status code if matches, 1 status code if not matches.
3 Structure of second_file :
c94513342f28407c5105427c1f587c6f6b10219767930eca48bb4315461201c62207e510b19e6b4 900a8f095650e3275f24894ba52f85b740b1ede2d0d6c9500 myFile
da8b193faffed956886ad26377d11d9a1801ace2f8907bf2e95efb8b869d1803fd4f017407cec20 a45dea94555b172e482ebf7cf24642f81f20779511f986b2c myFile2
...
-> Note that two space between hash string and myFile.
-> This will help if you copy/paste a hash string and send it to standard-input of sha512sum:
$ echo "da8b193faffed956886ad26377d11d9a1801ace2f8907bf2e95efb8b869d1803fd4f017407cec20 a45dea94555b172e482ebf7cf24642f81f20779511f986b2c myFile" | sha512sum -c
-> You can also use 256-bit or sha-1 or md5 : just write
$ sha1sum | md5sum | sha256sum instead.
-> On
Mac os you should use
shasum program but use
-a 512 or 256 -> If you are confuse about directory of a file, simply drag and drop the file into terminal.
Do you know some command-line tools related to cryptography or Bitcoin ?
I would appreciate to professional users for their feedback on this tutorial-Mike