Cryptography

Cryptography is the process of converting between readable text, called plaintext, and an unreadable form, called ciphertext.

Cryptography occurs as follows:
  1. The sender converts the plaintext message to ciphertext. This part of the process is called encryption (sometimes encipherment).
  2. The ciphertext is transmitted to the receiver.
  3. The receiver converts the ciphertext message back to its plaintext form. This part of the process is called decryption (sometimes decipherment).

The conversion involves a sequence of mathematical operations that change the appearance of the message during transmission but do not affect the content. Cryptographic techniques can ensure confidentiality and protect messages against unauthorized viewing (eavesdropping), because an encrypted message is not understandable. Digital signatures, which provide an assurance of message integrity, use encryption techniques. For more information, see Digital signatures in SSL and TLS.

Cryptographic techniques involve a general algorithm, made specific by the use of keys. There are two classes of algorithm:

The encryption and decryption algorithms that are used can be public but the shared secret key and the private key must be kept secret.

Figure 1. Symmetric key cryptography
This diagram shows plaintext encrypted to ciphertext with a shared secret key. Because the cryptography is symmetric, the ciphertext is decrypted using the same secret key.
Figure 2. Asymmetric key cryptography
This diagram shows plaintext encrypted to ciphertext with the receiver's public key. The recipient decrypts the ciphertext with the receiver's private key.

Figure 2 shows plaintext encrypted with the receiver’s public key and decrypted with the receiver’s private key. Only the intended receiver holds the private key for decrypting the ciphertext. The sender can also encrypt messages with a private key. Anyone who holds the sender’s public key can decrypt such messages, with the assurance that the messages must be from the sender.

With asymmetric algorithms, messages are encrypted with either the public or the private key, but can be decrypted only with the other key. Only the private key is secret. The public key can be known by anyone. With symmetric algorithms, the shared key must be known only to the two parties. This condition is called the key distribution problem. Asymmetric algorithms are slower but have the advantage that there is no key distribution problem.

Other terminology that is associated with cryptography is as follows:

Block cipher algorithm
These algorithms encrypt data by blocks. For example, the RC2 algorithm from RSA Data Security Inc. uses blocks 8 bytes long.
Stream cipher algorithm
These algorithms operate on each byte of data.