SHIFT CIPHER • BEGINNER

Caesar Cipher

Move every letter by the same fixed amount and learn to reverse the shift without guessing.

Family Monoalphabetic substitution
Key / parameter One shift from 0–25
Text structure Spaces and punctuation normally stay in place
01 • OVERVIEW

What is the Caesar Cipher?

A Caesar cipher replaces every plaintext letter with a letter a fixed number of positions away in the alphabet. The shift is the same everywhere in the message.

Because one plaintext letter always maps to one ciphertext letter, letter patterns are preserved. A doubled plaintext letter stays doubled, and repeated words keep the same pattern.

Competition note

The cipher mechanics on this page are self-contained. Science Olympiad event formats, allowed variants, and tournament constraints can change by season; the current official Rules Manual and official clarifications take precedence.

Starting from zero?

No outside reference is assumed. Work through Foundations → Complete Reference → Encryption → Decryption in order, then use the competition and cryptanalysis sections.

02 • FOUNDATIONS

What you need to know

  • Plaintext is the readable message.
  • Ciphertext is the shifted message.
  • Shift is the number of alphabet positions moved.
  • The alphabet wraps around: after Z comes A.

Beginner glossary

Term Meaning
Shift The fixed number of alphabet positions moved for every letter.
Wraparound Continuing from Z back to A, or from A back to Z.
Modulo 26 Arithmetic where values repeat every 26 positions; it handles alphabet wraparound.
Brute force Testing every possible shift systematically.
03 • COMPLETE REFERENCE

Keep this beside you while solving

Plain A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

Example reference for shift +3. To decrypt, move three positions backward.

Alphabet numbers used in formulas

Letter A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Value 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Direction check: with shift +3, plaintext X encrypts to A. To decrypt A with the same key, move backward 3 to X.
Reference rule: if a fixed table, formula, alphabet, or convention is needed to solve this cipher, it should be visible in this section or generated explicitly by the visualizer below.
04 • ENCRYPTION

How encryption works

1

Choose the shift

For a shift of +3, every plaintext letter moves three places forward.

2

Map each letter

A→D, B→E, C→F, and so on.

3

Wrap at Z

X→A, Y→B, Z→C.

4

Preserve separators

Keep spaces and punctuation unless a problem explicitly removes them.

05 • DECRYPTION

How decryption works

1

Find or infer the shift

If the shift is given, use it directly. Otherwise test shifts or use recognizable word patterns.

2

Move backward

Subtract the shift from every ciphertext letter.

3

Wrap below A

With shift 3, B decrypts to Y.

4

Read the result

Check that the whole message—not just one word—makes sense.

06 • COMPETITION WORKFLOW

How to approach it in Codebusters practice

  • If a shift is supplied, this is mainly a speed-and-accuracy task.
  • If it is not supplied, test all 26 possibilities systematically rather than guessing random letters.
  • Use short words and repeated patterns to identify the correct plaintext quickly.

What the problem gives you vs. what you produce

Part What to expect
You may be given A ciphertext and a shift, or a ciphertext whose shift must be identified.
You must find Usually the plaintext; sometimes the shift as well.
Fastest first move If the shift is known, write one shifted alphabet row. If unknown, test shifts systematically.
Season note: use this page to learn the cipher mechanics and solving workflow. Exact Science Olympiad event constraints can change by season, so follow the current official rules/clarifications for tournament-specific limits.
07 • CRYPTANALYSIS

How to attack an unknown or partially known key

  • A Caesar cipher has only 26 possible shifts, so exhaustive testing is practical.
  • Frequency analysis can help on longer texts: the most common ciphertext letter may correspond to a common plaintext letter such as E or T, but do not trust one frequency alone.
  • A known plaintext fragment immediately determines the shift.
08 • WORKED PROBLEM

Follow one example from start to finish

Problem
Decrypt WKH GDLOB FLSKHU with shift 3.
Step 1
W → T , K → H , H → E gives THE.
Step 2
Apply the same -3 shift everywhere.
Answer
THE DAILY CIPHER
BEGINNER SELF-CHECK

Before moving on, make sure you can answer these without another site:

  • Can you explain why Z shifted by +2 becomes B?
  • Can you decrypt D with a shift of +3 without rebuilding the entire alphabet?
  • If the shift is unknown, can you explain why there are only 25 nontrivial shifts to test?
09 • ERROR CHECK

Common mistakes

!

Shifting in the wrong direction.

!

Forgetting to wrap around A/Z.

!

Changing the shift halfway through.

!

Accepting one plausible word without checking the rest of the message.

10 • SPEED

Competition speed strategies

1

Write one shifted alphabet row once and use it for the entire problem.

2

For unknown shifts, test a likely short word against a few shifts first.

3

When a shift is known, work left-to-right and mark each word as soon as it is decoded.

11 • QUICK REFERENCE

What to remember under time pressure

Encrypt C = P + shift (mod 26)
Decrypt P = C − shift (mod 26)
Key space 26 shifts
Pattern Repeated letters stay repeated
How to use this section: during timed practice, come here first for the minimum rules. If a step is unclear, jump back to Complete Reference or the worked example instead of guessing.
12 • INTERACTIVE LAB

See every transformation

Use the lab to change inputs and keys, keep the relevant reference material visible, inspect each intermediate transformation, and then read the “How to reverse it” panel so encryption and decryption connect.