Basic Cryptographic Algorithms
A method of encryption and decryption is called a cipher.
Some cryptographic methods rely on the secrecy of the algorithms;
such algorithms are only of historical interest and are not
adequate for real-world needs. All modern algorithms use a key
to control encryption and decryption; a message can be decrypted
only if the key matches the encryption key.
There are two classes of key-based encryption algorithms, symmetric
(or secret-key) and asymmetric (or public-key)
algorithms. The difference is that symmetric algorithms use the
same key for encryption and decryption (or the decryption key is
easily derived from the encryption key), whereas asymmetric
algorithms use a different key for encryption and decryption, and
the decryption key cannot be derived from the encryption key.
Symmetric algorithms can be divided into stream ciphers and
block ciphers. Stream ciphers can encrypt a single bit of
plaintext at a time, whereas block ciphers take a number of bits
(typically 64 bits in modern ciphers), and encrypt them as a
single unit.
Asymmetric ciphers (also called public-key algorithms or
generally public-key cryptography) permit the encryption
key to be public (it can even be published in a newspaper),
allowing anyone to encrypt with the key, whereas only the proper
recipient (who knows the decryption key) can decrypt the message.
The encryption key is also called the public key and the
decryption key the private key or secret key.
Modern cryptographic algorithms are no longer pencil-and-paper
ciphers. Strong cryptographic algorithms are designed to be
executed by computers or specialized hardware devices. In most
applications, cryptography is done in computer software.
Generally, symmetric algorithms are much faster to execute on a
computer than asymmetric ones. In practice they are often used
together, so that a public-key algorithm is used to encrypt a
randomly generated encryption key, and the random key is used to
encrypt the actual message using a symmetric algorithm. This is
sometimes called hybrid encryption.
.