The Numbers picoCTF 2019 Solution

Published: April 2, 2026

Description

The numbers... what do they mean? An image of numbers is provided - decode it to find the flag.

Download the image file from the challenge page.

  1. Step 1Apply A1Z26 substitution
    The numbers in the image map directly to alphabet positions: 1=A, 2=B, 3=C ... 26=Z. Read off each number and replace it with its corresponding letter. Numbers inside curly braces are also encoded. 'PICOCTF' is the prefix (16=P, 9=I, 3=C, 15=O, 3=C, 20=T, 6=F) and the content inside the braces spells THENUMBERSMASON.
    Learn more

    A1Z26(also called "Number-to-Letter substitution") is perhaps the simplest possible substitution cipher: each letter in the alphabet is assigned its ordinal position, so A=1, B=2, C=3, ... Z=26. To decode, you simply replace each number with its corresponding letter. There is no key and no ambiguity - it is deterministic and universal.

    This is technically a substitution cipher - a cipher where each symbol is replaced by another symbol according to a fixed mapping. A1Z26 is the weakest possible substitution cipher because the mapping is publicly known and requires no key. Real historical ciphers like the Caesar cipher shift the mapping, and the Vigenere cipher uses a repeating key to vary the shift, but A1Z26 is even simpler than either.

    The challenge title "The Numbers, Mason" is a reference to the 2010 video game Call of Duty: Black Ops, where an antagonist repeatedly asks the protagonist to decode a sequence of numbers. This has become a popular internet meme, making number-substitution puzzles instantly recognizable to the CTF community.

    To decode quickly in Python: chr(n + 64) converts a number 1-26 to its corresponding uppercase letter (since ord('A') == 65). CyberChef also has a built-in "A1Z26 Cipher Decode" recipe that handles this automatically.

    Why simple substitution ciphers fail against modern cryptanalysis: A1Z26 and similar monoalphabetic substitutions preserve letter frequency. If you know the plaintext is English, you can directly apply frequency analysis - the number that appears most often likely corresponds to E (the most common English letter). For a short plaintext like a CTF flag, frequency analysis may not be reliable, but the known prefix (PICOCTF) immediately gives away the mapping for 7 of the 26 letters, making the rest trivial to deduce through pattern recognition even without frequency counting.

    Polybius square and other historical variants: The A1Z26 cipher is related to the Polybius square, a 5x5 grid encoding letters as two-digit numbers representing their row and column. The ADFGVX cipher used in World War I combined a Polybius square with a transposition cipher, providing significantly more security than simple substitution. These historical ciphers appear regularly in CTF puzzle categories and serve as building blocks for understanding modern cryptographic concepts like substitution-permutation networks (SPNs) that underlie AES.

    In competitive CTF solving, quickly identifying a number-substitution cipher (as opposed to, say, decimal ASCII codes or a Baconian cipher) comes down to the range of values. If numbers are all in 1-26, it is almost certainly A1Z26. If they are in ranges like 32-126, they are likely ASCII decimal codes. If grouped in pairs with values 0-15, they might be hex. Building mental pattern-recognition for these ranges saves significant time during competition. Practice by solving CryptoHack and classic cryptography puzzles from PicoCTF archives.

Alternate Solution

CyberChef has a built-in A1Z26 Cipher Decode recipe that converts number-to-letter automatically. Alternatively, use the Number Base Converter on this site to quickly verify individual number-to-letter mappings (remember: 1=A, 2=B, ... 26=Z corresponds to decimal values 65-90 in ASCII when you add 64).

Flag

PICOCTF{THENUMBERSMASON}

A1Z26 is one of the simplest possible substitution ciphers - numbers directly index into the alphabet.

Want more picoCTF 2019 writeups?

Tools used in this challenge

Related reading

What to try next