Overview
The only artifact is a WAV file that sounds like pure noise. Nothing is hidden in metadata, trailing bytes or the spectrum. The message lives in the echo added to the noise, as the title hints.
flowchart LR
A[herald_recording.wav] --> B[Spectrogram: flat noise + banding]
B --> C[Autocorrelation: peaks at lag 100 and 150]
C --> D[One bit per 4096-sample frame]
D --> E[Bytes: 3 NULs + 41 bytes]
E --> F[Repeating-key XOR]
F --> G[Flag]
Prerequisites / Setup
- Python 3 (
numpy,scipy) herald_recording.wavin the working directory
Recon
Step 1 — Basic file checks
Goal: Confirm the WAV format and rule out appended bytes/metadata.
file herald_recording.wav
# RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 44100 Hz
strings -n 6 herald_recording.wav | head
Nothing useful in strings, and the file size matches the header, so there are no appended bytes. The audio was loaded with scipy.io.wavfile for everything below.
Step 2 — Spectrogram
Goal: Look for banding that indicates a periodic time-domain structure (an echo).
import numpy as np, scipy.io.wavfile as wav
import matplotlib; matplotlib.use("Agg")
import matplotlib.pyplot as plt
rate, d = wav.read("herald_recording.wav")
plt.specgram(d.astype(float), NFFT=2048, Fs=rate, noverlap=1024, cmap="magma")
plt.savefig("spec.png")
The spectrogram is uniformly broadband (white noise) with regular horizontal banding across the whole file. A visible band pattern in frequency means the signal is periodic in time, which is the signature of a comb filter, that is, an echo.
Step 3 — Find the echo delays
Goal: Locate the two candidate delays via autocorrelation.
Autocorrelation of the whole file shows two peaks and nothing else:
| Lag (samples) | Normalised autocorrelation |
|---|---|
| 100 | ~0.25 |
| 150 | ~0.14 |
A per-segment real cepstrum (inverse FFT of log|FFT|) agrees. Some segments show a peak at 100, others at 150, and none show both strongly:
for s in range(0, len(x) - 8192, len(x) // 8):
seg = x[s:s + 8192]
c = np.fft.irfft(np.log(np.abs(np.fft.rfft(seg * np.hanning(8192))) + 1e-9))[:2000]
# peaks at 100 or 150 depending on the segment
Two delays that alternate over time is the textbook layout of echo hiding: delay d0 encodes a 0 and delay d1 encodes a 1.
Exploitation
Step 4 — Find the frame size
Goal: Determine how many samples carry one bit.
Decoding with a short 1024-sample window gave bits that always came in runs of four. So the true symbol length is about 4096 samples. To confirm, decode at 512-sample resolution and look at where the decision flips:
# transitions at hop=512 land only at positions where pos % 4096 == 0
All 165 transitions fell on exact multiples of 4096, so one bit = 4096 samples.
Step 5 — Extract the bit stream
Goal: For each 4096-sample frame, compare normalised autocorrelation at lag 150 versus lag 100.
def ac(seg, lag):
return np.dot(seg[lag:], seg[:-lag]) / np.dot(seg, seg)
bits = []
for p in range(0, len(x) - 4096 + 1, 4096):
seg = x[p:p + 4096]
bits.append(int(ac(seg, 150) > ac(seg, 100))) # 150 -> 1, 100 -> 0
This gives 352 bits. The first 26 are all 0, which is just 100-sample echo (a preamble or zero padding).
Step 6 — Bits to bytes (and why it is not plain ASCII)
Goal: Pack bits MSB-first and inspect the raw payload.
Packing MSB-first from bit 0 gives 44 bytes:
00 00 00 28 1a 55 42 15 17 07 50 11 1f 18 1a 51 1e 3e 58 0a 57 0d 15 1f
59 16 2d 13 5f 12 50 55 00 1f 37 11 1a 52 33 57 00 09 5c 11
This is not readable text. I tried ASCII at several alignments, bit reversal, inversion, differential decoding and 7-bit packing, and none worked. Two observations pointed to the real structure:
- Byte values are almost all below 0x60, with many in
0x10–0x1f. - The bit statistics per column (period 8) were strongly skewed, with bit 7 almost always
0.
Both are what you get when you XOR ASCII with ASCII: two letters XOR to a small value, because their top three bits cancel. So the payload is probably encrypted with a repeating-key XOR using a text key.
Step 7 — Break the XOR
Goal: Recover the repeating key and decrypt.
Two bytes in the stream are 0x00 (bytes 32 and 40), so plaintext equals key at those positions. There is also a three-byte NUL run at the start. A good guess is that the key relates to the challenge, so I tried words like herald, echo, heraldsecho and LordSudo, at every offset.
herald immediately turned bytes 4–9 into a clean leetspeak flag prefix:
bytes(a ^ b for a, b in zip(ct[4:10], b"herald"))
# b'r00t{c'
That is the r00t{ flag prefix plus the first letter, so the key starts with herald, and the payload starts at byte 4. However, with a six-byte key the middle of the message was garbage, so the key is longer than six bytes.
The key is periodic, because later in the data a herald-decrypted block also reads as leetspeak (_th3_3). With the payload starting at byte 4, that block sits at byte 34, exactly 30 bytes after the first one. So the key period divides 30. That block is followed by four more bytes at bytes 40–43. Guessing that the flag ends in ch0} (it follows _th3_3) and XORing:
bytes(a ^ b for a, b in zip(ct[40:44], b"ch0}"))
# b'call'
The key therefore continues herald + call = heraldcall, a real phrase, which confirms the guess. A period-10 key fits the 30-byte spacing, because 30 is a multiple of 10. Decrypting with period 10:
KEY = b"heraldcall"
pt = bytes(c ^ KEY[(i - 4) % 10] for i, c in enumerate(ct) if i >= 4)
The result is a single, fully readable leetspeak sentence. Treating the key as period 20 or 30 (with the unknown key bytes left blank) leaves the middle garbled, while period 10 reads cleanly end to end.
Solve script
Goal: One-shot decoder from WAV to flag.
#!/usr/bin/env python3
"""The Herald's Echo - echo-hiding decoder + repeating-key XOR."""
import sys
import numpy as np
import scipy.io.wavfile as wav
D0, D1, FRAME = 100, 150, 4096
KEY = b"heraldcall"
rate, data = wav.read(sys.argv[1])
x = data.astype(float)
def ac(seg, lag):
"""Normalised autocorrelation of a frame at one lag."""
return np.dot(seg[lag:], seg[:-lag]) / np.dot(seg, seg)
# 1. one bit per frame: which echo delay is stronger?
bits = []
for p in range(0, len(x) - FRAME + 1, FRAME):
seg = x[p:p + FRAME]
bits.append(int(ac(seg, D1) > ac(seg, D0)))
# 2. pack MSB-first into bytes (frame grid is byte aligned)
n = len(bits) // 8 * 8
ct = bytes(int("".join(map(str, bits[i:i + 8])), 2) for i in range(0, n, 8))
print("ciphertext:", ct.hex())
# 3. payload starts at byte 4; key is aligned to it
pt = bytes(c ^ KEY[(i - 4) % len(KEY)] for i, c in enumerate(ct) if i >= 4)
print("plaintext :", pt.decode())
Run it with python3 solve.py herald_recording.wav. The expected output is the ciphertext hex above, followed by the flag.
Flag
r00t{REDACTED}
The decrypted text spells out the technique used: cepstral analysis reveals the echo.
Lessons / Takeaways
- Recognising echo hiding: two evenly spaced autocorrelation peaks (100 and 150 samples) alternating across frames is the classic signature of echo hiding in an audio carrier.
- Bit packing matters: the frame grid is byte aligned, so pack MSB-first; the payload starts at byte 4 after a three-byte NUL preamble.
- XOR with ASCII: two letters XOR to a small value (top three bits cancel), so an ASCII-key XOR leaves most bytes below
0x60. That is the tell that it is a repeating-key text XOR, not a random stream. - Crib with the flag prefix:
r00t{alone recovers the first five key bytes; confirming the period via a later known block (ch0}) locks in the fullheraldcallkey. - Verify with period: period 10 reads cleanly end to end; periods 20 or 30 with blank bytes leave the middle garbled.
Techniques
- Echo Hiding
- Autocorrelation Analysis
- XOR & Repeating-Key Ciphers
- Audio Steganography
References
- Petitcolas, Anderson, Kuhn, “Information Hiding — A Survey” (echo hiding / spread-spectrum audio steganography)

