Secure hash functions
A secure hash function will generate a large number, called the hash value, when given a document of some sort. This document can be of almost any type. We will be using simple strings in our examples.
The function is a one-way hash function, which means that it is effectively impossible to recreate the document when given a hash value. When used in conjunction with asymmetric keys, it allows the transmission of a document with the guarantee that the document has not been altered.
The sender of a document will use a secure hash function to generate the hash value for a document. The sender will encrypt this hash value with their private key. The document and the key are then combined and sent to a receiver. The document is not encrypted.
Upon receiving the document, the receiver will use the sender's public key to decrypt the hash value. The receiver will then use the same secure hash function against the document to obtain a hash value. If this hash value matches the...