DEV Community

Cover image for Enigma's Echo โ€” AI-Powered Cryptanalysis Console (Bletchley Park)
Mamoor Ahmad
Mamoor Ahmad Subscriber

Posted on

Enigma's Echo โ€” AI-Powered Cryptanalysis Console (Bletchley Park)

June Solstice Game Jam Submission

Enigma's Echo ๐Ÿ•ต๏ธโ€โ™‚๏ธ๐Ÿ“Ÿ

Enigma's Echo Game HUD

What I Built ๐Ÿ› ๏ธ

Enigma's Echo is an interactive, browser-based cryptanalysis simulation game set in the historic Bletchley Park (Hut 8) in 1941. The player acts as a codebreaker tasked with decrypting intercepted German transmissions. Instead of writing code or manually shifting letters, you configure the decryption machine using natural language commands which are compiled in real-time using Google's Gemini API.

The console interface mimics a vintage CRT monitor, complete with scanline filters, flickering glow effects, mechanical rotor dial animations, and dynamically synthesized typewriter sounds.

As a spiritual successor to my previous Bletchley-themed rhythm game, Turing's Frequency, this project pushes the boundaries of automated cryptanalysis. Furthermore, following my work on Planetary Pulse, I wanted to focus on creating an asset-free, purely synthesized audio and visual experience.

Connection to Theme ๐ŸŒ…

The game embraces the core themes of the June Solstice Game Jam:

  1. The June Solstice (Light vs. Dark) โ˜€๏ธ: Puzzles revolve around balancing "daylight" and "shadows." Decrypting ciphers prevents the shadows from taking over, aligning with the Solstice's celebration of peak light.
  2. Pride & Alan Turing's Birthday ๐Ÿณ๏ธโ€๐ŸŒˆ: The game is a direct tribute to Alan Turing, Bletchley Park, and the birth of modern computing.
  3. Alan Turing Legacy ๐Ÿง : Level 4 simulates a dual-rotor Enigma configuration, requiring players to set the rotor starting positions to the initials of the June Solstice (J and S for June/Solstice, representing positions 9 and 18) to decode the target ciphertext.

Demo โšก

Here is a look at the Bombe Co-Processor Logs in action during automated simulation:
Enigma's Echo Logs

Journey ๐Ÿš€

How I Built It ๐Ÿงฐ

I wanted to build a game that had zero heavy assetsโ€”no loading screens, no heavy images, and no downloaded audio files.

Integrating Google Gemini as an agent-like co-processor builds on my recent experiences working with autonomous coding workflows. In my posts I Sent One Message and 5 AI Agents Built, Audited, Tested & Deployed a Full App and AI Agents Replaced My Dev Workflow โ€” Here's What Broke, I explored the practical limits of AI delegation. Enigma's Echo shows how natural language can serve as an elegant, immediate interface for direct human-agent collaboration in high-stakes environments like decryption grids.

  • Visuals: Rendered entirely using lightweight vanilla HTML/CSS. I used HSL-tailored matrix-green themes, glowing text-shadows, radial gradients, and linear scanlines to simulate a vintage CRT screen.
  • Web Audio API Synthesis ๐ŸŽต: Rather than loading MP3 sound files, the game utilizes the browser's native Web Audio API to dynamically synthesize typewriter clicks (a noise burst + fast lowpass decay), rotor dial whirs (sawtooth frequency sweeps), and success arpeggios (C major chord progression).
  • AI Integration (Gemini 1.5 Flash) ๐Ÿค–: The core mechanic uses Google Gemini API as a natural language compiler. When the user types an instruction like "reverse the text, shift left by 3 and swap the case", the app sends it to Gemini, which returns a clean JSON instruction array: [{"type": "reverse"}, {"type": "caesar", "shift": -3}, {"type": "swapcase"}] The game's engine then processes these steps on the ciphertext, accompanied by mechanical rotor dial rotation animations.
  • Local Simulation Fallback ๐Ÿ”’: If the player does not have a Gemini API key configured, the game falls back to a regex-based pattern matching compiler. This allows the game to remain 100% playable offline or key-free while showcasing the API benefits.

Special Category Submissions ๐Ÿ†

  • Best Ode to Alan Turing: Dedicated levels representing historical ciphers (Caesar, Vigenรจre) culminating in a simulated two-rotor Enigma machine deciphering "TURING TEST".
  • Best Google AI Usage: The project uses the Gemini API as a functional compiler, showing how large language models can translate unstructured human phrasing directly into executable mechanical pipelines.

Link to Source Code ๐Ÿ“‚


๐Ÿ“– Check out my other articles:

Top comments (0)