Pretty Good Privacy (PGP) is a secure email program that provides a confidentiality and authentication service that can be used for electronic email and file storage applications. PGP achieves confidentiality and authentication by the following steps:
- The sender creates a message M
- SHA-1 is used to generate a 160-bit hash code of the message
- The hash code is then encrypted with RSA using sender’s private key.
- The result is concatenated with the original message. (Pts. 1-4 covers authentication)
- Also, a 128-bit number is generated which is going to be the session key for the current session only.
- The message from step 4 is encrypted using CAST-128 and the session-key
- The session-key is then encrypted with RSA using the recipient’s public key and is attached (prepended) to the message. (Pts. 5-7 covers confidentiality)
- Message is transferred through the medium.
- The receiver uses RSA to with its private key to decrypt and recover session key
- Now since the session key is obtained , the remaining message is decrypted using sender’s public key and RSA
- The receiver then generates a hash code for the message and compares them it with the decrypted hash code. If they match, the message is considered as authentic.