Hash lengths are typically between 100 and 1,000 bits. Lengths in this range allow hash functions to have both good performance and a high probability that different messages will be hashed to different digests.
To deter message-text substitution attacks it should be very difficult to discover a correlation between a message and its corresponding digest; the hash function should be 1-way (cannot determine input from output.); diffusion is needed (slightly different messages have completely different hashes.)
An example of a hash function is the Secure Hash Algorithm (SHA).
Hashing functions can be used to fingerprint programs (detect corruption by detecting a change in a program's hash). They can also create MICs (cryptographic checksums; aka message integrity code, message authenticity code, or MAC).
A signed message is believed to have been sent by a particular principal, if hashing the message produces the same sequence of bits as encrypting the signature with the principal's public key.
A principal can add its signature to a message that has already been signed, by applying the hash function to both the text and the pre-existing signatures.
Basic Protocol:
Requirements:
Protocol to Choose e, n, and d: