The GNU Privacy Handbook Prev Chapter 2. Concepts Next Digital signatures A hash function is a many-to-one function that maps its input to a value in a finite set. Typically this set is a range of natural numbers. A simple hash function is f ( x ) = 0 for all integers x . A more interesting hash function is f ( x ) = x mod 37, which maps x to the remainder of dividing x by 37. A document's digital signature is the result of applying a hash function to the document. To be useful, however, the hash function needs to satisfy two important properties. First, it should be hard to find two documents that hash to the same value. Second, given a hash value it should be hard to recover the document that produced that value. Some public-key ciphers [1] could be used to sign documents. The signer encrypts the document with his private key. Anybody wishing to check the signature and see the docum...