{"slug": "i-built-an-on-device-solstice-engine-using-tensorflow-js-to-break-ciphers", "title": "I Built an On-Device \"Solstice Engine\" Using TensorFlow.js to Break Ciphers", "summary": "A developer built an on-device 'Solstice Engine' using TensorFlow.js to break ciphers in a browser-based puzzle game. The game, Solstice Cipher, uses real-world light levels detected via webcam to alter cryptographic logic, requiring players to physically change lighting conditions to decode messages. The project is open-source and runs entirely client-side with no backend servers.", "body_md": "*This is a submission for the June Solstice Game Jam*\n\nI wanted to build something that forces the player to look around their room, grab a flashlight, or turn on the light, and interact with the physical world!\n\n**Solstice Cipher** is an atmospheric, browser-based puzzle game inspired by Alan Turing’s legendary code-breaking machines and the beautiful transitions of the June Solstice. The game challenges players to step into the shoes of a wartime cryptanalyst to intercept and decode three hidden binary messages celebrating June milestones.\n\nJust like the solstice marks a shifting point between light and darkness, this machine’s cryptographic system alters its logic based on the *actual, real-world light in your room*. To fully break a cipher, you have to decipher cryptic riddles and physically shift your environment between Day Mode (shining a light at your webcam) and Night Mode (covering the lens) to calibrate both mechanical rotors!\n\nTake a look at the \"Solstice Engine\" in action!\n\nThe entire project is completely open-source, free, and lightweight (built using HTML, CSS, and client-side JavaScript). You can explore the repository or host your own version below:\n\nBuilding this was an absolute joy and a fun logic puzzle in its own right! I wanted to ensure the game was 100% free to run, private for the player, and required zero backend servers or complicated API keys.\n\n`navigator.mediaDevices.getUserMedia`\n\n), the app securely requests access to a localized 320x240 video matrix.`app.js`\n\nto feature persistent memory flags (`dayCalibrated`\n\nand `nightCalibrated`\n\n). Now, the engine securely holds its state when you successfully align a rotor, politely guiding you to switch from flashlight to shadow to finish the job.`style.css`\n\n) to create that clandestine, high-stakes \"secret bunker\" aesthetic.This game is an ode to the father of modern computing. Instead of a standard clicker game, the mechanics intentionally simulate the interactive physical dial-tuning of the Enigma-decrypting Bombe machines. The puzzles themselves lean heavily on binary data arrays and computational logic definitions, and the initial level unlocks a direct tribute to Turing's profound impact as both a computer science pioneer and a June Pride icon.\n\nTo drive the core mechanic without adding any friction or registration steps for players, I utilized **Google TensorFlow.js** loaded straight from a CDN.\n\nInside `app.js`\n\n, every frame from the user's webcam is treated as an active mathematical playground. The application converts frame pixels directly into data streams on the browser GPU using `tf.browser.fromPixels`\n\n. By using localized matrix mathematics with `tf.mean()`\n\n, it reads the average brightness value instantly. This turns a simple consumer webcam into a zero-latency, private, on-device environmental sensor! It shows off just how incredibly accessible, lightweight, and versatile Google's open-source AI ecosystem can be.\n\n*Thank you so much for hosting this jam! Getting to use history, AI, and creative web design to celebrate a beautiful month of milestones was an incredibly rewarding experience. Good luck to everyone participating!*", "url": "https://wpnews.pro/news/i-built-an-on-device-solstice-engine-using-tensorflow-js-to-break-ciphers", "canonical_source": "https://dev.to/hopebestworld/i-built-an-on-device-solstice-engine-using-tensorflowjs-to-break-ciphers-887", "published_at": "2026-06-21 06:10:59+00:00", "updated_at": "2026-06-21 06:36:56.752030+00:00", "lang": "en", "topics": ["artificial-intelligence", "machine-learning", "developer-tools"], "entities": ["TensorFlow.js", "Google", "Solstice Cipher", "Alan Turing"], "alternates": {"html": "https://wpnews.pro/news/i-built-an-on-device-solstice-engine-using-tensorflow-js-to-break-ciphers", "markdown": "https://wpnews.pro/news/i-built-an-on-device-solstice-engine-using-tensorflow-js-to-break-ciphers.md", "text": "https://wpnews.pro/news/i-built-an-on-device-solstice-engine-using-tensorflow-js-to-break-ciphers.txt", "jsonld": "https://wpnews.pro/news/i-built-an-on-device-solstice-engine-using-tensorflow-js-to-break-ciphers.jsonld"}}