Search › A-Z › B › Bombe

Bombe

1940 Open source · CC0 Online

The bombe was the machine that made Enigma readable on an industrial scale at Bletchley Park. Designed by Alan Turing and improved by Gordon Welchman's diagonal board, it was built by the British Tabulating Machine Company under Harold Keen. This is an original model written from scratch for emulators.org. It does the job for real: it builds a menu from a crib, turns its drums, works out where the voltage goes among the 676 wires at each position, and stops when it fails to reach all 26 wires of the test register. No answer is stored anywhere in it.

By default it attacks a real signal from 1941, knowing only the cipher text and a 16-letter crib, through all 60 wheel orders. It comes up with more than a hundred stops, checks each one, throws out the false ones, follows the good one to the rings and plugs, and sets the key on the Enigma here to type the whole message, which comes out as the published decrypt. Other configurations run the wartime training menu demonstrated on the rebuilt bombe at Bletchley Park, and a fresh random key each time. The diagonal board can be taken out, to see why it mattered.

Runs on: Web browser

Bombe Online Emulator

Play Bombe using JavaScript directly in your browser.

Configurations

ConfigurationEmulatorMachineOSLegal
Operation Barbarossa signal, all 60 wheel ordersBombeBombeopenOpen ⛶
Bletchley Park demonstration menu, WETTERVORHERSAGEBombeBombeopenOpen ⛶
A new random key each timeBombeBombeopenOpen ⛶

Machines emulated

Notes

Embedding

The machine is written from scratch in plain JavaScript, on the same wheel tables as the Enigma here. bombe.js is the machine, bombe-check.js is what happened after a stop, and bombe-panel.js draws it. The core runs on its own, including under Node:

var b = new Bombe({ crib:'WETTERVORHERSAGE', cipher:'SNMKGGSTZZUGARLV',
  orders:[['II','V','III']], test:'G', input:'A' });
var stop;
while (!b.s[Bombe.S.DONE]) {
  stop = b.advance();                     // one drum position, tested
  if (stop) BombeCheck.checkStop(b, stop);  // the checking machine
}
MemberWhat it does
Bombe.buildMenu(crib, cipher)The menu: the largest connected web of letter pairs, its loops, and any crash where a letter would encipher to itself.
Bombe.wheelOrders(set)Every wheel order from a set of wheels, in the order they are run.
advance()One position, and its test. Returns the stop, or null.
wires()The 676 wires at this position, moving nothing.
BombeCheck.checkStop(b, stop)Deduces the plugs from the stop. A contradiction makes it false.
BombeCheck.solve(b, stop, check, cipher)Finds the rings and the remaining plugs, and types the message on a real Enigma.

On the page, window.EMU_BOOT.mach is the machine and window.EMU_BOOT.app the panel.

Debugger integration

The debugger was built for CPUs and the bombe has none, so this is how the machine maps onto it.

  • Registers are the three indicator drums (00 = A), the wheels on each shaft as a row of the wiring table, which wheel order of the job this is, the test register's cable and input wire, its live count, and the stops so far. The flag DB is the diagonal board and EN the end of the job. The drums, the register and the diagonal board can be written, and doing so re-tests the position.
  • The program counter is the drums as a count from ZZZ, top drum in the low digit, so each advance adds 1: 0 is ZZZ, 1 is AZZ.
  • Single step is one drum advance and its test. The frame Step is one full turn of the top drum, 26 advances.
  • Execution breakpoints are drum positions in the run. The machine holds when the drums arrive at one, once for each wheel order, after that position's test. Register conditions work on TOP, MID, BOT, POS, LIVE, STOPS and ORDER, so LIVE < $1A holds at any stop, and ORDER == $14 waits for the 21st wheel order, II IV V.
  • Watchpoints fire on writes to the state: drums $00-02, wheels $03-05, wheel order $06-07, live count $0B, stops $0C-0D. A watchpoint on the bottom drum fires once every 676 positions. A read watchpoint never fires: nothing in the machine reads this memory the way a CPU would.
  • Memory has five views. Bombe state is the bytes above and can be written. Drum positions lists every position with what its test register would read; click a row to set a breakpoint. It is worked out when drawn, so it can show a stop before the machine gets there, which a real machine could not. Menu, The 676 wires and Wiring tables also read without side effects.
  • Held by the debugger, the drums simply do not move. The hold between a stop and the operator restarting the machine is the panel's own and is not a pause.

Architecture

The problem. Enigma's plugboard gave about 150 million million ways to wire ten cables, far too many to try. Alan Turing's idea was to attack the rotors alone, using a crib: a guess at some plain text, lined up against the cipher text where no letter falls on itself. Each pair of letters says that some scrambler position joins the plug partners of those two letters. Gordon Welchman's diagonal board then made it work with far weaker cribs. The British Tabulating Machine Company at Letchworth built the machines, under Harold Keen; the first, Victory, arrived in March 1940, and the diagonal board followed that August.

The machine. A letter on the menu is a 26-way cable. A scrambler, which is three drums and a reflector with no plugboard, joins two cables wire by wire according to its position. The top drums turn together, and carry to the middle drums every 26 positions and on to the bottom drums every 676. The drums on one scrambler stay offset along the crib by their menu position, on the bottom drum, which stands for Enigma's fast right rotor. The diagonal board joins wire b of cable A to wire a of cable B everywhere, because a plug connection is mutual.

What a voltage means. A voltage on one wire of the test letter's cable is a hypothesis: this letter is plugged to that one. Everything that follows from it is connected electrically, so one false hypothesis spreads to all the others, and at a wrong position all 26 wires of the test cable go live. If they do not, the machine stops. At the right position there are two cases: if the guess was wrong, 25 wires are live and the dead one is the true partner, and if it was right, just one is. This model works out which of the 676 wires the voltage reaches, at each position. There is nothing else in it to find a stop with.

After a stop. A stop gives a wheel order, three core positions and one plug. The rest was handwork, done here in order. The plug is followed through the crib to deduce other plugs, as on a checking machine, which is an Enigma with no stepping; two letters wanting one partner makes the stop false. Then the rings are found: the bombe does not know them, only where each core stands, and only the turnover shows them, so each is tried against the message. Then the remaining plugs are tried in the same way. Then the whole key goes on the Enigma model and the cipher text is typed. At Bletchley people read the result. Here a German letter and word score does the reading for the ring and plug searches, which is a modern stand-in. It knows ordinary German and signals vocabulary and nothing about any particular message.

The configurations.

  • Operation Barbarossa takes the first 16 letters of the 1941 signal as a crib, and runs the 60 wheel orders from five wheels in turn, with no hint of the right one. By the 21st, II IV V, it has stopped 127 times, about six times per wheel order, and 126 of those are thrown out by the check; Run carries on through all 60, for 409 stops in all, and none of the others survives. The good stop gives the published plugs, the right rotor's published ring, and the signal, letter for letter. The left and middle rings do not show in this signal, because no turnover depends on them, so they read as A, and the core positions are compared with the published key instead. Taking the first 16 letters as the crib is a modern convenience: nobody at Bletchley would have known that opening in advance.
  • The Bletchley Park demonstration is the wartime training menu run on the rebuilt bombe and described by Frank Carter, from the crib WETTERVORHERSAGE: 13 of its 16 letter pairs in one web, with the test register on G and the voltage on A, wheels II V III. As he reports, it gives two stops, one false, and the good one gives G/Q; following it gives his other plugs exactly, A/D E/T H/M L/J N/V U/F Z/P with R, S and W unplugged, and X/O and I/K from the pairs left out of the menu. Carter prints the core start as DKX. That does not decipher his crib on a standard Enigma with rings at ZZZ; ULA does, with exactly his plugs, and it is the only one of the 17,576 positions that does. So the indicator here reads ULA, and we do not know the reason for the difference.
  • A new key every time draws a random key when the page loads, and enciphers a weather report written for this site. The key stays hidden from the machine and is shown only for comparison at the end. The right rotor starts just past its notch, so that no turnover falls inside the 24-letter crib.

The menu builder was also checked against the worked example in the Wikipedia article on the bombe: ATTACKATDAWN over WSNPNLKLSTCS gives its menu with three loops.

Faithful and not. The wires, the drums' gearing and the stop rule are as described by Carter, Ellsbury and Tony Sale. Carter gives the stop rule as fewer than 26 live, and Welchman and Sale mention only the 1 and 25 cases; this follows Carter, and the rare others are checked candidate by candidate. A run here is limited by your processor rather than by a motor. The 120 rpm speed setting turns the top drum at the speed of the later machines, 52 positions a second. Not modelled: the direction the drums actually turned, and the reversed scale on the indicator drums (the letter shown is the letter they read); the relays' timing and the overrun when stopping; the machine gun; the banks as separate parallel runs (one wheel order runs at a time, and a menu longer than twelve simply takes more of the 36 scramblers); four-rotor bombes; and a turnover inside the crib, which ruins a menu here as it did there.