# (E-4)   Wiring Puzzles and the "Enigma"

Here is the circuit with 3-way switches:

If connection to the "hot" wire exists and the lamp is lit, clicking either switch breaks it.

If no connection exists between the "hot" wire and the lamp (which is therefore turned off), clicking either switch establishes it.

Here is the circuit using five 4-way switches:

Each square represents a 4-way switch wired to reverse the connection between input and utput. The "hot" wire enters on the left and the last wire connects to the "hot" side of the lamp; the return wire is connected directly to the lamp at all times.

Assume you are dealing with a DC circuit, and the "hot" wire (or + polarity) entering on the left is the one on top. Each reversing switch may or may not reverse the electric polarity. The lamp will be lit if the last wire, leading to it, also has "+" polarity. Otherwise, it will be turned off.

Flipping any switch reverses all polarities between it and the lamp. If the lamp was connected to the "+", it will now no longer be. If it was NOT connected to the "+", it will be now.

Note that the last and first switch do not use one of their input sides. They may thus be replaced by 3-way switches.

## The Enigma Code Machine            (Optional)

Note to user: This section contains only one illustration, but many more, with a comprehensive explanation and history, can be found in the Wikipedia article "Enigma Machine", also article by Andy Carlson here

More elaborate switches can also be designed, giving the current more than two choices. Switches with 26 choices, each corresponding to some letter of the alphabet, were behind the famous "Enigma" coding machine used by the German armed forces in World War II.

At the heart of the "Enigma" was a set of disks (or "rotors") able to rotate around a common shaft, each with 26 matching metal contacts circling the center, on the front and on the back of the disk. The contacts could be labeled A, B, C... Y, Z, one for each letter of the alphabet, and each was capable of making an electrical connection with whatever contact was facing it. The machine had a keyboard like a typewriter, and also a set of 26 lightbulbs.

When the operator pressed the key "K" (say), the source voltage was connected to the contact on the first disk corresponding to "K". The contact at the back of the disk would then connect the corresponding contact on the second disk, and from there the voltage would be passed to the contact on the third disk (a 4th disk was later installed too, to make the encoding even more secure).

In the back of the machine was a "plugboard" of scrambling wires, which fed back the signal through the same disk in some different place. If one pressed key K, for instance, the plugboard would return the current through the three disks in reverse order, reaching the contact of the letter "D", and the "D" lighbulb at that point would glow. (Pressing key K had automatically disconnected the "K" lightbulb, so it stayed dark).

At this stage, all this would produce would be a simple substitution code--"D" for "K", "Q" for "E" and so forth, depending on the setting of the plugs. Such codes are easily broken.

But there was much more: inside each of the disks, hidden from view, were wires that routed the power from each input contact to some other contact on the output side. So if "K" was pressed, the current may emerge from the "M" contact on the other side, the plugs might feed it back to "C" of the second disk, and it might be further scrambled by the wires inside that disk to "F", and so one. The third disk added another scrambling, so did the plugboard, and the connections were further scrambled on their way back--throught the 3rd, then 2n, then 1st disk, to a set of lamps labeled with letters A, B, C ,,, Z. An diagram of such scrambling is at the top of a long web article by Andy Carlson, which describes the machine and its history in much more detail than the brief overview given here.

So far, all this still produces a very elaborately hidden simple substitution code. What set the "Enigma" apart was that on the outside edge of each disk were 26 "teeth" or cogs, driven by a small extra gear like the cogwheels of a car's mile counter. If the wheels in a mile counter on a car engaged each other, they would rotate in opposite directions (besides problems of display). With an extra small gear engaging each pair of neighbors, they rotate in the same direction.

Each rotor had two gear wheels, on opposite faces: one face had a full set of 26 cogs, one for every letter, the other (which faced the preceding rotor) only one. It therefore took a full revolution of one disk to advance the next one by just one notch. In a mile meter, each full set of cogs has 10 teeth, so for each 10 miles, the counter of the "tens" advances one step. That wheel again has 10 cogs on its other side, turning (by means of a small connecting gear) a single cog on the "hundreds" dial, and do on.

In the "Enigma", each "rotor" had 26 cogs. Every time a letter was encoded, the first disk would advance one cog; every time the first disk completed a full turn, the next disk would advance one spot, and so on. Whatever the initial setting of the wheels was, it never (in practice) repeated itself

On the web you can find a Three Rotor Enigma Simulation in several languages, showing the intricate path of each encoding signal (the "Help" file there leads to further details). The arrows allow you to change the initial settings of the rotors, and you can drag reflector connections to new positions. Copy the encoded message, reset the rotors to the same initial positions and enter the encryption: the plain text then appears below.

The initial setting of the wheels (done by hand differently each day) was all important, for it decided all later settings in sequence. And the connections between key and lamp were symmetric: if on step 526 (say) key "A" connected to lamp "S", the two were connected by a complex electric path, and the same path would be traced in the opposite direction, too--key "S" would activate lamp "A". This way, when the encrypted message was typed on another Enigma machine at the receiving end with the same settings, the lights would spell out the hidden message and decode it.

This machine was invented in 1923 by Arthur Scherbius in Germany and was sold for encrypting business communications. The German army adopted it and modified it, but incredibly, Polish mathematicians (led by Marian Rajevski) developed a method for unscrambling its messages, helped by a German agent who provided some disks.

Just before the invasion of Poland by Germany in 1939, the Poles made their achievements available to France and Great Britain (including the "Bomba" sorting machine for decrypting the code, and reconstructed Enigma machines). The Germans kept modifying the code, and used it widely. In particular, one improved variant was used to communicate to submarines at sea, which around 1941 almost broke all shipping links to Britain. For instance, the code could direct subs to where supply convoys from Canada and the USA might pass, based on observations by submarines, airplanes and agents. If the allies could read such messages, ships could be diverted to different routes, and all the subs would find would be an empty sea, or perhaps a sub-hunting frigate.

The initial setting of the rotors was changed every day, so it was essential not just to break the code, but to do so quickly. A British team addressed the problem--headed by Alan Turing, a math genius, using the Polish methods, a supporting crew of experienced cryptologists, clever guesses and the (very rare) capture of disks from submarines. It just barely managed to keep ahead of the game, but it did decode many messages. At a certain point the Germans expanded the machine by providing a 4th disk, and more choices of disks. The US was by then in the war (and losing many ships to German submarines), but a large number of modified bigger "Bombas" installed in Washington managed to continue breaking the code

It is a fascinating story with many twists and turns, and interesting books exist about it. "Enigma: The Battle for the Code" by Hugh Sebag-Montefiore is highly recommended, though it can be technical in spots.

### Note:

If you visit the area of Washington, DC, you might visit the free National Cryptology Museum maintained by the National Security Agency (NSA), about halfway between Washington and Baltimore. It is located east of the Washington Baltimore Parkway (Gladys Spellman Parkway) and is reached by taking the exit to Md. Rte. 32 East and then following the marked route to the museum (a former motel overlooking the parkway), through a parking lot and next to a parked transport plane.

Allow yourself plenty of time to view the many unique exhibits; NSA veterans sometimes serve as guides, and may have stories to tell. The catch is--it is only open on weekdays during working hours, or on the first and 3rd Saturday of the month. You will be able to operate an Enigma machine, view the "Bomba" and much more.

For a free copy of the booklet "Solving the Enigma: History of the Cryptanalytic Bombe" by Jennifer Wilcox, write to the Center for Cryptologic History. NSA, 9800 Savage Road, Suite 6886, Fort George G. Meade, MD 20755-6886, USA.

Back to E3: Electric circuits
Next Stop: E5.   Resistor Networks-1

Home Page "All Things Electric and Magnetic"
"From Stargazers to Starships"
Timeline of "All Things Electric and Magnetic"
Timeline (from "Stargazers")
Master index file

Author and Curator:   Dr. David P. Stern
Mail to Dr.Stern:   stargaze("at" symbol)phy6.org .

Last updated: 2 July 2010

# Above is background material for archival reference only.

NASA Official: Adam Szabo

Curators: Robert Candey, Alex Young, Tamara Kovalick