Plaintext, ciphertext and key
The original readable text is the “plaintext,” the encrypted text is the “ciphertext,” and the information that sets the conversion rule is the “key.” In the Caesar cipher, the key is “how many letters to shift.” Turning ciphertext back into plaintext is called “decryption.”
Weakness 1: only 25 keys
The alphabet has 26 letters, so there are only 25 meaningful shifts, 1 to 25. Try them all (“brute force”) and you will always crack it.
Weakness 2: letter counts give it away
E is the most common letter in English text. Assume the most frequent letter in the ciphertext is E, and you can guess the shift. This is called “frequency analysis.” Even ciphers that scramble letters randomly (with about 4×1026 possible keys) have been broken by frequency analysis.
Modern ciphers have vastly more keys
- Shared-key encryption (AES, etc.): the sender and receiver use the same key. A 128-bit key has about 3.4×1038 possibilities, so brute force is practically impossible
- Public-key encryption: the “locking key” is made public and the “unlocking key” is kept to yourself. You can exchange keys safely even with someone you’ve never met, so it’s used to encrypt websites (HTTPS)
- A key turns plaintext into ciphertext, and a key decrypts it
- The Caesar cipher quickly falls to brute force and frequency analysis
- Modern ciphers have vastly more possible keys