Cryptography: From Caesar Cipher to RSA. The one-page card to reread before an exam.
Core definitions
Term
One-line definition
Cipher
An (encrypt, decrypt) algorithm pair, keyed by a secret; decrypt(encrypt(m)) = m.
Plaintext / ciphertext
The message before / after encryption.
Symmetric-key crypto
Same shared secret encrypts and decrypts (fast; needs pre-shared key).
Public-key crypto
A pair per party: public key (encrypts, published) + private key (decrypts, secret).
Trapdoor function
Easy forward, infeasible to invert — except with a secret trapdoor.
Key generation
The procedure producing a matched (public, private) key pair.
RSA
Public-key system whose trapdoor is "easy to multiply primes, hard to factor the product."
Digital signature (intro)
RSA run backwards: sign with $d$, verify with $e$; proves authorship.
Classical ciphers — and exactly how each dies
Cipher
Encrypt rule
Key space
Break
Shift (Caesar = shift 3)
$c \equiv m + k \pmod{26}$
26
brute force (≤ 25 shifts)
Substitution
apply a permutation of A–Z
$26! \approx 4\times10^{26}$
frequency analysis — structure leaks
Affine (mention)
$c \equiv am+b \pmod{26}$, $\gcd(a,26)=1$
$12 \times 26 = 312$
brute force / frequency
Rules of thumb
- Always size the key space first. Small key space ⇒ brute force wins.
- A large key space is necessary, not sufficient: if the cipher preserves structure (letter
frequencies), frequency analysis ignores the key space entirely.
- Kerckhoffs's principle: assume the attacker knows the algorithm; only the key is secret.
The two problems public-key crypto solves
Problem
Why symmetric crypto fails
Public-key fix
Key distribution
needs a pre-shared secret; sending it over an open channel needs another secret (infinite regress)
publish a lock (public key); keep the key (private key) — no shared secret
Scaling
$n$ parties need $\binom{n}{2} = \frac{n(n-1)}{2}$ pairwise keys ($\approx 5\times10^5$ for $n=1000$)
Why it works (correctness): $ed \equiv 1 \pmod{\phi(n)} \Rightarrow ed = 1 + k\phi(n) \Rightarrow
m^{ed} = m\,(m^{\phi(n)})^{k} \equiv m \pmod n$.
- Main case $\gcd(m,n)=1$: Euler's theorem ($m^{\phi(n)} \equiv 1$).
- All $m$: prove $m^{ed}\equiv m \pmod p$ and $\pmod q$ (Fermat + the trivial $p\mid m$ case), then glue
with the Chinese Remainder Theorem (needs $p \ne q$).
Why it's secure: recovering $d$ from $(n,e)$ is as hard as factoring $n$ — an assumption, not
a theorem.
- Theorem direction: factor $n$ ⇒ compute $\phi(n)$ ⇒ invert $e$ ⇒ get $d$ ⇒ broken.
- Assumption direction: no feasible attack avoids factoring (unproven; akin to trusting P ≠ NP).