When you compute a digest of a file, you can check to see that the file has not been tampered with by comparing digest outputs. A digest does not alter the original file.
$ digest -l sha1 md5 sha224 sha256 sha384 sha512 sha512_t sha3_224 sha3_256 sha3_384 sha3_512
Provide an algorithm with the digest command.
$ digest -v -a algorithm input-file > digest-listing
Displays the output in the following format:
algorithm (input-file) = digest
The algorithm to use to compute a digest of the file. Type the algorithm as the algorithm appears in the output of Step 1.
The input file for the digest command.
The output file for the digest command.
In the following example, the digest command uses a SHA2 mechanism to provide a directory listing. The results are placed in a file.
$ digest -v -a sha512 docs/* > $HOME/digest.docs.legal.05.07 $ more ~/digest.docs.legal.05.07 sha512 (docs/legal1) = a269d...c618e1bf19b3d5c9f835242708eb2b572d7b sha512 (docs/legal2) = 57be3...59a7168564296c142715cc9ed979dd838a7b sha512 (docs/legal3) = ed31d...0fb3b80d4cd58327bcc29b2e7b90a0af6770 sha512 (docs/legal4) = 67ce1...0ba0c55695614329110d0686bc2773630b5f