Skip to main content

caesar picoCTF 2019 Solution

Break a simple classical cipher by trying every possible shift until the plaintext becomes readable.

Published: April 2, 2026Updated: August 13, 2026

Description

Decrypt the message encrypted with a Caesar cipher. Hint: salting it won't help. The ciphertext appears inside the picoCTF{...} braces.

Download the file containing the ciphertext from the challenge page.

Solution

Want to try it yourself first?

The guided walkthrough reveals hints one step at a time.

Walk me through it
  1. Step 1Brute-force all 26 Caesar shifts
    Observation
    The title names the Caesar cipher, and the ciphertext is a short lowercase string inside the braces. There are only 26 possible shifts, so trying all of them is faster and more reliable than reasoning out the right one.
    A Caesar cipher shifts each letter by a fixed amount. With only 26 possible keys, brute-force is trivial. Run the Python snippet below to print every possible decryption - the shift that produces readable English inside the braces is the answer.
    python
    python3 -c "
    s='tifjjzexkyvilsztfehnahooda'
    for i in range(26):
        print(i,''.join(chr((ord(c)-97+i)%26+97) if c.isalpha() else c for c in s))
    "
    What didn't work first

    Tried: Decode the ciphertext using ROT13 only, assuming that is the standard Caesar shift.

    ROT13 is a fixed shift of 13 and is everywhere online, but this challenge uses some arbitrary shift from 0 to 25. Applying ROT13 gives one output that almost certainly is not English. You do not know the shift in advance, so loop through all 26 and read the one that forms words.

    Tried: Treat the entire picoCTF{...} string including the braces as input to the shift loop.

    Braces, underscores, and digits are not letters, so the ord() arithmetic mangles them. The ciphertext lives only inside the braces, so pass just the inner string 'tifjjzexkyvilsztfehnahooda' to the loop. The isalpha() branch leaves non-letters untouched, but keeping the wrapper on still throws off the indexing.

    Learn more

    The Caesar cipher is a monoalphabetic substitution cipher named after Julius Caesar, who reportedly used a shift of 3 to protect military communications. Every letter in the plaintext is replaced by the letter a fixed number of positions later in the alphabet, wrapping around from Z back to A.

    Because there are only 26 possible shifts (including 0, which does nothing), the Caesar cipher has an exhaustively small key space. A brute-force attack simply tries all 26 possibilities and shows the results - a human can immediately spot the one that reads as English. The Python one-liner above does exactly this: for each shift i, it maps every lowercase letter c by computing (ord(c) - 97 + i) % 26 + 97. Subtracting 97 converts the ASCII code to 0-25, adding i and taking mod 26 wraps the shift, and adding 97 converts back to ASCII.

    In real cryptanalysis, the Caesar cipher is also trivially broken by frequency analysis: in English the most common letter is 'e'. If you find the most frequent letter in the ciphertext, the difference from 'e' gives you the shift. This generalizes into more powerful attacks on simple substitution ciphers.

    The hint "salting it won't help" is a red herring - salt is a concept from password hashing (a random value added before hashing to prevent rainbow table attacks), which has nothing to do with the Caesar cipher. Recognizing such misdirection is a useful CTF skill.

Interactive tools
  • Cipher Identifier & Auto-DecoderPaste any ciphertext and the tool auto-runs every common decoder (base64, hex, Morse, ROT, Atbash, Bacon, binary, decimal, URL) and ranks the results by English-likeness.
Alternate Solution

Use the ROT / Caesar Cipher tool built into this site. Paste the ciphertext and click Try all 26 shifts to see every rotation at once - spot the row that starts with picoCTF and you have the flag, with no scripting required.

Flag

Reveal flag

picoCTF{crossingtherubiconqwjqxxmj}

With only 26 possible keys, brute-force is trivial - the shift that produces recognizable English words is the answer.

Key takeaway

Classical substitution ciphers like Caesar fail for two reasons: the key space is tiny, and letter frequency in natural language is far from uniform. Caesar takes at most 25 attempts, and frequency analysis breaks general monoalphabetic substitution with no brute force at all. Modern ciphers like AES fix both, with astronomically large keys and ciphertext that looks statistically uniform whatever the plaintext.

Related reading

Tools used in this challenge

Where to go next