I have a file.bin
and file.bin.sha
. The file.bin.sha
has 32 bytes and contains binary data. How can I verify the checksum? sha256sum
complains about no properly formatted SHA256 checksum lines found
.
Asked
Active
Viewed 4,778 times
1 Answers
3
Convert the 256-bit binary value to its hex ascii representation, and append the filename to create a check file that sha256sum will like:
echo $(od -An -tx1 file.bin.sha | tr -d '\n ') file.bin > my256
sha256sum -c my256
od
- octal (binary, hex) dump of file-An
- suppress addresses-tx1
- print as one byte values, hextr -d '\n '
- suppress blanks and newlines in the output

user4556274
- 8,995
- 2
- 33
- 37
sha1sum
? – Giacomo Catenazzi Jan 24 '17 at 15:28no properly formatted SHA1 checksum lines found
error. – Pitel Jan 24 '17 at 15:32-b --binary
option to read in binary mode. Have you tried with that option? – Jan 24 '17 at 15:50the --binary and --text options are meaningless when verifying checksums
– Pitel Jan 24 '17 at 15:54file.bin
withopenssl sha256 -binary -out file.bin.sha2 file.bin
, thencmp file.bin.sha file.bin.sha2
. – Satō Katsura Jan 24 '17 at 16:22