{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreieazbf6wsh6a4nqvy3pobaggy3hetzn7s5aacamrkfdo275ovpayu",
    "uri": "at://did:plc:25rdn5elo5izoxrmtis34zuk/app.bsky.feed.post/3mosw7yxnuxe2"
  },
  "coverImage": {
    "$type": "blob",
    "ref": {
      "$link": "bafkreibhpcvlotk3jt3xanq3ag2pl5bcfbddh3a4w7t6naq3xpqyo4qhyu"
    },
    "mimeType": "image/webp",
    "size": 74760
  },
  "path": "/georgpiwonka/turings-last-cipher-decrypt-a-message-no-one-ever-actually-wrote-506a",
  "publishedAt": "2026-06-21T17:20:44.000Z",
  "site": "https://dev.to",
  "tags": [
    "devchallenge",
    "gamechallenge",
    "gamedev",
    "June Solstice Game Jam",
    "https://turings-last-cipher-336966558985.us-central1.run.app",
    "https://github.com/gpiwonka/turings-last-cipher",
    "https://youtu.be/vWUti1cqmK4"
  ],
  "textContent": "_This is a submission for the June Solstice Game Jam_\n\n##  What I built\n\n**Turing's Last Cipher** is a text-based cipher/puzzle adventure. A plain envelope arrives,\npostmarked June 21st, full of jumbled letters and one typed line: _\"For whoever still cares to\nlisten. — A.T.\"_ Your terminal blinks awake, an AI assistant introduces itself, and together\nyou start decrypting what Alan Turing supposedly never finished saying.\n\nYou solve real ciphers — Caesar, Atbash, Vigenère, a dial-it-yourself Enigma — across four\nchapters. But the assistant helping you is not as steady as it first seems. Its hints get\nslippery. It starts to mislead. And by the end you learn why: **these messages were never\nwritten by Turing.** They were generated by a modern AI reconstructing him. The closing\nquestion mirrors the Turing Test in reverse — _if an AI can reproduce every thought of a person,\nis it that person?_\n\n**▶ Play it now (Cloud Run):** https://turings-last-cipher-336966558985.us-central1.run.app\n**Source (MIT):** https://github.com/gpiwonka/turings-last-cipher\n\n> _[https://youtu.be/vWUti1cqmK4]_\n\n##  The four chapters\n\n  1. **Classical ciphers** — Caesar → Atbash → Vigenère. The assistant is honest and genuinely helpful. You learn to trust it.\n  2. **Enigma-lite** — solved with an in-game Enigma you actually dial: historical rotor wirings, reflector, plugboard, ring settings. The secret ring settings stay on the server; you find the rotor start positions yourself.\n  3. **Trust erosion** — a substitution puzzle where the assistant starts steering you wrong. The game never lets a lie make a puzzle unsolvable — a deterministic path to the answer always remains — but you stop taking its word for things.\n  4. **The twist ending** — and the question it leaves you with.\n\n\n\n##  Categories I'm claiming\n\n**🏳️‍🌈 Overall / Best Ode to Alan Turing.** Turing isn't set dressing here — he's in both the\n_mechanics_ and the _narrative_. You break the same families of ciphers he worked with, you\noperate an Enigma, and the entire story is an argument about the Turing Test. I tried to handle\nhis biography — the persecution, the conviction, the loss — with dignity, because that grief is\nthe emotional core of the ending, not a gimmick.\n\n**🤖 Best Google AI Usage.** The in-game assistant's hints and dialogue are rendered live by the\n**Gemini API** (`gemini-2.5-flash`), and the whole thing is deployed on **Google Cloud Run**.\nThe interesting part is _how_ the AI is used — see below.\n\n##  How the AI is used (and how it is deliberately constrained)\n\nThe twist of the game is an unreliable AI, so the engineering question was: _how do you let a\nlanguage model voice an untrustworthy narrator without letting it break the puzzle?_\n\nMy rule was a hard separation between **truth** and **wording** :\n\n  * **Ciphers are deterministic C#. The LLM never performs crypto.** Encryption, decryption, and answer-checking live in a pure, fully unit-tested `Core` library. LLMs corrupt character-level crypto, so they're simply not allowed near it.\n  * **Truth lives in code, never in the model.** Every puzzle has a known plaintext; a deterministic oracle is the _only_ authority on whether you solved it.\n  * **The \"unreliable AI\" is scripted game logic.** The _server_ decides, per scene, whether the assistant is Truthful, Misleading, or Withholding (trust erodes chapter by chapter). Gemini only phrases the line under that policy.\n  * **The prompt never contains the plaintext.** It gets the cipher name, the genuine hint, and the policy — so a rendered hint can't leak the answer, and a _misleading_ hint can't block you (the cipher plus a frequency-analysis tool always give a path through).\n  * **The API key never reaches the client** , and if Gemini is unavailable the game falls back to static per-policy text — so it's **fully playable offline** , which matters when judges have flaky networks.\n\n\n\nSo Gemini does exactly what a language model is good at (voice, flavor, character) and nothing\nit's bad at (being the source of truth).\n\n##  How it's made\n\n  * **Blazor WebAssembly** client + **ASP.NET Core (.NET 9)** Minimal API, in a **single container**. The API hosts the WASM client and exposes `/api/*`. Blazor _WASM_ (not Server) was deliberate — it avoids a persistent SignalR circuit, which is fragile on Cloud Run's scale-to-zero.\n  * **Stateless server.** The client tracks the current scene id; the server is the authority for solution checking and never sends plaintext to the client.\n  * **Content-driven story graph** (`content/scenes/story.json`) with a startup validator that catches dangling links and unsolvable puzzles before shipping.\n  * **Deployed to Google Cloud Run** from a multi-stage `Dockerfile`; the server honors the injected `PORT`.\n\n\n\n##  Disclosure\n\n  * Built **from scratch during the jam**. No prior game code reused.\n  * **AI-assisted development** : I used Claude Code as a pair programmer for scaffolding, infrastructure, and review. All design decisions and the cipher/oracle invariants are my own.\n  * **Gemini** generates only in-game _wording_ (assistant hints and dialogue) — never puzzle state, gates, or correctness. Any flavor text baked into the story was finalized and stored before encryption, never generated live.\n  * Licensed **MIT**.\n\n\n\n##  Reflection\n\nThe thing I'm proudest of is that the unreliable-narrator twist is also the _architecture_ : the\ngame is, at every level, about an AI that can sound exactly like a trustworthy source while not\nbeing one — and the code is built so that the model is allowed to _sound_ like anything while\nthe truth stays provably elsewhere. That separation is the whole point of the Turing Test, and\nit turned out to be the whole point of the build too.\n\nThanks for reading — and for playing. Decrypt carefully.",
  "title": "Turing's Last Cipher — decrypt a message no one ever actually wrote"
}