Skip to main content

morse-code picoCTF 2022 Solution

Decode an audio file encoding a message in a classic dot-and-dash signal format.

Published: July 20, 2023Updated: August 25, 2026

Description

A short WAV file encodes the flag in Morse. Decode the audio, replace spaces with underscores, and wrap it in picoCTF{...}.

Download morse_chal.wav and have a Morse audio decoder ready (e.g., morsecode.world → Audio Decoder, or our Morse Decoder tool for dot-dash text).

Solution

Want to try it yourself first?

The guided walkthrough reveals hints one step at a time.

Walk me through it
  1. Step 1Run the audio through a decoder
    Observation
    The challenge gives a WAV file and the description says Morse code outright. Feed the audio into an online Morse audio decoder and read the letters out.
    The file is only ~30 seconds long; most online Morse decoders output the letters immediately.
    What didn't work first

    Tried: Trying to listen to the audio and manually transcribe dots and dashes by ear.

    Manually transcribing Morse audio is extremely error-prone, especially for digits mixed with letters. A beginner will mishear short tones as long ones and lose track of word boundaries. Online audio decoders like morsecode.world handle the entire conversion automatically in seconds.

    Tried: Using a text-based Morse decoder tool before decoding the audio first.

    A text-based Morse decoder expects dot-dash input, not a WAV file. Run the audio through an audio-specific decoder first to get the dots and dashes, or the letters directly, and only reach for a text decoder if you end up with raw symbols.

    Learn more

    Morse code represents letters and digits as sequences of short signals (dots) and long signals (dashes), separated by pauses. It was developed in the 1830s for telegraph communication and is still used in amateur radio. Each character has a unique dot-dash pattern: A is .-, B is -..., and so on.

    In audio Morse, the dots and dashes are tones of different durations. Automated decoders work by analyzing the waveform: they measure the duration of each tone and silence, classify them as dots, dashes, or separators based on timing ratios, and map the resulting patterns to characters. Online tools like morsecode.world or morse.withgoogle.com can decode audio files without any local software. Once you have the dot-dash text, you can also use our Morse Code Decoder to convert it to plain text instantly.

    For those who prefer command-line tools, fldigi is a popular open-source amateur radio application that includes a Morse decoder. More programmatically, Python libraries like pyaudio combined with signal processing can detect tone frequencies and timings from WAV files.

  2. Step 2Apply the required formatting
    Observation
    The problem says to replace spaces with underscores before wrapping in picoCTF{...}, and the decoder returns uppercase text with word boundaries. So two transformations are needed, lowercasing and space-to-underscore, before the flag will be accepted.
    The decoded message reads WH47 H47H 90D W20U9H7 - that's letter-and-digit Morse, where 4, 7, 9, 0, 2 are real digits in the Morse alphabet (....-, --..., ----., -----, ..---), not garbled letters. Spaces become underscores per the prompt. Wrap with picoCTF{ and } to assemble the final flag, e.g. picoCTF{wh47_h47h_90d_w20u9h7} ending in a closing brace so the format check passes.
    bash
    echo 'WH47 H47H 90D W20U9H7' | tr '[:upper:]' '[:lower:]' | tr ' ' '_' | sed -e 's/^/picoCTF{/' -e 's/$/}/'
    What didn't work first

    Tried: Treating the digits in the decoded output as garbled letters and re-decoding them.

    Morse code has a full numeral set (0-9) so digits like 4, 7, 9 in the output are correct and intentional, not a decoding error. Re-interpreting them as letters produces nonsense. Trust the decoder output and keep the digits as-is.

    Tried: Leaving spaces between words instead of replacing them with underscores.

    The challenge prompt explicitly says to replace spaces with underscores before wrapping in picoCTF{}. Submitting with spaces (e.g. picoCTF{wh47 h47h ...}) will fail the flag check. Use tr or a simple find-and-replace to swap every space for an underscore.

    Learn more

    The pipeline demonstrates several useful shell text-transformation tools in sequence. tr '[:upper:]' '[:lower:]' lowercases the entire string using character classes, which handles the full alphabet without listing each letter. tr ' ' '_' then translates (replaces) every space with an underscore - the tr (translate) utility maps individual characters one-to-one, making it ideal for single-character substitutions.

    The final two sed substitutions prepend the flag prefix and append the closing brace. sed 's/^/picoCTF{/' replaces the start-of-line anchor with the prefix text, and sed 's/$/}/' appends to the end of the line. Chaining these transformations is idiomatic Unix shell scripting.

    In CTF flag formatting, word separators commonly use underscores rather than spaces because spaces can cause issues in URLs and command-line arguments. Recognizing this convention helps when you decode a phrase and need to decide how to format it for submission.

Interactive tools
  • Morse Code DecoderDecode Morse code to plain text or encode text to Morse code. Supports all letters, digits, and common punctuation.
  • 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

If you already have the decoded dot-dash text (from morsecode.world or another audio decoder), paste it straight into the Morse Code Decoder on this site to convert dots and dashes to letters instantly. No audio processing needed for that last step.

Flag

Reveal flag

picoCTF{...}

Simple signal-processing exercise, so there's no need for heavy tooling.

Key takeaway

Morse is a substitution encoding mapping each character to a fixed dot-dash pattern, and audio Morse renders those patterns as tones of differing duration. Anything encoded this way comes back with an off-the-shelf decoder, because the codebook is public. Recognizing the rhythmic beeping, or the dot-dash text, is enough to pick the right tool and finish in seconds.

Related reading

Tools used in this challenge

Where to go next