How did the Enigma Machine work? - YouTube

Channel: unknown

[1]
- [Jared] This is the Enigma machine.
[3]
It looks like a typewriter but it has
[5]
a very different purpose.
[7]
During World War II it was used to keep messages secret
[9]
or in other words encrypted.
[12]
In this video, we'll look at why the Enigma machine exists,
[17]
how it was used and then we'll take a look at the inside
[19]
to see how the mechanism works.
[22]
(electricity buzzes)
[28]
This video is sponsored by Brilliant,
[30]
a fun and interactive way to learn math and science.
[33]
Towards the end of this video
[34]
we'll take a closer look at their website and app.
[39]
While making this video I had a lot of help
[41]
from enigmamuseum.com.
[43]
These guys took a part in actual enigma machine
[45]
and showed me what's on the inside,
[47]
behind the panels, all the inside wiring
[50]
and how each mechanical piece works.
[53]
This would have taken a lot longer to 3D model
[55]
and animate without their help.
[57]
So big thanks to enigmamuseum.com
[59]
and now let's get to some animation.
[62]
To really understand the Enigma machine
[63]
we need to understand something called encryption.
[66]
Let's use an example.
[68]
Say we have two friends, Alice and Bob.
[71]
Alice wants to send a message to Bob
[73]
however, Alice doesn't want anyone else
[75]
to be able to read this message such as Eve.
[78]
Just as an example we'll keep the message really simple.
[81]
Alice will need to scramble the contents of the message.
[84]
This is called encryption.
[87]
It looks like a bunch of random letters
[89]
and if Eve gets a hold of it then she won't be able
[91]
to understand it.
[93]
When the message gets to Bob he needs
[95]
to unscramble the message.
[96]
This is called decryption.
[98]
Now he can read the original message.
[100]
Alice and Bob need to agree on a way
[102]
to encrypt and decrypt their messages.
[105]
A real simple way to do this is called a Caesar cipher.
[108]
This involves shifting all the letters in the message
[112]
three spaces to the right in the alphabet
[114]
so an H becomes a K, an E becomes an H,
[118]
an L becomes an O, an L becomes another O,
[122]
and an O becomes an R.
[125]
Now the message looks like gibberish,
[127]
A bunch of random letters.
[129]
When Bob gets the message all he has to do
[131]
is take each letter and move it back three spaces.
[135]
This will give him the original message
[137]
so he can read it again.
[139]
Now Eve in the middle, as long as she doesn't know
[141]
how the messages were encrypted
[143]
she won't be able to read any one of them.
[146]
During war encryption is extremely important.
[149]
Commanding officers need to be able to get messages out
[152]
to the troops on the battlefield
[153]
but they don't want the enemy to be able
[155]
to understand these messages.
[157]
Nowadays encryption is performed by computers
[160]
but this wasn't always the case.
[163]
The Enigma machine was used to encrypt and decrypt messages.
[167]
You can think of this as a very sophisticated
[169]
letter scrambler.
[171]
It was invented in the early 1900s
[172]
and then most famously, it was used
[175]
by the German military in the 1930s
[177]
and throughout World War II.
[182]
This is the keyboard with 26 letters.
[185]
And this is the lamp board which also has 26 letters
[189]
but these letters can light up.
[191]
Each time you press a letter on the keyboard,
[194]
a letter on the lamp board lights up,
[196]
but it will always be a different letter
[198]
than the one that was pressed.
[200]
There are usually two people involved
[202]
when the machine is used, one person to type in the letters
[204]
and another person to write down the letters
[207]
that appear on the lamp board.
[209]
Let's use our example from earlier.
[211]
Type in each letter and write down the letters
[214]
that appear on the lamp board.
[216]
Now we have our encrypted message,
[218]
the scrambled letters that nobody can read.
[220]
This message is sent usually by radio using morse code.
[224]
The person who receives this message also
[226]
has their own Enigma machine.
[228]
To decrypt the message or unscramble it
[231]
they type in the letters on the keyboard
[232]
and write down which letters appear
[234]
on the lamp board and out comes the original message.
[237]
The Enigma machine was used for both
[240]
encryption and decryption.
[243]
The person sending the message needs a machine
[245]
and the person receiving the message
[247]
also needs a machine to be able to read it again.
[251]
So how does the Enigma machine know which letters
[253]
to give you?
[254]
Maybe you press an A and outcomes an H.
[258]
How does it do that?
[260]
Well, part of the answer is electricity.
[262]
Let me show you a simple example.
[265]
We have a battery, some wires, and then something
[268]
that uses electricity in this case, a light bulb.
[271]
This is called a circuit.
[272]
It's a closed loop for the electricity to flow.
[275]
But if there's a break in the wire,
[277]
then the light bulb turns off.
[279]
If we put a switch in here, now we can easily turn
[282]
the light bulb on or off.
[284]
There has to be a complete path for the electricity to flow.
[288]
Now let's add another path, one more switch,
[290]
and a light bulb.
[291]
Now we can turn on two different light bulbs
[294]
depending on which switch we turn on,
[296]
there's a different path through the wires.
[298]
We could expand this even more,
[300]
more switches and more light bulbs.
[303]
Now, this is predictable.
[305]
We know which switch goes to which light bulb,
[308]
but what if we scramble these wires?
[311]
Now the switch for the letter A turns on
[313]
the letter C light bulb and the C switch
[315]
turns on the B light bulb.
[318]
This idea of scrambling the wires,
[321]
that's how the Enigma machine works.
[324]
Let me show you on the real thing.
[326]
The battery is inside in the top right-hand corner
[329]
of the machine.
[331]
The keyboard has 26 keys.
[333]
When you press one of them it connects a circuit
[336]
which will then turn on one of these 26 light bulbs.
[340]
The light bulbs will then illuminate the letter
[342]
that's directly above it on the lamp board.
[344]
When you release the key, the circuit
[346]
is disconnected and the light bulb turns off.
[349]
Each key connects a different path
[351]
which means a different light bulb.
[353]
Okay, this is the challenging part of the video
[356]
understanding the circuit or the path
[358]
that the electricity follows throughout the Enigma machine.
[361]
Maybe pause the video, get your degree
[363]
in electrical engineering and then let's do this.
[367]
The three main parts that we need to understand
[369]
are the rotors, the keyboard mechanism, and the plugboard.
[375]
Let's start up here with the rotors.
[377]
This machine has three of them.
[379]
This is where the letters get scrambled.
[382]
Let's take a look at one of the rotors.
[384]
You have the numbers one through 26 for all the letters.
[388]
So one is for A, two is for B, three is for C
[391]
and all the way around until 26 for Z.
[396]
On the side you'll see 26 metal contact points.
[399]
There are also 26 on the other side too.
[404]
When you put two of these rotors together
[406]
the metal contacts connect, making it possible
[408]
for electricity to pass through.
[411]
On the inside of these three rotors
[412]
you'll find lots of wires that connects the two sides,
[415]
but as you can see, it's all scrambled.
[418]
So let's go through the pin for the number one.
[421]
Follow the wire through and it comes out the pin
[426]
for the number four.
[428]
So in this case an A was changed to a D.
[431]
When electricity travels through one rotor
[434]
it changes the letter once.
[435]
But remember, we have three of these rotors
[438]
and they each have different wirings on the inside.
[441]
When electricity travels through all three of them
[444]
it changes the letter three times.
[446]
Then at the end, we have the reflector.
[450]
This also has 26 metal contacts.
[454]
Inside is more wiring that connects the letters in pairs.
[458]
So it goes in as one letter and then comes out
[461]
as another letter.
[464]
To the right of here is the input wheel.
[466]
It has 26 wires that go in and connects
[469]
to the 26 metal contacts.
[473]
Let's put this all together.
[474]
Electricity flows through one of the 26 wires,
[477]
let's say the wire for the letter Y.
[480]
Then it gets changed to a different letter
[482]
at all three rotors.
[484]
Then it hits the reflector, which again, changes the letter.
[487]
And then it goes back through the rotors again
[489]
which changes the letter three more times.
[492]
And it comes back out on a wire that represents
[494]
a completely different letter.
[496]
And if you were counting, this means the letter
[498]
was changed seven times.
[501]
Now, this is just an example of how the letters
[504]
could get scrambled, but the path can and will change.
[510]
Each of these three rotors can rotate
[511]
to 26 different positions.
[514]
When any one of the rotors changes positions
[515]
this will also change the path of electricity
[518]
making it very difficult to predict which letters
[521]
are going to come out.
[525]
The 26 wires from the input will travel down the right side
[528]
of the machine to the plugboard in the very front.
[532]
Now the plugboard was yet another way
[534]
that the letters could be around specifically,
[536]
you could swap two letters.
[537]
So let's say we wanna switch the W and the J.
[541]
You could take one of these cables here
[543]
with plugs at each end and put one of them into the W spot
[547]
and the other one in the J spot.
[550]
On the back side of the plugboard,
[552]
you can see the individual wires going
[554]
to the tops of each socket, and then out to the bottom
[557]
of each socket.
[559]
Let's take a closer look.
[560]
This is the plugboard socket for the letter O.
[563]
If nothing is plugged into it the electricity flows in
[566]
through the top, then through the shorting bar
[570]
and then out through the bottom.
[572]
This means that the plugboard didn't change the letter.
[574]
It came in as the letter O and then it came out
[576]
as the letter O.
[578]
When a plug is inserted, it pushes up the shorting bar
[581]
so it doesn't connect anymore.
[583]
Now the electricity flows in through the top,
[586]
out through the top pin of the plug,
[589]
then through the cable and out through the bottom.
[592]
On the other side.
[593]
What came in as an O now it comes out as an E.
[599]
Often times, they would use up to 10 of these cables.
[603]
Notice how a few of these letters are still left
[605]
without a plug.
[609]
Let's take a look at the keyboard mechanism.
[611]
Each of these keys is connected to a long stem beneath it.
[615]
They have springs that push them back up
[617]
when you release the key.
[619]
the last row of keys have the springs connected at the top.
[623]
Right next to all of these keys
[625]
most of the space is taken up.
[627]
These are the 26 key switches.
[630]
These switches are a little bit more complex
[632]
than just the on-off switches that we saw earlier.
[635]
Let's take a look at just one of the switches.
[637]
This one is for the letter P.
[639]
The switch has three different copper colored tabs.
[642]
The wires are connected back here,
[645]
and the flow of electricity is controlled
[647]
from the other end.
[649]
When a key is pressed it comes down
[651]
and hits the rubber end of the middle tab.
[653]
What this does is changes where the electricity can flow.
[657]
Before a key is pressed the top two tabs are connected,
[660]
and after the key is pressed, the bottom
[663]
two tabs are connected.
[666]
There are 26 key switches and here's all the wires
[671]
that are connected to them.
[673]
The top tabs are connected to the light bulbs.
[676]
The wires go to the left and up to the corresponding
[679]
26 light bulbs.
[684]
The middle tabs connect to the plugboard.
[687]
They go through the wires to the right side of the machine
[690]
and down to the corresponding letters on the plugboard.
[695]
A wire from the battery goes directly
[697]
into the bottom tabs of each key switch.
[702]
So each switch has three different tabs
[704]
and three different places where they are connected to.
[709]
Before a key is pressed the bottom tab
[711]
isn't connected to anything so the electricity
[713]
has nowhere to go.
[715]
This is true for all 26 key switches.
[719]
No circuit, which means all the light bulbs are off.
[723]
Now let's say we press the X key.
[727]
The battery and the plugboard are now connected.
[729]
This completes a circuit but it's not as simple
[732]
as this circuit we saw earlier.
[735]
Let me show you a quick overview of the path of electricity.
[738]
Don't worry if you can't keep up quite yet,
[740]
we're gonna go over each part one by one.
[743]
(mellow music)
[748]
Let's take a closer look at each step.
[751]
Electricity flows from the battery to the bottom
[754]
and then middle tab on the switch for the letter X.
[758]
Then it goes directly to the plugboard.
[762]
And in this case there's nothing plugged in
[764]
for the letter X so it comes back out as the letter X,
[767]
up the side and into the input wheel.
[770]
Then through three rotors, the reflector,
[773]
and then back through the rotors again,
[775]
changing letters at each step of the way.
[778]
What started as the letter X is now the letter K.
[783]
Now we come back to the plugboard for the second time.
[786]
The letter K is swapped with a C.
[790]
So in through the letter K, through the cord,
[794]
and then out for the letter C.
[797]
Then travels from the plugboard back
[799]
to the middle tab on the letter C key switch.
[802]
Remember we started as the letter X
[805]
but then came back in as the letter C.
[809]
Then it goes out the wire of the top tab
[811]
and up to the letter C light bulb.
[816]
Then the current flows through the metal light bulb plate
[819]
to this tiny wire which connects back to the battery.
[823]
This completes our circuit.
[825]
As soon as the key is released no more circuit
[828]
and the light bulb turns off.
[830]
So just to recap, once a key is pressed
[833]
electricity goes from the battery
[835]
to whichever key switch was pressed.
[838]
Then the plugboard, rotors, then back to the plugboard,
[842]
then the key switch for our new scrambled letter,
[845]
then the corresponding light bulb
[848]
and then back to the battery.
[850]
The letter has changed seven times at the rotors,
[854]
and then possibly two more times at the plugboard.
[860]
Remember that the letter isn't always changed
[863]
when it goes to the plugboard.
[868]
Okay, the electric circuit was the hard part of the video.
[871]
If you made it this far, we're doing good,
[873]
but there's a little bit more that I wanna show you.
[878]
Each time a key is pressed you'll notice that at least one
[880]
of these three rotors will turn.
[883]
Press a key rotor turns, press a key rotor turns.
[888]
This means that if you press a key twice
[889]
you'll get two different letters.
[892]
In fact, if you keep pressing the same letter
[895]
a different light turns on every time.
[898]
This is what made Enigma so powerful.
[900]
The code was always changing so it was hard to predict
[902]
which letters were going to come out.
[905]
The way these rotor spin is completely mechanical.
[907]
No electricity needed for this.
[909]
Even if the battery was taken out,
[911]
pressing one of these keys would still turn the rotor.
[914]
On the bottom of the machine is a large metal plate
[917]
called the actuator bar.
[919]
It works like a seesaw or a teeter-totter.
[923]
Pressing any of the keys pushes it down on this side,
[926]
which pushes it up on the other side.
[929]
Around the backside is where the magic happens.
[934]
This uses a ratchet and pawl mechanism.
[938]
This is the ratchet gear.
[940]
And this small piece is the pawl.
[943]
When the pawl is pushed up it spins the rotor
[946]
and then comes back down.
[948]
You can see how this would spin it in only one direction.
[951]
This up and down motion will keep spinning the rotors
[954]
one slot each time.
[956]
The next two rotors work a little different.
[958]
Let's take a look at the second one.
[960]
Most of the time the pawl can't make contact
[962]
with the ratchet gear teeth.
[964]
It's blocked by an edge around here on the first rotor.
[967]
The first rotor has a tiny notch around the side here.
[972]
When the rotor spins the notch travels around the edge.
[975]
Watch what happens when it comes up again
[977]
on the other side.
[979]
The pawl will fit right into the notch
[981]
and the second rotor is allowed to spin, but just once.
[984]
The next time it will be blocked again
[986]
and only the first rotor is allowed to spin.
[989]
That edge on the first rotor has to go all the way
[992]
around before the second rotor is allowed to spin again.
[995]
This will happen once every 26 key presses.
[998]
The same thing with the third rotor.
[1000]
There's another edge on the second rotor
[1002]
that has to go all the way around
[1003]
before the third one is allowed to spin.
[1006]
Last but not least we have the three levers
[1010]
on the very back with index wheels at the very end.
[1014]
They ride along the outside of the rotor gear teeth.
[1017]
This means that the rotors always stop spinning
[1019]
at the next number.
[1020]
This is important so that the electrical contacts
[1022]
always line up between the rotors.
[1027]
Before you use the Enigma machine,
[1029]
it would need to be configured with the right settings.
[1032]
There are four of these settings to go through.
[1036]
First is the rotor order.
[1038]
Each Enigma machine came with a set of five rotors.
[1041]
Choose three of them and then choose which order
[1045]
to put them in.
[1047]
Then there's the ring setting for each rotor
[1049]
which is basically the shifting of these number wheels
[1052]
but that also includes the notch on the side.
[1057]
This means this will change when the leftmost rotors
[1060]
can be advanced to the next number.
[1062]
Then there's the starting position for each rotor.
[1065]
You can set this to the tiny windows up here.
[1070]
And the final setting is the configuration
[1072]
of the plugboard at the very front.
[1076]
So everyone in the German army had these settings
[1079]
in advance.
[1080]
They were distributed out by paper
[1081]
so they would know which settings to use
[1083]
on which day of the month.
[1085]
Even if the opposing side has their own Enigma machine,
[1088]
they won't be able to read the messages
[1090]
unless they know the settings that were in use that day.
[1094]
Some of the ideas behind the Enigma machine
[1096]
are complex and sometimes difficult to understand.
[1099]
However, it may come easier to those
[1101]
that increase their ability to do math and science.
[1105]
brilliant.org is a problem solving website
[1107]
and app that has over 60 courses in mathematics,
[1110]
science and computer science.
[1113]
The idea here is to learn by doing.
[1115]
They teach you a concept and then immediately you get to try
[1118]
it out in a fun and engaging way.
[1121]
You can use Brilliant to help you as a student in school
[1123]
or as a professional or anyone who wants
[1126]
to keep their skills sharp.
[1128]
There's a wide range of content
[1129]
and they're even adding new courses from time to time.
[1132]
Instead of just learning a formula and blindly plugging
[1135]
in the numbers, you get to visually see why
[1137]
that formula works.
[1139]
There's nothing quite so satisfying
[1141]
as when that light bulb goes off in your brain.
[1144]
I like Brilliant because it shows
[1145]
that learning can and should be fun.
[1148]
You can sign up for free by going
[1149]
to brilliant.org/jaredowen.
[1151]
Also the first 200 people will get 20% off
[1154]
their annual premium membership.
[1156]
(mellow music)