In modern computer science, the Caesar Cipher is expressed using modular arithmetic. If we assign each letter a number (A=0, B=1, ..., Z=25), the encryption of a letter by a shift can be described as:
Dn(x)=(x−n)mod26cap D sub n open paren x close paren equals open paren x minus n close paren mod 26 Historical Significance caesar cipher
At its core, the Caesar Cipher is a type of where each letter in a plaintext message is replaced by a letter some fixed number of positions down the alphabet. In modern computer science, the Caesar Cipher is
To decrypt the message, the recipient simply reverses the shift. If they know the shift is 3, they move 3 units backward in the alphabet. The Mathematical Formula If they know the shift is 3, they
The is one of the simplest and most widely known encryption techniques in history. Named after Julius Caesar, who used it to protect his military communications, this "substitution cipher" remains the foundational starting point for anyone learning about cryptography today. What is a Caesar Cipher?
To visualize the cipher, imagine two alphabets lined up on top of each other. The "plain" alphabet is the one you are writing in, and the "cipher" alphabet is shifted. Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC Using this key, the word "HELLO" becomes: H → K E → H L → O L → O O → R Ciphertext: KHOOR
There are only 25 possible shifts (a shift of 0 or 26 leaves the text unchanged). An attacker can simply try every possible shift—a "brute-force attack"—and find the readable message in seconds.