Cryptographic hash functions
A standard length short hash value is computed from an input of arbitrary length by means of a hash function. The original message cannot be derived from the hash value, in addition, a good hash function does not produce the same hash value with two different input messages. Hash functions are used in connection with digital signatures of messages and in saving of passwords in operating systems. Hash functions are also called one-way encryption functions.
In a digital signature the sender computes a hash value from the message to be sent and encrypts it with his private key. The recipient decrypts the encrypted hash value with the sender’s public key, computes himself the hash value from the message and compares it to the hash value he has decrypted with the sender’s public key. If the hash values are equal, it is proved that the message has been signed by the sender’s private key and nobody has changed the message underway.
SHA-1 (Secure Hash Algorithm 1) is a hash function used for instance in PGP (Pretty Good Privacy, encryption of electronic mail) and SSH (Secure Shell, encryption of terminal connections). Other extensively used hash functions are e.g. RIPEMD-160 and MD5 (Message Digest 5).