// the find
mikepound/enigma
A java implementation of Enigma, and a modern attack to decrypt it.
A Java implementation of the Enigma cipher machine paired with a ciphertext-only attack based on hill climbing and n-gram fitness functions. Built as a companion to a Computerphile video, so the primary audience is people who just watched that video and want to run the code themselves. Not a production cryptography library.
The attack pipeline is cleanly separated into three stages — rotor enumeration, ring setting search, plugboard hill climbing — which maps directly to how real Bombe attacks were structured and makes the algorithm easy to follow. Multiple fitness functions are provided (IoC, bigrams through quadgrams, known-plaintext) and the README is honest about which work better at which stage, which is more useful than most tutorial code. An optimised multi-threaded branch exists that reportedly breaks messages in under 4 seconds, and the author kept it separate rather than muddying the pedagogical main branch. The enigma simulation itself correctly implements double-stepping, which most hobbyist implementations get wrong.
No build system — you hand-compile with javac and manually copy resource files, which means zero dependency management and a brittle setup for anyone not using IntelliJ. The attack only handles 3-rotor Wehrmacht/Luftwaffe Enigma; naval 4-rotor Enigma is explicitly unimplemented and adding it would require meaningful rework, not just adding a rotor definition. No command-line argument parsing means you edit Main.java source to change settings, which is fine for a tutorial but makes it useless as a reusable tool. Last touched May 2022 with no active maintenance, so issues and PRs sit unanswered.