457 words
2 minutes
πŸ” PicoGym - Flags

πŸ“‚ Download challenge file.

Description: What do the flags mean?
Difficulty: Medium
Author: Danny

Summary#

This challenge focuses on decoding a message hidden using Maritime Signal Flags, a visual communication method used by ships.
The challenge provides an image file named flag.png, which displays a sequence of maritime flags.

Decoding can be done manually using the reference chart or automatically through online tools like Maritime Signals decoder


Analysis#

We are given a PNG file, and upon opening it, we can see a series of flags resembling country or signal flags:
alt text

However, I noticed that the flag format PICOCTF{…} is preserved, the curly braces remain intact.

This suggests that the encoding technique only affects letters and numbers, leaving symbols like { and } unchanged.

A quick search suggests that this is likely using the Navy Signals Cipher, a system that maps letters and digits to specific maritime flags.

What Are Nautical Signal Flags?#

The International Code of Maritime Signals (ICS) is a visual communication system used in maritime navigation to transmit messages between ships or between a ship and the shore.
It uses a set of distinct flags (also called pennants or semaphores), and each flag represents a specific letter or number.


How Does the Navy Signals Cipher Work?#

The International Maritime Signal Code can also be used as a monoalphabetic substitution cipher,
each nautical flag stands for a letter (A–Z) or a number (0–9).

alt text

Example:
alt text


Number Flags#

Digits have distinct flag designs and correspond to lowercase ASCII characters:

alt text


How to Decrypt Maritime Signal Flags#

Decryption is straightforward, substitute each flag with its corresponding letter or digit.

Example:
alt text


Recognizing Maritime Flag Ciphertext#

Ciphertext made with this method typically contains:

  • Square flags in blue, white, yellow, red, or black (no green or mixed colors).
  • Patterns or themes related to ships, navy, or seafaring clues (like lighthouses or distress signals).

These visual hints indicate that the challenge likely involves Nautical Signal Flags.


Why Use Maritime Signal Flags?#

The International Maritime Signal Flags system allows ships to communicate when radio or electronic communication is unavailable.
It’s used for transmitting navigation instructions, warnings, and emergency messages, forming a critical part of naval operations.

Solution#

To decode the message, I substituted each maritime flag in the PNG file with its corresponding letter or digit.
I used the Maritime Signals decoder.

Decoded flag sequence

The decoded flag is PICOCTFF1AG5AND5TUFF.
Since the curly braces {} were not part of the encryption, I added them back to match the flag format:

⚑ Raikiri

πŸŽ‰ Flag pwned! The Navy Signals Cipher has been successfully decoded.

PICOCTF{F1AG5AND5TUFF}

πŸ’‘ TL;DR / Lesson Learned

The International Maritime Signal Flags system was primarily a visual communication tool for ships, not a cryptographic system. Its main purpose was safe, reliable signaling over distances when radio or other means weren’t available.

This system was originally used by ships to communicate visually over distances. However, this type of communication is no longer used for security purposes, as it is easily breakable.