DL·SYS
Contact ↗

CSCTF 2026 · Misc · 166 pts

lattice.

A 'toy block cipher' with no secret key at all — every round key and S-box entry is a hardcoded constant, which makes decryption trivial once you invert each step.

Custom block cipherCipher inversion
EventCSCTF 2026, Operation Dawn (online jeopardy)
CategoryMisc
Points166
StatusSolved during the event
TargetAssigned live vault service

TL;DR. lattice.py's 16-round cipher uses only fixed, key-independent S-boxes and round keys generated from constant LCG seeds — meaning the entire cipher is fully invertible by anyone with the source, with no secret to recover at all. Decrypting the given ciphertext reveals a passphrase that the live vault service accepts.

Challenge

Recover the passphrase that unlocks a live vault service, given the vault's own cipher source and one ciphertext.

Solution

lattice.py implements a 16-round substitution-permutation cipher, but every round's S-box and round key come from fixed, key-independent LCG seeds hardcoded in the source — there's no secret key anywhere in the construction, so the cipher is fully invertible by construction, not by any weakness that needs exploiting.

Writing the inverse cipher is mechanical: reverse the 16 rounds in order, apply the inverse of each round's bit rotation, invert each round's fixed S-box, and undo each round's XOR or subtraction against the same constant round key. Decrypting the given target ciphertext this way and stripping PKCS#7 padding gives a clean passphrase, confirmed by round-tripping it back through the cipher's own encrypt function in the shipped source and getting an exact match.

Speaking that recovered passphrase to the live vault service (nc on the stated port) returns the flag.

Flag

FlagCSCTF{NKMlE6Wut9x80liStVhN2bDb}

What I took from it