An encryption algorithm (), also called a cipher, transforms a plaintext () into a ciphertext () under the control of a secret key ().
The reverse process, decryption () or decipherment, recovers the plaintext:
Secret Key
The secrecy of plaintext is totally dependent on the secrecy of the key .
Algorithms with this property are called symmetric cryptosystems or secret key cryptosystems. Both parties to a secret communication must know and keep it secret.
Security also depends on Kerckhoffs’s principle, covered in a dedicated note, for what a cryptosystem may safely assume is public.
Categorization
Ciphers are classified along several axes, not mutually exclusive. A modern cipher often falls into multiple categories at once.
Classical Ciphers
The ciphers used in the pre-computer era are called historical ciphers or classical ciphers.
Historical ciphers used plaintext linked to:
- A particular language.
- The alphabet of symbols or characters used.
- The peculiar statistical characteristics of the language.
For English:
- A 26 character alphabet (A to Z).
- Higher usage of characters e, t, a, o, i.
- Higher appearance of bigrams (th, he, an, in) and trigrams (the, ing, and, her, ere).
Mono-alphabetic Ciphers
A plaintext character is replaced with a ciphertext character according to a fixed rule.
Preserves the language’s statistical characteristics in the ciphertext.
The shift and substitution ciphers are examples of mono-alphabetic ciphers.
Poly-alphabetic Ciphers
Uses multiple substitution alphabets, e.g. one alphabet for odd-numbered positions and a different one for even-numbered positions, flattening the character frequency graph.
Using alphabets in a poly-alphabetic cipher gives a key space of at the cost of remembering a key of length characters.