Encryption is the process of turning a clear-text message
(Plaintext) into a data stream which looks like
a meaningless and random sequence of bits (ciphertext).
The process of turning ciphertext back into plaintext is called
Cryptography deals with making communications secure.
Cryptoanalysis deals with breaking ciphertext, that is,
recovering plaintext without knowing the key.
Cryptology is a branch of mathematics which deals with
both cryptography and cryptoanalysis.
A cryptographic algorithm, also known as a cipher,
is a mathematical function which uses plaintext as the input and
produces ciphertext as the output and vice versa.
All modern ciphers use keys together with plaintext
as the input to produce ciphertext. The same
or a different key is supplied to the decryption function
to recover plaintext from ciphertext.
The details of a cryptographic algorithm are usually made
public. It is the key that the security of a modern cipher lies in,
not the details of the cipher.
Symmetric algorithms use the same key for encryption and decryption.
These algorithms require that both the sender and receiver agree on a key
before they can exchange messages securely.
Some symmetric algorithms operate on 1 bit (or sometimes 1 byte) of plaintext
at a time. They are called stream ciphers. Other algorithms
operate on blocks of bits at a time. They are called block ciphers.
Most modern block ciphers use the block size of 64 bits.
Public-key algorithms (also known as asymmetric algorithms)
use two different keys (a key pair) for encryption and decryption.
The keys in a key pair are mathematically related, but it is computationally
infeasible to deduce one key from the other. These algorithms are called "public-key"
because the encryption key can be made public. Anyone can use the public key
to encrypt a message, but only the owner of the corresponding private key
can decrypt it.
Some public-key algorithms such as RSA allow the process to work in the opposite
direction as well:
a message can be encrypted with a private key and decrypted with the
corresponding public key. If Alice (or anyone else) can decrypt a message
with Bob's public key she knows that the message must have come from
Bob because no one else has Bob's private key. Digital signatures
work this way.