I generated checksums for a list of files and stored them a .sha1 file by using the following command:

openssl dgst -r -sha1 -out sums.sha1 *

which is the equivalent of:

sha1sum * > sums.sha1

Now what is the openssl equivalent of the following command?

sha1sum -c sums.sha1
  • Are you sure those are equivalent? openssl dgst -r -sha1 /usr/bin/true, for example, gives me f012036ffa0e3f3b6c27892203165a72af55f06d */usr/bin/true, with a * in it. – muru May 29 '19 at 23:58
  • I don't believe openssl has an equivalent function. One could probably script one pretty easily though. – kevlinux May 30 '19 at 6:20
  • @muru: sha1sum also adds a * in the output, this is the expected coreutils format as far as I know. – Chris May 30 '19 at 7:31
  • Ah, got it. With GNU coreutils (8.22, 8.31), it does with the -b flag, not without it. Anyway, it seems the openssl dgst verify functions are all tied to verifying a signature (so you need to sign it in addition to just getting the digest). – muru May 30 '19 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.