Death Certificate a "one-way" seal that's secretly an affine XOR mask

crypto
flag RxR{97c2496c-c106-45d7-a1f2-07cc8af61f97}

Two forms and a fixed certificate on file. The on-file certificate is 29 bytes - "The Reaper is ALIVE and well." - sealed with what the page's own HTML comment calls SHA-256(key || text) truncated to 128 bits, "and therefore one-way." The night clerk stamps any 29-byte text you bring him, as long as it doesn't declare the Reaper dead. The vault wants a 29-byte certificate declaring the Reaper DEAD, carrying a seal that verifies - the one input the clerk refuses to sign.

Insight

Taken at face value, that's a wall: length extension on a truncated Merkle-Damgård hash leaves you guessing 128 bits of internal state, no preimage route. So I didn't take it at face value - I stamped the certificate unchanged, then again with one letter recased (ALIVE -> Alive, 0x4C -> 0x6C), and diffed the two seals.

output
The Reaper is ALIVE and well.   ae1262e87f84d80877bdaca8813ae208
The Reaper is Alive and well.   ae1262e97d80d00877bdaca9833eea08

Eight of 32 hex digits moved - and how they moved is the tell. Reading the changed nibbles in order: 8->9 (+1), f->d (-2), 4->0 (-4), 8->0 (-8), mirrored in the second half as +1, +2, +4, +8. A hash diffuses; this is doing arithmetic. The fingerprint isn't one-way, it's linear, and the +1/+2/+4/+8 ladder is the signature of a per-bit XOR mask sliding one bit per input bit.

Pinning it down

The forms take raw bytes as hex, so clean probes are possible. Baseline seal(0) on 29 zero bytes, then for each position i and bit b, stamp a text that's all zero except byte i set to 1<<b, and XOR the result against seal(0) - 29*8 = 232 stamps, none declaring anyone dead, so the clerk happily signs all of them.

Insight

Every contribution comes back as a 128-bit value with exactly two bits set, 64 apart - low index (4 - 7*i + b) mod 64, high index that plus 64. The whole seal is an affine map over GF(2): for every set bit of every byte, XOR one 128-bit mask whose single low-half bit mirrors into the high half, sliding with the byte index. Nothing here is one-way. There's no key to find and no hash to invert - there's one matrix.

output
seal(t) = C XOR XOR_over(i,b set in t[i]) of (1<<((4-7i+b) mod 64)) | (1<<(((4-7i+b) mod 64)+64))

Two spot checks (value 0x03 at position 0, 0xFF at position 5) matched the model exactly, and five fresh random 29-byte texts, predicted purely from the recovered contributions, matched what the clerk actually stamped.

The forge

The vault's own example text is already a 29-byte certificate declaring the Reaper dead, and differs from the on-file one only across the same ALIVE/DEAD, span: "The Reaper is DEAD, and well." Linear-combining its per-bit contributions gives the seal it "cannot have":

output
target : The Reaper is DEAD, and well.
forged : ae1262fc3706824877bdacbcc9b8b848

Submit it:

output
The seal holds. The Reaper is pronounced dead. Vault open:
RxR{97c2496c-c106-45d7-a1f2-07cc8af61f97}

Insight

The clerk's refusal to stamp "dead" texts is a decoy - you never need him to sign the dead certificate, only the 232 clean probes that let you compute its seal yourself. The "one-way SHA-256" note is the other half of the same trick: the diffusion you'd expect from that construction simply isn't there.

solve.py runs the whole thing end to end: baseline stamp, 232 basis stamps, model validation on random texts, forge, submit.

Flag

output
RxR{97c2496c-c106-45d7-a1f2-07cc8af61f97}