Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 2 min read

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

Enigma's Echo πŸ•΅οΈβ€β™‚οΈπŸ“Ÿ 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

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

Enigma's Echo πŸ•΅οΈβ€β™‚οΈπŸ“Ÿ

Enigma's Echo Console

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 ⚑

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.

  • 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 πŸ“‚

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.