Public Key Cryptography

The sample application will encrypt a document using a secret-key cipher algorithm, for example DES or RC4, and a randomly generated key. This algorithm is known as the bulk cipher, as it is used to perform the bulk of the encryption. The randomly generated key will be encrypted using a public-key cipher algorithm.

By combining public-key and secret-key encryption in this manner, we retain the advantages of public-key cryptography (we don't have to share a secret key) and the performance advantage of a secret-key cipher.

It is assumed that two public key pairs have been generated for this application: the first for the document sender and the second for the recipient.