---
title: "Caesar cipher practice: a worked example and three self-checks"
url: https://memory.wiki/lhbyhiQt
updated: 2026-10-22T13:48:36.280Z
source: "memory.wiki"
---
# Caesar cipher practice: a worked example and three self-checks

A Caesar cipher replaces each letter with another letter a fixed distance along the alphabet. Use A=0 through Z=25. To encrypt with shift k, calculate (x+k) mod 26; to decrypt, calculate (y-k) mod 26.

## Worked example: shift 3

The word ZEBRA becomes CHEUD. Z wraps to C, E moves to H, B moves to E, R moves to U, and A moves to D. Spaces and punctuation can stay unchanged; write down that convention before exchanging messages.

## Three practice questions

1. Encrypt ATTACK AT DAWN using shift 3.
2. Decode KHOOR with shift 3.
3. If A maps to N, what is the shift and why does applying it twice restore the original text?

Answers: DWWDFN DW GDZQ; HELLO; shift 13, because 13+13=26 and the alphabet wraps once.

## How to check your reasoning

Try the examples in the [Caesar Cipher interactive tool](https://caesarcipher.org/). Enter a short message, record your chosen shift, and compare each letter with a hand calculation. If the output differs, check direction, alphabet position, and wraparound before changing the key.

For an unknown shift, test all 26 possibilities, including the identity shift. Short text can produce several plausible answers, so use context rather than assuming the first readable fragment is correct.

## Security lesson

This is a learning cipher. It has only 25 nonidentity shifts and preserves letter patterns, so it is unsuitable for passwords, private messages, or sensitive records. Its value is showing modular arithmetic and the difference between encoding and secure encryption.

Teaching extension: ask a partner to invent a four-word message, encrypt it, and trade ciphertext without the shift. Explain which clues helped recover it. Then use [caesarcipher.org](https://caesarcipher.org/) to verify the result.


---

## Summary
A Caesar cipher shifts each letter by a fixed distance in the alphabet using modular arithmetic, and while useful for teaching encoding concepts, it is insecure because it has only 25 possible shifts and preserves letter patterns.

## Themes
- modular arithmetic fundamentals
- cipher mechanics and wraparound
- security limitations and learning value

## Key takeaways
- Caesar cipher encryption uses the formula (x+k) mod 26 and decryption uses (y-k) mod 26, where x and y are alphabet positions 0-25 and k is the shift.
- The cipher has only 25 nonidentity shifts and preserves letter frequency patterns, making it unsuitable for protecting passwords or sensitive information.
- Spaces and punctuation can remain unchanged during encryption, but this convention must be agreed upon before exchanging messages.
- Testing all 26 possible shifts is a valid brute-force approach to decryption when the shift is unknown.

## Insights
- The document distinguishes between encoding (Caesar cipher) and secure encryption, positioning the cipher as a pedagogical tool rather than a practical security method.
- Shift 13 (ROT13) is self-inverse because 13+13=26, which wraps the alphabet exactly once, making it a special case worth recognizing.
- Short ciphertext is ambiguous: multiple shifts can produce plausible-looking results, so decryption requires context clues rather than assuming the first readable output is correct.

## Open questions / gaps
- How does letter frequency analysis specifically exploit the Caesar cipher's pattern preservation, and what patterns would an attacker look for?

