block_0.png
| (1) read the picture + metadata -> which hash is the "parent"
v
| (2) keyed LSB extraction -> a block header (text)
v
| (3) proof of work (find the nonce) -> an AES key
v
| (4) decrypt the hidden PNG chunk -> a WAV file
v
| (5) left minus right channel -> spectrogram with the flag
There are fake flags at almost every stage. If a flag looks too easy, it is a decoy.
Finding: Comment: rvcectf{n1ce_try_h0pl1t3} | What it is: Fake flag
Finding: ZIP after IEND (found by binwalk) containing rvcectf{b3w4r3_gr33ks_b34r1ng_z1ps} | What it is: Fake flag (a Trojan Horse joke)
Finding: Four text entries named pater, progonos, theios, koryphe, each a 64-hex-character hash | What it is: Candidate "parent" hashes. Only one is real
Finding: Three odd chunks named blCa, blCk, blCz, each 632,896 bytes (about 618 KiB) | What it is: Encrypted-looking data. Only one is real
The image itself is a fake "block explorer". It looks pretty but holds no obvious flag. Nothing here can be cracked yet, so we need more information from the picture.
This is the key hint. It tells us the hidden bits are not stored in normal pixel order. They are stored in the order you get by sorting the pixels by SHA256(prev || i), where i is the pixel index.
That is why normal tools (zsteg, stegsolve, any LSB sweep) find nothing: the bits are scattered across the whole image in a secret order.
The details the player has to figure out (any wrong guess just produces garbage, so you can try all combinations):
prev is the raw 32 bytes (not the hex text).
i is a 4-byte big-endian number.
Pixel index is row-major: y * width + x.
Sort ascending by the 32-byte digest.
The bit lives in bit 1 (the second-lowest bit) of the blue channel.
Bits are packed MSB first into bytes.
You know you got it right when the first four bytes spell BLK0.
import hashlib, struct
import numpy as np
from PIL import Image
prev = bytes.fromhex(PREV_HEX) # raw bytes
keyed = sorted((hashlib.sha256(prev + struct.pack(">I", i)).digest(), i)
for i in range(W * H))
order = [i for _, i in keyed[:8192]] # first 8192 pixels are plenty
bits = (flat[order, 2] >> 1) & 1 # channel 2 = blue, bit 1
data = np.packbits(bits).tobytes() # MSB first
BLOCK v2 / ATHENS
height: 431
proposer: Alkibiades
prev: eba32966...a86421
merkle: d35a598b...a6be9506
olympiad: 87.1
bits: 24
oracle: the Pythia speaks with two voices; only one is hers
pow: sha256d(every byte of this header up to and including the nonce digits)
rule: lowest nonce counting from 0, decimal, no padding, no newline
seal: blCk | aes-256-cbc | key = pow hash | iv = first 16 bytes
nonce:
Note: Trap: the prev: line inside this header is a different hash (the grandparent). It is flavour text. Do not use it as the key.
The header is a block with an empty nonce. Like a real miner, we must find the nonce that makes its hash start with enough zeros. The header explains everything:
Header line: bits: 24 | Meaning: The hash must start with 24 zero bits (= 3 zero bytes)
Header line: every byte of this header up to and including the nonce digits | Meaning: x = the extracted text exactly as is, ending in nonce: , with the number glued on
Header line: rule: lowest nonce counting from 0, decimal, no padding, no newline | Meaning: Try 0, 1, 2, ... as plain decimal text; take the first hit
import hashlib
base = hashlib.sha256(header) # header already ends with b"nonce: "
n = 0
while True:
h = base.copy()
h.update(str(n).encode())
d = hashlib.sha256(h.digest()).digest()
if d[:3] == b"\x00\x00\x00": # 24 leading zero bits
break
n += 1
print(n, d.hex())
Result for this generated instance (636,719 candidates tested):
That 32-byte hash is the AES key for the next step.
Note: Why this step matters: if you serialise the header slightly wrong (for example, add a newline), you will still find a nonce, but the key will be wrong and decryption will fail in Step 4. If that happens, re-check the header rules above.
The header said: seal: blCk | aes-256-cbc | key = pow hash | iv = first 16 bytes.
So, take the PNG chunk named blCk (632,896 bytes, stored before IEND). Its data is IV (16 bytes) || ciphertext. Decrypt with AES-256-CBC using the hash from Step 3 as the key. For this artifact, successful unpadding yields a 632,876-byte stereo WAV file.
import struct
from cryptography.hazmat.primitives import padding
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
png = open("block_0.png", "rb").read()
def chunks(png):
pos = 8
while pos < len(png):
ln = struct.unpack(">I", png[pos:pos+4])[0]
typ = png[pos+4:pos+8]
yield typ, png[pos+8:pos+8+ln]
if typ == b"IEND": return
pos += 12 + ln
The two other chunks (blCa and blCz) are random bytes of the same size (632,896 bytes each). Even if you didn't read the header, only blCk decrypts cleanly with valid padding.
You now have hidden.wav.
#Step 5: Listen with both ears (the Pythia's two voices)
Open hidden.wav in Audacity or Sonic Visualiser and switch to spectrogram view. You will see text. It reads:
rvcectf{n0t_d3lph1}
That is the decoy. If you look at only the left or only the right channel, the picture looks garbled, because two texts are overlapping. That is your clue that something else is layered in.
The header gave the hint: "the Pythia speaks with two voices; only one is hers".
How it was built (mid/side stereo):
mid = what both channels share (L + R): carries the decoy text, loud.
side = what differs between channels (L − R): carries the real text, quieter and in opposite phase in each channel.
To isolate it, subtract one channel from the other:
import wave, numpy as np
from scipy.signal import spectrogram
import matplotlib.pyplot as plt
w = wave.open("hidden.wav")
sr = w.getframerate()
pcm = np.frombuffer(w.readframes(w.getnframes()), dtype="<i2").reshape(-1, 2).astype(float)
L, R = pcm[:, 0], pcm[:, 1]
side = L - R
f, t, S = spectrogram(side, sr, nperseg=512, noverlap=384)
db = 10 * np.log10(S + 1e-12)
keep = f <= 3500
plt.figure(figsize=(16, 4))
plt.pcolormesh(t, f[keep], db[keep], shading="auto", cmap="magma", vmin=db.max() - 45, vmax=db.max())
plt.ylim(0, 3500)
plt.xlabel("Time (s)")
plt.ylabel("Frequency (Hz)")
plt.title("L - R: real flag")
plt.tight_layout()
plt.savefig("side.png", dpi=120)
(In Audacity you can do the same thing by splitting the stereo track, inverting one channel, and mixing both to mono.)
The generated artifact was checked end-to-end: keyed extraction recovers BLK0, the stated nonce reproduces the 24-bit proof-of-work hash, AES decryption yields a valid stereo WAV, and the L − R spectrogram is clean and readable: