Problem Statement
Devise a mechanism for encoding secret messages of at least 8 characters in the board state of a board game of your choice.
Requirements:
- Must encode messages ≥8 characters using a board game state
- Can use any board game (chess, checkers, tic-tac-toe, etc.)
- Can use sequential board states for games with limited states
- Board states don't need to be legal game positions
- Should include both encoding and decoding mechanisms
Evaluation Criteria:
- Creativity in cipher design
- Implementation completeness
- Code quality and readability
- User interface (if applicable)
- Originality of the solution
Our Solution: Tic-Tac-Cipher
We've created an advanced cipher that uses Tic-Tac-Toe board states to encode messages with multiple encoding modes and optional encryption.
Key Features:
- Multiple Encoding Modes: Basic, Positional, and Alternating Player
- XOR Encryption: Optional encryption with a secret key
- Visual Board Display: See the encoded boards
- Auto-Detection: Decoder can detect encoding mode
- Responsive Design: Works on all devices
- Complete Implementation: Full encoder/decoder in one page

Team
Developed by Hifza Khalid for the Stack Overflow Code Challenge
Technical Details
Encoding Process
Decoding
Process
Security
Message Encoding Steps:
- Message is optionally encrypted with XOR cipher if key is provided
- Convert message to binary (UTF-8 encoding)
- Split binary into 9-bit chunks (one per Tic-Tac-Toe board)
- Apply selected encoding mode:
- Basic: X=1, O=0
- Positional: Bit position determines board position
- Alternating: Changes starting player each board
- Generate visual board representation
- Output board states as text
Message Decoding Steps:
- Parse input board states (one per line)
- Detect or select encoding mode
- Convert each board back to binary:
- Basic: X→1, O→0
- Positional: Board position determines bit position
- Alternating: Starting player determines bit value
- Combine all bits and split into 8-bit bytes
- Convert bytes to characters (UTF-8)
- Decrypt with XOR cipher if key was used
Security Considerations:
- Basic mode is simple and easy to detect
- Positional encoding makes patterns harder to recognize
- Alternating player adds variability between boards
- XOR encryption provides basic security when a key is used
- For stronger security, combine positional encoding with encryption
- Not suitable for high-security applications without additional layers