If a signature is needed, the sender creates a unique code (hash) from the original message and encrypts it using their private key. This ensures the authenticity of the message.
Compress Message and Signature:
Both the original message and the signature are compressed using a ZIP compression algorithm. This reduces the size of the data for efficient transmission.
Encrypt with Session Key:
The compressed message and signature are encrypted using a randomly generated session key for confidentiality. This session key is then encrypted with the recipient’s public key and attached to the beginning of the message.
Convert to Radix-64 Format:
The entire encrypted block is converted into a format called radix-64, which is a way of representing binary data in ASCII characters.
Reception Steps:
Convert Back to Binary Format:
Upon receiving the message, the recipient converts the entire block back to binary format from radix-64.
Recover Session Key:
The recipient uses their private key to recover the session key, which was encrypted with their public key during transmission.
Decrypt Message:
The recipient then decrypts the compressed message and signature using the recovered session key. This reveals the original message.
Decompress Message:
The decrypted message is decompressed, restoring it to its original size and content.
Verify Signature (if signed):
If the message was signed, the recipient computes a new hash code from the received message and compares it with the hash code received in the signature. If they match, the message is accepted; otherwise, it is rejected.