213
Chapter 7
Public-Key Operations
In public-key cryptography, two associated keys are necessary: one to encrypt, and
the other to decrypt. The sender encrypts a message using the recipients public key.
Once a message is encrypted, it can be decrypted only with the recipients private key.
This is in contrast to algorithms like DES and the RC2, RC4, and RC5 algorithms,
which are called symmetric-key encryption algorithms because the key used to
encrypt is the same key needed to decrypt.
In public-key cryptography, it is also possible to encrypt using a private key. In this
case, the sender takes the plaintext input and the private key and follows the same
steps needed to decrypt an encrypted file. This creates a ciphertext that can be read
using the public key. To read it, the recipient follows the same steps needed to encrypt
with the public key and restores it to the plaintext. Private-key encryption with
public-key decryption is used for digital signatures and verification. See RSA Digital
Signatures on page 233 and DSA Signatures on page243 for more information.
Crypto-C supplies a number of public-key algorithms. These include:
RSA encryption and decryption
DSA signatures
Diffie-Hellman key agreement
Elliptic curve public-key operations