#Introduction #Cryptography #Whats #Cipher

You can always take a bit of a clue as to what themes are by looking at the word and thinking about well what I know about this now there are two important words that we use one more common than the other that both had the same kind of basis as this work okay

The more common word is cryptic what does cryptic mean if I say oh that’s kind of cryptic right it generally means give me a synonym mysterious confusing right unclear so that’s why we have cryptic crosswords and there’s crosswords and they make sense in like here’s a rule and then

There’s cryptic crosswords don’t know if you’ve ever read the clues for cryptic crossword it’s just like is this what what is this I don’t even like it just doesn’t make any sense so cryptic is about mysterious or unclear right now that’s an adjective the verb that we

Would attach to this is the word encrypt right so if cryptic is mysterious then to encrypt right is to make something mysterious right to make it cryptic and cryptography is the art and science of encryption right of how do you take something which is sensible and meaningful and make it into something

That is hard to understand right why would you ever want to do that why would you make something that’s clear up into something confusing why would you do that good give it to make the truth right harder to find or harder to see okay so

That’s why I like to call it the art and science of keeping secrets I think that’s the UM the simplest way to understand it right you’ve got ideas your are truths you got fact but you don’t want everyone to know okay so a classic example of this I was in the

Renaissance right there people like who did you have you had your you’re da Vinci’s and your Raphael’s and you’re all these incredibly smart people right and they made these discoveries and they invented things but they didn’t want people to know what their discoveries interventions were okay so they would

Encrypt them they would write them backward to write them in code okay or they would use these things called ciphers okay now this is important this is our first subheading okay what’s a cipher a cipher is a tool right a mathematical tool which is why it comes

Undone that’s right for hands okay it’s a very simple idea okay so there’s a whole variety of ciphers and I’m only going to teach you about a very few number just the ones that are simple enough to wrap our heads around okay so the first kind of cipher is a

Substitution cipher okay and we’re all going to do one today okay a substitution cipher is very simple right you’ve got letters we have 26 letters in our alphabet right a B C D and so on so the simple idea behind a substitution cipher Matt cicadas over the simple idea behind

A substitution cipher as the name implies is going to take all of these letters and substitute them for something else okay now the way we do it and the reason why it comes under Matz is because all of the letters or twenty-six of them can be very easily

Numerically represented so we can call this letter 1 then 2 then 3 then 4 and so on so the simplest most famous client a substitution cipher that I’m going to teach you today is called the Caesar cipher because apparently the Romans used to do it okay as you’ll discover

It’s actually not that good it’s not very good as a cipher it’s not very good at making things mysterious right it’s very easy to break right but that’s part of the reason why it’s easy for us to wrap our heads around how does a Caesar cipher work it uses if you remember this

Or you might not remember it depending on what you did in the last thing is it uses a branch of math called modular or clock arithmetic could you raise your hand if you have ever heard of modular arithmetic heads up straight it’s like I heard about it but do not remember

That’s a cat right hands down boys of the month in oh yeah yes sir sir modular short for and we use the word mod to UM abbreviate it okay I will teach you how much of everything and you’ll see why a term called clock arithmetic I’ll show you how it works

Really easy okay the idea of modular estimate is taking remainders okay okay so this is a new subheading underneath Percy does have to show you how it works okay so we might say have a division under and you pick a number and pick a number

Okay so say I want to do module in petite with a base of 5 okay so I’m going to work out the remainders after dividing by 5 so this is really easy the way I would write it is I’ll take for instance okay what’s one when you divide by five how

Many times can you fit five into that not a good question the answer is you can’t fit it any times right so if I say mod 5 after taking out zero lots of five ones left and the answer is just the one

Right so 1 mod 5 is just 1 ok 2 mod 5 would just be 2 and 3 month and so on okay but where it starts the interesting is when you hit 5 ok because 5 1 5 what’s the remainder when you divide by 5 near to 0 right uh-huh

Ok and you can keep going right let’s do let’s do a bigger number say uh because I picked 5 it’s very easy so if I say 23 mod 5 you just have to take away all the multiples of 5 which is 20 and that leaves you with 3 ok simple so how does

This apply to this right we are going to choose a number any number you like right um actually let’s pick 5 since we’ve been talking about it ok and for all of these numbers I’m going to add that number on ok so for instance this would become our

Six and seven eight nine and so now here’s I’m going to do I’m gonna replace and I need a few more letters here ok don’t be so everywhere I see an A right I’m going to replace it with the sixth verb which is f right everywhere I

See a B I’m going to replace it with the seventh letter which is a G and you can see what’s happening right now why is modular arithmetic important to this because so far all I’m doing is adding numbers well as I add things are

Fine when you go 10 11 12 and so on okay but eventually right you’re going to hit let up 25 and then letter 26 okay now quick question you think you see if you how quickly go back up this means right when I see an a

When I see the first letter I’ll replace it with the sixth letter what letter will I replace because n what number would have been it would be the twenty first letter right the twenty first letter here I will replace with the 26 letter which is there so what is the

Twenty first level is it t let’s see TUV wxy Z so 26 25 24 23 22 21 to that count right okay so when I see a u right when I co dot u that’s letter 21 I should replace it with letter 26 and my cypher

So far is fine but what happens when I see a V okay so that’s letter 22 so when I add 5 to it I get 27 but I don’t have a 27th letter so what I do is I replace it with 27 mod what should I do it by I

Should do it by 26 goodnight because I have 26 letters in my alphabet okay so this will take me all the way back to 1 I should replace a V with an A which I guess would mean I would replace a W which is letter 23 with the second low

Which is a bit and you get the idea x y and z which of course should be replaced with an e right because the first third over here is an F so it comes around okay so does that make sense see what’s going on so in fact um Caesar ciphers

Can be man you can actually construct one for yourself by having two concentric circles right on the inside you have all the letters in the alphabet right on the outside you have all the letters of the alphabet and then what I would do is I rotate one of them right

So it’s shifted along all plus five so this is often also called a shift cipher okay so here’s what I would like you to do okay I would like you all to write out a message okay and then I would like you to choose a letter to deliver right

So I’m not sure is matter choose a number to shift by it could be we chose five it could be ten eleven whatever letter you whatever number you like okay and then shift it over and then hand it to your friend and see if they can work out number one

What number did they choose and number two what’s the message supposed to be so write out your own message obviously not too long because just a sentence because I’ll take too long to do this okay pick your own number shift everything over use your cipher on it

Encrypt it and hand it to your friend and see if they can undo it off you go

## 0 Comments