If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:10:01

Video transcript

on August 5th 1857 a 4,300 kilometer long cable was laid across the Atlantic Ocean it provided a link between Britain and the Americas further strengthening their social and economic alliances now information could be represented as a pattern of electrical pulses and sent across the world almost instantaneously stock tickers and money transfers these were commercial applications invented by Western Union which ushered in a new era of global communication stand by for this announcement Germany has invaded Poland and has bombed Bonita general mobilization has been ordered in Britain and France and consequently this country is at war with Germany the world which is the real cause of the war that today threatens the freedom of mankind Edith Parkinson Appa they are Japanese have attacked Pearl Harbor Hawaii by air President Roosevelt has just announced during World War two Germany Italy and Japan were far outnumbered by the Allies their only conceivable path to victory was the ability to launch widespread surprise attacks so the goal of encryption technology was to automate the one-time pad using an encryption machine ideally this machine would accept an input letter apply a random shift and output the encrypted letter however all machines follow the same principle they begin in some initial configuration known as a state they accept some input they do an operation with the input and then they produce an output the operation from initial state to final state is always predictable and repeatable so the goal is to produce identical machines that output a scrambled sequence of ships which took a long time to repeat therefore Alice and Bob could generate an identical shift sequence as follows first they need to share identical machines and agree on an initial position which is defined as the key setting then they align their machines to the same position and finally cycle through the identical operations to achieve identical sequences now the state-of-the-art technology at the time was called a rotor encryption machine we are all familiar with the mechanical process of an odometer which takes a long time to finally repeat its cycle now imagine we scramble the numbers on the wheels of the odometer when it ticks forward a new shift could be generated by adding up each number on the rotors this is the rough idea behind rotor encryption machines for example the message attack Northwest would be encrypted as follows notice how a new shift is used at each position in the message with three rotors each with 26 numbers the length of the sequence before repeating is 26 times 26 times 26 this is equivalent to having a list of shifts 17,576 numbers long understand that each rotor position is equivalent to a location in this sequence the initial machine state is known as the key setting and the collection of all possible key settings defines the key space this key space increases if the number of ways to initially configure the machine increases for example if the rotors can be rearranged then the order can be selected in six ways let's visualize the key space at this point first we choose from one of six possible rotor orderings then we select an initial position from the rotor sequence this gives us a key space with over a hundred thousand key settings remember every machine configuration is a point in this space when we select a key setting we are selecting a starting point in this space which then determines the rest of the shift sequence give away the key setting and you give away the entire sequence the security of rotor machines depends on both the size of this key space and the randomness of the key setting during World War two one of the most important encryption technologies used by the German military was known as the Enigma it was an electromechanical rotor machine invented by a German engineer at the end of World War one each rotor wheel had electrical contacts on either side with a maze of wirings within so at each rotor position there was an electrical path from every input letter to every output letter when the rotor advanced an entirely new path was defined for each letter during the war they continually tried to increase the key space of the enigma in order to make it stronger for example some changes they made were to add a fourth rotor wheel and increase the number of possible rotors you could put into the machine 260 this had the effect of massively increasing the key space near the end of the war the Enigma could be set up in over 150 million million million ways guessing the key setting which was used for a given message was about as likely as guessing the outcome of 26 dice rolls this gave the Germans confidence that the Allies even if they had a copy of the Enigma could never check all possible key settings for two parties to communicate using the Enigma it required that they first share the daily key settings this allowed them to align their machines to the same position this protocol changed over and over during the war but generally involve distributing key sheets in advance to all operators each day the operator would cut off the daily settings and this would tell them the daily configuration of their machine such as what rotors to use and the order of the rotors this key setting was then to be destroyed after use however one vital step was left to the operator they were to select a random initial position of each rotor before communication began and a very simple mistake was made by some fatigued operators we make this exact same mistake every time we set a bike lock combination because we tend to rotate the cylinders only a few clicks from the initial state or we reuse a common password this destroyed the uniform distribution of the initial rotor position and after it repeated observations it allowed the Allies to reverse-engineer the rotor wirings completely the second major error was a design error not a procedural one the enigma was designed so that an input letter would never encrypt to itself so given an encrypted letter such as L you can now eliminate the possibility that L was the original letter what they thought was a strength was actually a weakness in design and this led to a code-breaking machine initially designed by the poles and later improved by the British American effort the bombe was multiple enigma rotors chained together allowing it to rapidly test different key settings it took advantage of the fact that common words were known to be in the original message such as weather and these came to be known as cribs for a given message in crib the bomb could scan through all possible rotor positions and orders in order to find possible key settings in a matter of minutes this machine allowed the Allies to read German commands within hours of them being issued it was a fatal blow to their combat strategy as the Allies could anticipate their next move one fact remains this initial attempt at automating the one-time pad failed if the operators had instead rolled dice to decide their initial rotor positions the starting point in the sequence could have been uniformly distributed this would have prevented the reverse engineering of the rotor wirings and if the Enigma allowed letters to be encrypted to themselves the bomb could not have taken advantage of crips and this would have required the Allies to check the entire key space which was impossible even with the fastest computer repetition reduced the key space otherwise the outcome of World War two could have been drastically different you