openssl-dgst
calculates message digests of files
TLDR
Calculate SHA256 hash
$ openssl dgst -sha256 [file]
Calculate MD5 hash$ openssl dgst -md5 [file]
Output hash only$ openssl dgst -sha256 -r [file]
Sign file with private key$ openssl dgst -sha256 -sign [private.key] -out [signature] [file]
Verify signature$ openssl dgst -sha256 -verify [public.key] -signature [signature] [file]
SYNOPSIS
openssl dgst [options] [file...]
DESCRIPTION
openssl dgst calculates message digests (hashes) of files. Supports various algorithms including SHA-256, SHA-512, and MD5. Can also sign and verify files using asymmetric keys.
PARAMETERS
-sha256, -sha512, -md5
Hash algorithm to use.-sign key
Sign with private key.-verify key
Verify with public key.-signature file
Signature file for verification.-r
Output hash in coreutils format.-hex
Output as hex (default).-binary
Output in binary.

