I have to kind of apologize. [I] thought about how to do this, right? I could have done this with actual How the Irsa system would actually work with actual numbers? With an actual like long message and all that kind of thing and we could do with computers I could show you how to do it, and I thought no No, I actually want you to see the maps of what’s going on So I have picked simple simple things like a one letter message okay, so forgive me for that. I should Okay, yeah, so so now let me start So the RSA Cryptosystem right RSA stands for these three names on rivest. That’s a V rivest shamir Adelman these guys were geniuses okay, [and] you’ll see why as you as the method unfold But no one no one remembers their names, so we just call it rSA. Okay the rSA Cryptosystem it works like so What you need is an encryption? Pair of numbers okay, and this is kind of like the pair of locks [that’s] sorry not the pair of lock the pair of numbers is the lock that I hand out to everyone okay, so I? This pair of numbers okay, and I say look you want to send me you want to send me any message you like okay? Use this this lock right to lock up your message And then I’ll be able to decipher it and only I will be able to separate so just as an example suppose you want [to] Very secretive you want to send you the letter b. Okay, so go home my boat all right? So how do we do this let me show you then that saab is deceptively simple But you do need to remember a little bit about what we did with modular arithmetic on the Caesar cipher I promised our dear heart okay, so here’s what we’re going to do First there, this is this is text, but we need to deal with numbers right so I’ll convert this to a number okay, so numerically Like we can decide whatever, but I suppose We’ll call it – what are we okay so – that’s the actual definite text for number. We’re going to send okay Now I want to I Want to use the cipher on this thing okay? So [I’m] going to do is I’m going to take this number – okay I’m going to raise it to the first power the power of the first number as you said, right So to the power of five and then I’m going to say more The second number this is what I’m going to calculate This is how I’m using the numbers so first if you set the letter C Which would be 3 then what you would calculate is 3 to the power of five more 14, okay? Let’s just quickly do this because the numbers are okay. That’s how I chose them right to the power of 5 To 2 notice that’s 32 good right mod 14 now Do you remember what Mod means [no] [sugar] is knitted right this number 14 is called the modulus What I want is the remainder that I get that’s left after I divide 32 by 14, okay? So of course the biggest number the biggest multiple the 14 you can fit into this is 28 And so what’s left over is 4 does that make sense? Yeah, so that’s a 4 mod 14 okay, so now for This is my ciphertext okay, so the ciphertext My encrypted message, okay will be 4 which is D I guess [ok] so that’s what you send to me right and now it’s a secret the original message is lost How do I decipher this okay? Well? You don’t use this pair of numbers, okay? I have the R value of the key right the key is related to this the second number [the] 14 is the same But for decryption the first number is different Right so in some sense is this first number. It’s the secret. It’s the it’s the key if you find it out You can decipher everything that comes to me okay? So in this case The decryption Key is 11 14 like I said this number here the modulus is the same but this number here this one is the key Now what do I do with this well? I’m going to go through the same process, but I’m going to use this pair of numbers instead [of] this pair of numbers, okay? I take your ciphertext right which was the ladder deep and I’m going to go through this whole person again I have to convert it to a number which is 4 [ok] then I raise [it] to this power, and I say more 14 okay now to the power of 5 you could do that in your head [before] [the] power of 11 Maybe not so get your calculator out Yes, well, how do you get [Eleven]? I’ll get to that, but the point is I know what it is And you don’t talk That’s part of the point that you can’t just you can’t just see oh, yeah Five means Eleven right the point is that no one can work it out? In fact, it’s I’ll show I’ll tell you how hard is to a gap in the end So I have this can yep No, no, and you also think what if it was always going to be [11], it’ll be a pretty lousy education All [right]. See you guys later there now. Yeah, so the first thing you do The first thing you do is for the power of 11 okay for to the power of 11? Okay now then you get out this monstrous number Okay, and this is Mod 14 okay, Mod 14 so Unfortunately or maybe fortunately um our calculators don’t have a mod button on there, okay? So I will short show you a sort of a quick and dirty Shortcut that will work out what this number is and actually part of your homework [I’m] going to make a star here, so I don’t forget it Part of your homework in a post after this lesson is to explain What I’m about to do, so you want to take note of what I do fairly carefully, okay? Why does what I do? What is why is what? I will do why does it work and it introduces there’s a problem with the method It’s easy to solve by what you work out number one. Why does it work number, two? Why does it introduce this problem to strange kind of problem all right? So here’s what we going to do remember? This is about remainders right [and] division all I kind of think so the first thing I’ll do is I’ll take that number which is on my display and I’ll divide by the modulus 14, so you divide by 14 [and] it’ll give you like I gives you a fraction, but I want the decimal okay So this shows me two nine nine five nine three point one four two nine blah blah blah blah blah, okay [so] I see that number okay now what I want to do is just mentally take note of the Integer part of that no which is two nine [nine] five nine three Okay, so what I’m going to do is Actually should put that off on the side But I’m running in a space swimming what I’m going to do is I’m going to subtract the integer part from the whole number Okay, so on my calculator [with] this on the display. I say minus two nine [nine]. Five nine three Okay, and what’s left is a decimal in fact it’s this decimal. Okay now once I’ve got that decimal there I want to multiply back by this [modulars] fourteen okay, if I multiply by fourteen What my calculator then says is no [money] cookies my calculator then says this? and There’s an eight or a couple of eights on the end. Okay. Now. What number is this close to 2 so this is 2 mod? 14 okay, let me just remind you what’s going to go in that hand [word] person number one why does this work? It’s not that that’s not the hard part okay. Why does this spit out the correct this is called the residue What’s left over okay? Why does [that] work and secondly? Why does it do this? Hmm you think about it. You can work it out. Okay? That’s that’s going to go into your home if you have a it’s up I Know there’s an easy way. I this is a particular way that there’s being for all of us suffering. Yeah, okay, all right. So yeah yeah, why doesn’t he give us two why doesn’t it give [it] to because the shit gives [to] Okay So now how about what just happened I? Finished the process the process is Done. I Started with your cipher texts you sent me d right and so I went through this process and at the end I end up with this which is your original text B, and I have deciphered it it would and you can go [ahead] and you [can] test out what you need is you need to Encrypt it like this and Then decipher it with this using this interesting combination of the power and this module of the relative

## 100 Comments

## Μιχάλης Καστρινάκης

6:40 it would be easier if you divide 4194304 by 14 which equals to 299593.14…

then we take the integer part (299593) and multiply by 14 which is equal to 4194302..

and now if we subtract 4194302 from 4194304 and we get 2 which is equal to number B

## Reuben! Edmunds

How would you put this into code so you could put it into a computer so it's a lot faster to decrypt and encrypt

## Anar Key

"Does that make sense… yes"… fascinating but I do struggle…

## Lancelot The Knight

Excuse me sir Woo, is the 14 the public key? Because 5 and 11 is a private key right?

## pwr

🅱

## Benny B

Great video, thanks for the help! 🙂

## Worldaviation 4K

This makes more sense than some other videos that i searched for in other places with the fictional alice and bob. Proper detail like in this video with the actual numbers is far better than other videos i've seen elsewhere

## Dawn Ripper

Uhh, can't you just multiply 299593 by 14 and see the difference between that and the original number which is 2, btw?

## Nigel Bess

1:14 is now relevant on r/dankmemes

## bobbyj joel

Brilliant teacher.

## John Runyon

You'd be awful screwed if the plaintext was O…

## Lambert Brother

I used p=3, q=5, e=7, d=23, encrypted the message 'C' and the result was 'C'.

## Imisambi

how did you pick the numbers… 11…and 5 ..? was is related to extended euclidean algorithm..? thanks!

## brbl

Where did 11 come from?

## PoisonedHive

Eddie, you helped me pass my Codes & Codebreaking Unit at Uni. Thanks!

## Dimitris Xatzimixail

very good

## Navi Crazzy

someone, please give him something to eat…

## Achmad Alfian Hidayat

nice bro..

## Matt T

Man… This is the definition of a good teacher. You can explain things very well and in a succinct manner. Great video!

## Defender2516

Girls if your going to talk, PLEASE LEAVE the classroom and go talk outside. Sometimes good teaching lessons are just absolutely wasted on students who don't even know why they are there.

## Dixing Xu

Best teacher!

## Double Orts

Bright guy

## John Goh

Hi Eddie is there anyway subset sum problem can be used to modify RSA?

## Buda Yen

You send me D

## danielsan

@eddie. thanks

## Bryan Shepard

The reason he got 1.99….88 instead of 2 is because of floating-point arithmetic. For a computer, the fraction 1/3 does not have an infinite number of 3's, because the computer doesn't have an infinite amount of memory. When a computer stores a number into memory, if must first allocate how much memory that number will occupy (usually a power-of-two-times-eight number of bits). Then it stores as many significant digits as it can, but most of the time this means some get chopped off at the end or rounded off. As we do math with these truncated numbers, the effect of rounding errors grows.

## ali ulo

I wonder if all slightly more complicated concepts could be be explained in such a lucid way, or this particular problem allows for it. Anyway, that's no all to it: my respect, Teacher:-)

## Ben Terry

You explained clearly in 8 minutes what I couldn't fathom in a 2 hour lecture, Thank you, you're a credit to good teaching.

## Dr Michael S

Don't need calculator to do 4^11 mod 14, the nice thing about mod is you can do stuff like 4^11=4*16^5, which reduces to 4*2^5 mod 14 and now the previous calculation gives 16 mod 14 which is 2.

## Codingmaster

LOL EZ FLOATS ! XD ! ( 7:38 )

## Tomasz Górka

Have to say this, you saved my life, that's the best explanation on the web and I have to do this as a homework for tomorrow, thanks!

## Max Echendu

Gets new YouTube account..

Realizes he's not subscribed to Eddie Woo the master of knowledge…

Flips…

Punches a hole through a wall…

Calms down…

Smiles…

Watches video…

You can continue scrolling the comments now…

## Arzu Arzu

29 Oct. is my birthday !

## MetraMan09

disrespectful class. have to blame the teacher on that one though… gotta coral the herd!

## George Henderson

I figured it out in about a minute and a half.

## Tony Joseph

http://www.quickdevtools.com/conversions/hashes/

## N Ash

If I had Eddie as my teacher I'd have done SO much better in math.

## soundhar gs

Oh man! The way you handled yourself is awesome and the lecture was so clear and perfect one i have ever seen!

## Jijus Chreest

"Sir, is it always going to be 11?"

How dumb can americans be?

## Arul Murugan

Best explanation ever. Love you Eddie woo.

## Brent Edds

7:09 no [money] cookies 😛

## Brent Edds

I want a teacher like this

## Panzone Caduto di Faccia

2 hours of lecture in my uni and I didn't understand shit, 8 min of video and I feel super confident about rsa.

Thanks man you a great professor

## Daniel Ustarez

An asian guy using calculator?

dishonor## game BOXNZ

ur gay

## Nick HOLMES

I wonder what time the Yoga class turns up.

## Zhaoxun Yan

The "lock" analogy is much better than the "public key" terminology.

I came up with this idea soon after I learned the RSA and I am not alone.

I wonder why they have not changed the terminology yet?!

## محمد

this teacher is GOLD

## Md Anwar Jamal

really fantastic Sir

## Rakhi Dhavale

This teacher is a amazing with his teaching skills 👍🏻

## Thomas patrickson

Thank you so much, great video and your a great teacher.

## Graham Bond

I have RSA deciphered from boredom 🙂

mod(n, round(x))=0 gives immediately p and q

## Graham Bond

4=mod((round(x))^5,14) {x>0} first x on the left =2

## LAKHIMONI GOGOI

Lakhmanigi

## ScubaTech Productions

Eddie, I just wanted to say THANK YOU! This video taught me more in 8 minutes than I was able to figure out in 2 hours trying to decipher (hah) my textbook. Stay awesome. 🙂

## An Ché

Boy, I love this man! 😍

## Joel kashaija

can some one explain me how he got 4 from 32

## Dev Vanana

Text :123

Cipher text : 123^5(mod 14) = 9

Decryption : (11, 14)

9^11(mod 14) = 11 (I expected it would be 123)

Why 11 is appeared instead of 123?

## CO DING

it video is great. teacher is very good and handsome.

## ┓┏ 凵 =╱⊿┌┬┐

i get computer science…this helps

im kinda gutted you didnt explain how you got to that decryption key

## Android 4 All

Sir this way i think not guarantee to get the result when u decipher you can find , fi(n) then you can easly finding d thats the key we wont

## Graham Bond

The music of the Prime Numbers, part 4, Solution.

https://youtu.be/d6NBGgQY1KU

## Ivan Rodriguez

Excellent and very clear explanation! Like it!

## Sharif Khan

Dude finally I understood it. Thanks for using math. My mind works better with numbers.

## Rajivrocks Ltd.

Wish i had teachers like this guy, all my teachers at my Comp science course are ASS and we have to learn everything ourselves

## saloni gupta

Amazing video!

## xavier santos

where did he get from (11,14) ? The 11 I'm confused about

## [DAN THE GREAT]

can a vpn tunnel be encrypted by RSA?

If AES and BLOWFISH can encrypt a tunnel then RSA probably can…Can Someone confirm or deny?

## OutOfControl

Hi Eddie, I know this video is a few years old but thank you so much. I've struggled a lot with this from watching other videos and reading about it online. This video made it so easy to understand, thank you!

## Wang Isabelle

???? I dont understand… I took some computer science class and I though the reason its 1.9999 instead of 2 is because of something to do with floating points notation and such????

Also, talks about "not going to use s string as example" but will talk about the "math behinds it", proceeds to talk about string as example and leave the math part as a homework…

## Jude Scally

Great video, can't wait to start working with you!

## Miksu

But 4^5(mod 14) is again 2 so the lock can actually unlock itself? Then it is not so secure after all. Does it only work with greater numbers then?

## Ste ame

Very interesting video, you are really a good teacher.. you helped me understanding RSA procedure, thank you 🙂

## Aayush Sinha

I wish I had you as my Professor in Uni.

## sean malone

Not only did I just see the best explanation of RSA encryption that I've ever come across, I got a free yoga lesson as well.

## tharuka ravishan

Where does the Number 11 come from…

## Caio Lucas

I wish i had you as my maths teacher in high school and now at university :'(

## Oscar TodKee

i love your vids

## William lorranie

good

## zermello franck

thank you so much thars help me to understand so clearly, thats the most simple calcul in the cryptography

## Lynda Openshaw

although one is totally behind the concept of people/ companies/ lobbyists/ and just people who believe they are doing the right thing the letters RSA really does stand for Republic of South Africa Algorithm and encryption aside

type i RSA you will be enamoured

## SURESH SHARMA

Check out this 3 minute RSA Algorithm video also. This is a good one. https://www.youtube.com/watch?v=mkDvyCV8Nzk

## Wellington P Ferreira

that goes my whole semester

## Jan Tyron Go

Best teacher

## RagazzoKZ

It's a very bad explanation of RSA!!!

## klevdavful

Epitome of a good teacher even a newbie can grasps and with enough reps can develope encrypt decrpt skills.

## klevdavful

It's not going to give u exactly two because I think the number is prime , so it puts u closest to the number that u should be able to round up.

## Disaster

where did you get 11?

## Dauphin Guillaume

I miss school so much when I see this kind of topics handled by a great teacher

## Luiza Serson

Where did he take 11 from? How did he know?

## Sakib Hasan

Man … I would fight to attend his class,,, He is one hell of a good teacher! much appreciated!

## Ryan Austin

Can you teach me everything you know before you leave this world?

## pk

When he said you gave me D 😂😂😭

## Mohd Asyraaf Syahmi

How do you get 11?

## Maloum MMM

The best RSA explaination i have ever seen

## Maciej Łukasik

<3

## iErcan

Soient les plus importants pour moi de me rendre compte que je ne suis pas la seule personne seule qui me demande de me faire rembourser par et qui je n'ai pas eu de réponse à ma demande et je n'ai n'ai pas eu de réponse à

## Oliver Shi

I love the enthusiasm!

## The Fruit Of All Derps

14 isn't a prime number, so I'm confused as to how you came up with it or how it works, if you could take the time to explain it, I'd really appreciate it.

## Prithveen

If I had a lecturer like this guy, I would ace every subject! Great job man!