Part of the World War II Cryptographic Simulation

Japanese point of view:
The system used to protect our diplomatic messages operates on an interesting system. It is similar to the rotor machines used by many other countries--including our German allies--but, instead of rotors, uses common telephone switches. These switches each have 6 inputs and are connected in banks to act as one big system. Our first system to utilize these switches, the 97-shiki o-bun in-ji-ki, had 3 banks of 4 rotors each and a single switch used to encipher the remaining 6 letters. Each switch in a bank had 5 inputs receiving letters, the one remaining input being used to keep all 4 switches in sequence. Each input is then connected to a wiper that has 25 different contacts. Each contact represents a completely different alphabet. Every time a letter is enciphered, the wipers in one bank step forward to the next contact. When they reach the 25th contact, they spring back to the first one. Twenty letters are enciphered through three connected banks such as this. The remaining six letters are enciphered through a single switch. This is the greatest weakness of the machine. In addition to this, there is a plugboard between both the input typewriter and the output typewriter.

Mathematically this can be thought of as three 20 wide by 25 long matrices.
        25 
   X S I I X Q X D S 
2  P N L H D O P N O 
0  H O S S X Z O V N 
   Z A I W G M I V T 

As each bank of switches is incremented along, a different alphabet is used. The remaining switch is simply a 6 wide 25 long matrix.

As time has progressed we have realized the inherent flaws in this machine and moved on to two better machines. Our present machine, JADE, uses several banks of five linked switches. This means that the division of the alphabet into a set of 20 and a set of 6 that so weakened the previous machine has been eliminated.
United States Point of view:
Our best cryptologist, William Friedman, led the effort against PURPLE. We broke it in the middle of 1940, just over a year after it was first used. The PURPLE uses banks of linked telephone switches to encipher a main group of 20 letters and a single switch to encipher the remaining 6 letters. Each switch has 6 separate inputs which are connected to a separate 'wiper'. Each wiper is capable of using one of 25 contacts, each representing a separate enciphering alphabet. The wipers are incremented through the 25 contacts, using a separate alphabet for each of the possible positions. All the wipers in a bank move in unison. This is why each switch only uses 5 of its 6 inputs. The other input is used to keep the bank in unison. Each bank is incremented like an odometer. After the first bank reaches its 25th position, it jumps back to the first position and increments the second bank by one. In addition, the message goes through a different plugboard both before and after encipherment.

While extremely complicated, this system was cracked quickly for a number of reasons. First, the Japanese did not manufacture the new machines very quickly. This meant that they enciphered messages in both the new PURPLE and the old machine RED. We had cracked RED several years earlier, giving us 'cribs' of plaintext and text enciphered using PURPLE. Second, the division of the alphabet into a group of 20 letters that was heavily scrambled and a group of 6 that would repeat on every 25th letter gave us another advantage. The Japanese tended to use highly formal and regular language, such as 'I have the honor to inform your Excellency', throughout their messages. This gave us additional cribs to compare against PURPLE encoded text. Finally, it was discovered that the daily settings used on the PURPLE used a pattern for a week before being changed again. This meant that we only had to break the key once every seven days to decipher traffic for a week.