Wordle Encoder: The CamHack Enigma


Inspiration

Our project was inspired by two key concepts: the ubiquitous, daily routine of Wordle and the classic principles of steganography. We realized that a shared Wordle result—a harmless, six-word grid—is the perfect vehicle for a secret message. Our goal was simple: to transform an ordinary, visible game log into a modern-day Enigma machine.

What It Does

The Wordle Encoder is a cryptographic tool that secretly encodes an arbitrary text message into a perfectly valid Wordle game solution (an answer word and six guess words).

The system performs three primary functions:

  • Encoding: It converts a text message into a list of JSON objects, each representing one complete Wordle puzzle.
  • Covert Communication: This list can be shared publicly (e.g., posted on Discord or shared via email), appearing to be nothing more than a person sharing their game log.
  • Decoding: The receiver reconstructs the $30$-trit color pattern from the log and uses the shared, fixed Static base-3 Huffman codebook and abbreviation rules to reliably decode the original message.

The key technical function is to efficiently solve a constrained search problem to generate a matching Wordle scenario for the required data block.

How We Built It

The system uses a three-step process that reverses the core logic of Wordle.

1. Data Compression

To maximize the data packed into $30$ \textbf{trits} (Base-3 digits) per puzzle, we used two compression layers. First, Abbreviation eliminates redundant characters, like vowels in longer words, saving about $\sim 26\%$ of the required Wordle puzzles. Second, Ternary Huffman Coding assigns the shortest base-$3$ codes ($0, 1, 2$) to the most common characters, minimizing the overall length of the data string.

2. Base-3 Conversion $&$ Color Mapping

The compressed message becomes a long sequence of base-$3$ digits (trits). This sequence is chunked into $30$-trit blocks (since $6 \text{ guesses} \times 5 \text{ letters} = 30$ feedback squares). Each trit is mapped directly to a Wordle color feedback for the solver: $$ 0 \rightarrow \text{Grey}, \quad 1 \rightarrow \text{Yellow}, \quad 2 \rightarrow \text{Green} $$

3. The Reverse-Engineering Solver (The Heart of the Hack)

Given a target $30$-color feedback pattern, the solver must find the one answer word and six guesses that generate the exact pattern. We crushed the slow, $\sim 15$-second brute-force time by utilizing two key techniques. Precomputed Indexing and Caching allows for instant lookups, and Intelligent Backtracking is employed as a constrained search algorithm that aggressively prunes the search space, leading to sub-second encoding times.

Challenges We Ran Into

The most significant challenge was optimizing the Reverse-Engineering Solver. The initial brute-force approach was too slow for a live demo, requiring $\sim 15$ seconds per game. The difficulty lies in the complexity of the Wordle evaluation function and how it handles duplicate letters; this complexity makes the reverse-engineering search a massive and highly constrained combinatorial problem.

Accomplishments We're Proud Of

We are most proud of achieving Sub-Second Encoding through the implementation of our custom optimization algorithms (Intelligent Backtracking and Caching). This performance leap made the system practical and highly impressive. We successfully delivered a Fully Functional Steganographic Tool where the output is mathematically verified to be a valid, yet covert, game log.

What We Learned

We gained deep expertise in several areas: Ternary Huffman Coding, including the necessary data structures for generating a static base-3 codebook; Constrained Search and Pruning, mastering advanced algorithm design to solve complex inverse problems; and the granular rules of The Nuances of the Wordle Evaluation Algorithm.

Built With

Share this project:

Updates