LOGBOOK

HELP

Quiz Entry - updated: 2026.03.01

How can you formally express the Caesar cipher's encryption and decryption using modular arithmetic?

Encryption: $c = (m + r) \bmod 26$. Decryption: $m = (c - r) \bmod 26$. Applying both returns the original message.

The Caesar cipher has three steps formalized as functions:

  1. Coding $K$ — maps letters to numbers: $A=0, B=1, \ldots, Z=25$
  2. Encryption $V$ — shifts by key $r$: $V(m) = (m + r) \bmod 26$
  3. Decoding $D$ — maps numbers back to letters

Completeness check (encrypting A with key $r=3$, then decrypting):

  • $K(A) = 0$
  • $V(K(A)) = V(0) = (0 + 3) \bmod 26 = 3$
  • $D(V(K(A))) = D(3) = D$

General decryption formula:

$$m = (c - r) \bmod 26$$

Example with $r=15$: Encrypting T (=19):

  • $V(K(T)) = V(19) = (19 + 15) \bmod 26 = 34 \bmod 26 = 8$ → I

Decrypting I (=8) back:

  • $(8 - 15) \bmod 26 = -7 \bmod 26 = 19$ → T ✓

From Quiz: KRYPTOG / Introduction to Cryptology | Updated: Mar 01, 2026