Home / Work / Enigma

Enigma Machine Simulation

Enigma machine simulation
Problem

Implement the Enigma cipher machine entirely in code — encode and decode messages with specific rotor settings, and recover unknown settings from intercepted ciphertext.

Approach
  • Built rotor, reflector, and plugboard components from scratch
  • Implemented forward and reverse signal paths through the machine
  • Developed search strategies to infer settings from message pairs
Result

A working simulation capable of encrypting/decrypting messages and solving setting-recovery challenges — connecting historical cryptography to modern search and constraint problems.

Stack
  • Python
  • Custom cipher engine
  • Brute-force & heuristic search

Why this project matters

The Enigma machine is one of the most famous encryption devices in history. Rebuilding it in software forces you to understand permutation cycles, stateful rotors, and the combinatorial explosion of possible settings — the same kind of complexity that appears in modern AI search problems.

Key challenges

Getting the stepping mechanism right (where middle and left rotors advance under specific conditions) required careful state management. The setting-recovery task added a layer of search optimisation — testing candidate configurations until plaintext emerged.

View on GitHub ← All work