What is the difference between encryption and a digest?
Encryption is the transformation of plaintext into ciphertext using a cryptographic function. A one-way cryptographic function such as a cryptographic hash function is irreversible. A two-way cryptographic function such as a symmetric or asymmetric key based function is reversible.
A message digest uses encryption to verify that the contents of a message aren’t modified in transit between the sender and receiver of the message. A message digest is a fixed-length string that is generated by applying a cryptographic hash function to the contents of an entire message. It is computed by the sender and attached to the message. When the receiver receives the message, the receiver can re-compute the message digest and compare it to the original message digest in the message. If the two strings are equal, the receiver can be sure that the message wasn’t altered in transit.
A message digest is also called a hash or fingerprint.