You make what I once thought was extremely complicated very easy to understand! You are a visual learner’s dream come true concerning public and private keys 🔑
23/83. It's actually pretty easy with Excel. SQRT(1909) = 43.6921, so do x=1 to 44 with 1909/x. Since it's semi-prime, only one value (23) will have a whole number answer. Just to check, 23*83=1909 and both are prime. But that's 1909. Doing the same for a 100+ digit number is beyond what Excel can handle. Great video. Thanks!
This is awesome. We all use RSA encryption daily but I never really knew *how* all those keys worked together. Thanks for explaining it clearly and concisely.
Awesome! I was not sooo much interested in such a deep dive, but when you started explaining I just sat and enjoyed the ride :) Thanks for your work again.
🥳🥳 *Promotion Ended - Congrats @The.Wizard* 🥳🥳 For the rest of you, you can use this discount code for $100 off the course: YT100 classes.pracnet.net/courses/practical-tls Subscribe + Notification bell to increase your odds of winning when the next video (and giveaway) releases! 📢📢 Practical TLS - Course Giveaway 📢📢 I'll be picking a random person from all the comments in the next 7 days on this video to give a scholarship for free access to the full Practical TLS course. All you have to do is make a post to enter. Check back in a week to see if you won. =)
hey man i just wanted to say a big thank you, i found this video from a reddit post, i was so close to leaving this topic off from my notes because i didnt understand it but im glad i didnt, thanks again and now im off to watch your DH video
You are convincing. When you said of your difficulty and the concomitant aha moment, that got me glued to the video. Of course, the content is always insightful. You are always amazing. Thank you forever.
Your skills in instruction are unrivaled anywhere else and helps make us all feel a little less dumb for not understanding other instructor explanations.
How is this possible, How can you explain such a complex topic so effortlessly, Simply Brilliant, Blown away :). Thank you very much, appreciate all your efforts. Why this channel is not having enough subscribers :(, atleast you deserve 5 million
Damn, This is literally very easy. Couldn't able to understand this in my semaster and now after 10 days i have final exams for cryptography. This helped me alot
Excellent! I have a bit more understanding about RSA encryption, I use it on a daily basis in Linux, Network Devices, Bitcoin the protocol, and the Lightning Network, enlightening information Ed, thank you very much for all you do. All the very best!
A long time ago (Maybe 4 years), my teacher made us design a crc decoder to detect and fix bugs. It was a very simple one that could fix just one bit, and as far as I remember, it uses kind of the same method you're using here, I cannot remember the math but it had to do with prime polynomials and fields of galois and somehow, you made me remember my student days... Anyway thanks very much this was really helpfull you're such a good instructor I really appreciate. Thanks very much 😋😋
02:04 I'd like top put forward a simpler explanation/definition of a Factor: "A Factor of a number, is any number that the original number is exactly divisible by." (ie. no remainders/fractions). This definition removes the concept of "pairs" of numbers.
Please please keep teaching you are really making differences in peoples life. I would love to meet you in person and/or help/contribute in anyway possible.
I was going through the video and I came across one question. Is it necessary that the public and private key values must be greater than the two prime numbers(P,Q) chosen in the beginning?
Yes. A number can be a factor of another number, and a semi-prime / prime at the same time. 5 and 3 are both prime. 5*3 is 15, 15 is Semi-Prime. 15 is also a factor of 30, and 45, and 60, and so on.
Wonderful explanation!! So, the Encrypting entity must have the Public key of decrypting entity and the product N? If yes , then How N will be shared ?
BTW great explanation, but don't receiver needs to know the value of N apart from public key in order to decrypt the cipher!! If yes how do we achieve that??
Encrypting with the Private Key and Decrypting with the Public Key is for Digital Signatures. Is this used in any other scenario? Because, for instance, Encrypting an email would be Encrypting with a Public Key and Decrypting with a Private Key.
No, that is the only scenario in which "encrypting with the private key" occurs. To be clear though, this only happens with RSA signatures. DSA signatures are generated another way. For details, read this blog post: www.practicalnetworking.net/practical-tls/rsa-diffie-hellman-dsa-asymmetric-cryptography-explained/
Hi! Thanks for the very good explanation. I have one question that I still couldn't figured out. You said that RSA relies on difficulty of factoring semi prime numbers. However, I cannot figure out how knowing the factors could help to find out the private key? If I take your example, we have product (N) 133 and public key (E) 29. Let's say somehow I know the factors (P,Q) 7 and 19. So, how can I calculate the private key (D) 41 out of these numbers 133,29,7,19? Maybe it's too easy but I can't do the math :) Thanks in advance!
The prime numbers give you the totient which is used to calculate the private key. So with everything but private key, you can calculate the private key.
I get how the whole thing works from a math standpoint, but how is it put into practice? In the example you used, you said your message value equals 60. How is that message value calculated? Like, if I wanted to send "This is a sentence," what is the value of that message?
found that very interesting. although math's not my strong point and i will have to watch the math bit again (maybe a few hundred times knowing me ) it helped me understand the process a lot more. Looking forward to the DH one.
That's the whole point =) It was easier for me to understand RSA when I saw the math. I'm certainly not a mathematician, but I was able to follow with the simple example. Glad you liked it Don. DH Next week!
One question, you used semi prime number for encryption along with public key but in practical we always work with the public key only, how does a client calculates semi prime number to be used for encryption, say a web browser encrypting using public certificate of a website ?
Great question! The "Public Key" in RSA actually consists of TWO values... the Modulus value, and the value we called "Public Key" in the lesson (in the real world this is sometimes called the "Public Exponent"). Both values are needed to do any RSA operation. =)
RSA keys by current practice are recommended to be no less than 3072 bits. At 14:38~ i show you an example of a 1024 bit number. A 1025 bit number would be twice as big. 1026 would be four times as big. And so on. So a 3072 bit number would be 2^2048 times bigger than a 1024 bit number. Needless to say... it's a *very* big number. But you are correct, the message being encrypted can never be bigger than this number. If needed, the number would have to be broken up into multiple parts. But a better solution is to use *Symmetric* encryption to encrypt larger pieces of data. ua-cam.com/video/o_g-M7UBqI8/v-deo.html
📢 *Black Friday / Cyber Monday Promotion*
👉 Practical TLS for only $50 (originally $297)
💻 Use code *BFCM2024* --> pracnet.net/tls
📅 Offer expires Dec 6
You are an incredibly gifted instructor. Can't thank you enough!
You're welcome, Mustafa. Glad you enjoyed this one too!
Indeed
Completed my graduation physics/mathematics in 1987. Read so many books, understood concepts today with this explanation. Thanks a lot..
You're very welcome, Niranjan =)
I can relate to your reply. I graduated with the same subjects in 1986. This video was very helpful in clearing the concept.
same feeling
First explanation of RSA in the world without Alice and Bob
I save those two for my DH explination =)
You make what I once thought was extremely complicated very easy to understand! You are a visual learner’s dream come true concerning public and private keys 🔑
That's so nice to hear =). The goal of every teacher is exactly that, making the complex seem simple. Glad I could help!
23/83. It's actually pretty easy with Excel. SQRT(1909) = 43.6921, so do x=1 to 44 with 1909/x. Since it's semi-prime, only one value (23) will have a whole number answer. Just to check, 23*83=1909 and both are prime. But that's 1909. Doing the same for a 100+ digit number is beyond what Excel can handle. Great video. Thanks!
Great solution. Glad you enjoyed the video =).
what did i just read... ;-;
This is awesome. We all use RSA encryption daily but I never really knew *how* all those keys worked together. Thanks for explaining it clearly and concisely.
Glad you liked it, Greg! Yes, so much happens "under the hood" that we don't appreciate. You'll like the DH video I have planned to release next week!
Awesome! I was not sooo much interested in such a deep dive, but when you started explaining I just sat and enjoyed the ride :) Thanks for your work again.
Glad you stuck around for the ride =). You're welcome, Bartosz!
Never been a fan of maths but this was one of the most fun and interesting videos to watch. Thanks for sharing !
Glad you enjoyed it =)
Ive watched a lot of videos to understand rsa but this was the only one that made me understand it! Thanks for the video!
Glad it helped!
🥳🥳 *Promotion Ended - Congrats @The.Wizard* 🥳🥳
For the rest of you, you can use this discount code for $100 off the course: YT100
classes.pracnet.net/courses/practical-tls
Subscribe + Notification bell to increase your odds of winning when the next video (and giveaway) releases!
📢📢 Practical TLS - Course Giveaway 📢📢
I'll be picking a random person from all the comments in the next 7 days on this video to give a scholarship for free access to the full Practical TLS course.
All you have to do is make a post to enter. Check back in a week to see if you won. =)
Great job. I'm interested. Thank you.
@@johnakhagbemhe552 Good luck with the drawing =)
Dang! Had I seen this I would have heaped (the deserved) praises on you instead of posting an emoji 🤣
Nice work with the video. Do you have videos like that on AES encryption?
Thanks mate! This is a top quality informative content✌
I have just started learning more about IT and I think I might have found the best channel. Please keep posting such amazing videos.
Thank you for the kind words. =) Glad to be a part of your journey.
We need more inspiring people like you. Fantastic overview
Thank you, Mr. Cool! =) I have a feeling you'll like the DH video I'm releasing monday =)
Best explanation I've ever seen of RSA. Outstanding job!
Simply the best IT channel at the whole web! I‘m so much grateful for your work!!!
Thank you for the kind words, Wayne. Cheers!
hey man i just wanted to say a big thank you, i found this video from a reddit post, i was so close to leaving this topic off from my notes because i didnt understand it but im glad i didnt, thanks again and now im off to watch your DH video
You are convincing. When you said of your difficulty and the concomitant aha moment, that got me glued to the video. Of course, the content is always insightful. You are always amazing. Thank you forever.
Glad you enjoyed this one, Azza =). DH Next, I'm sure you'll enjoy that one too!
Tnx for the clear explanation! Took me 15 minutes to implement a simple RSA encryption for my embedded project thanks to you.
Your skills in instruction are unrivaled anywhere else and helps make us all feel a little less dumb for not understanding other instructor explanations.
One of the best RSA videos that I found
How is this possible, How can you explain such a complex topic so effortlessly, Simply Brilliant, Blown away :). Thank you very much, appreciate all your efforts.
Why this channel is not having enough subscribers :(, atleast you deserve 5 million
Thanks a lot. I'm currently studying my cryptography course and this video gives me a better understanding of RSA.
Glad it was helpful!
I cant thank you enough for publishing these couses on youtube
Really awesome video, I used to think that the math behind RSA was super complicated, you made it look so easy! Thank you)
You are a gifted instructor. Thank you so much
Thakn you, Joan.
I can only reiterate what many people have already said. This is amazing contents! Thank you very much sir!
Thanks for this awesome explanations. You have the gift of condensing complex topics in an easily understandable way. Keep up the good work
You're welcome, Vipin. Thank you for the kind words.
This is one of the most effective lessons I’ve encountered on RSA🎉
U talk about technology like a fascinating story, perfect explanation, thank u
This is an awesome session of understanding RSA with a working example.
Wow Ed makes it so clear and easy to understand.
Damn, This is literally very easy. Couldn't able to understand this in my semaster and now after 10 days i have final exams for cryptography. This helped me alot
The best explanation about RSA ever heard. Thank you so much man.😇
You are the best tutor I have ever seen
7:27 Which calculator did you use ?
That's the standard windows calculator =)
@@PracticalNetworking Thank you
Best explanation of RSA ever.
Thank you, Ethan =).
this series is amazing, much needed as a fresh sysadmin. thank you!
Great job the more we learn the more we will understand 👍
Agreed! Glad you liked it!
you just blew my mind. wow. thank you for making it simple yet complex.
Excellent video ! There may not be an easier way to explain the RSA algorithm !
First time I have seen public key encryption with an example
Great and simple explanation and examples with simple numbers helps to reinforce concept
Excellent! I have a bit more understanding about RSA encryption, I use it on a daily basis in Linux, Network Devices, Bitcoin the protocol, and the Lightning Network, enlightening information Ed, thank you very much for all you do. All the very best!
Thanks again, Jair. Cheers !
What an awesome explanation. Have always wanted to understand this and your video is so concise and clear. Thanks friend.
Very clear explanation of RSA that is easy to follow!
Glad it was helpful!
Thank you! I've wondered about this for a long time. Highly appreciate your simplification and well-executed presentation =]
Absolutely amazing walktrough! :) Thanks for the math
Thank you, Peter. Glad you enjoyed it.
A long time ago (Maybe 4 years), my teacher made us design a crc decoder to detect and fix bugs. It was a very simple one that could fix just one bit, and as far as I remember, it uses kind of the same method you're using here, I cannot remember the math but it had to do with prime polynomials and fields of galois and somehow, you made me remember my student days... Anyway thanks very much this was really helpfull you're such a good instructor I really appreciate. Thanks very much 😋😋
Hopefully it was a positive nostalgic moment =). Thank you for the kind words, glad you enjoyed the video. Cheers.
Another interesting video with interesting maths behind RSA algo... Simple explanation made me to thank Ed for putting this together for everyone... 🙂
amazing work, to take this and make it understandable on the first run through is a trye gift, thanks you.
You're such a great instructor.
Ed your explanation is truly a blessing ❤❤❤
02:04 I'd like top put forward a simpler explanation/definition of a Factor: "A Factor of a number, is any number that the original number is exactly divisible by." (ie. no remainders/fractions). This definition removes the concept of "pairs" of numbers.
Yea... I like that, actually. Wish I had included it in the original video. =) Thanks for the contribution, Jonathan.
Thank You So much for this Amazing Explanation....May God Bless You......
Please please keep teaching you are really making differences in peoples life. I would love to meet you in person and/or help/contribute in anyway possible.
At 3:24 I about gasped lol 😆 was not familiar with Semi-Prime...RSA literally jumped off the screen after that! THX
Yes, that and Modulo are the common ones people haven't heard of. But they aren't too complicated terms =). Glad you enjoyed it!
Amazing explanation ...really useful and clear, thank you!!!
I was going through the video and I came across one question.
Is it necessary that the public and private key values must be greater than the two prime numbers(P,Q) chosen in the beginning?
Amazing explanation! Simply AMAZINGLY well done!!! ... Thank you.
Good to see the math behind it ! =)
Amazing explanation, so easy to understand.
How do the client and server exchange the value of N ? Seems like you cannot decrypt without N .
Well explained....2 and 3 are prime numbers if you multiply you get 6 so is 6 a factor and a semi prime number at the same time?
Yes. A number can be a factor of another number, and a semi-prime / prime at the same time.
5 and 3 are both prime. 5*3 is 15, 15 is Semi-Prime. 15 is also a factor of 30, and 45, and 60, and so on.
Best explanation on RSA 🤩. Thank you so much 😇
The encryption/decryption calculation makes use of the semi-prime. Does this form part of both the private and public keys in practice?
Yes, an RSA "public key" contains two values, the exponent and the semi prime.
(the exponent is the value we called the public key in the video)
And the exponent, E, is almost always 65537. So the unique part, which makes D unique, is actually the semi-prime.
Thank you so much. Now only I understand the RSA!!!
Perfect explanation. Thank you.
Great Video again 😄 Love the way you explain 🤟
Thanks Nadim!
@@PracticalNetworking one more question, where will you declare the result.
@@nadimakhtar97 Here, on this channel, in the comments. I'll reply to whomever wins.
Thank you sir for this video much need right now for me , preparing for interview
Excellent! Good luck. Let us know how it goes! =)
Wonderful explanation!!
So, the Encrypting entity must have the Public key of decrypting entity and the product N?
If yes , then How N will be shared ?
Wow. If I only had you as a professor.
Still enjoy watching this 2 years on 👍🏾
29 and 41 work ; 29 and 149 also work ; can one public key correspond to two private keys?
BTW great explanation, but don't receiver needs to know the value of N apart from public key in order to decrypt the cipher!! If yes how do we achieve that??
Encrypting with the Private Key and Decrypting with the Public Key is for Digital Signatures. Is this used in any other scenario? Because, for instance, Encrypting an email would be Encrypting with a Public Key and Decrypting with a Private Key.
No, that is the only scenario in which "encrypting with the private key" occurs. To be clear though, this only happens with RSA signatures. DSA signatures are generated another way. For details, read this blog post:
www.practicalnetworking.net/practical-tls/rsa-diffie-hellman-dsa-asymmetric-cryptography-explained/
Hi! Thanks for the very good explanation.
I have one question that I still couldn't figured out. You said that RSA relies on difficulty of factoring semi prime numbers. However, I cannot figure out how knowing the factors could help to find out the private key? If I take your example, we have product (N) 133 and public key (E) 29. Let's say somehow I know the factors (P,Q) 7 and 19. So, how can I calculate the private key (D) 41 out of these numbers 133,29,7,19? Maybe it's too easy but I can't do the math :)
Thanks in advance!
The prime numbers give you the totient which is used to calculate the private key. So with everything but private key, you can calculate the private key.
Amazing explanation. Many thanks.
You're welcome, Hayyan!
That was a pretty amazing tutorial, thank you for sharing
You're welcome, Mike!
You are the best instructor, teacher ever. What is your name dude?
Hi Phil. Thanks for the kind words =). My name is Ed =). This is me: practicalnetworking.net
Excellent video. Thanks very much for explaining it.
Very good explanation. Thanks man.
You're welcome =)
Thank you so much for the detailed explanation..
Can't stop clapping, this was so impressive I might just try to pursue whatever this is as a career
I get how the whole thing works from a math standpoint, but how is it put into practice? In the example you used, you said your message value equals 60. How is that message value calculated? Like, if I wanted to send "This is a sentence," what is the value of that message?
A very clear explanation. Thank you so much for that. :)
found that very interesting. although math's not my strong point and i will have to watch the math bit again (maybe a few hundred times knowing me ) it helped me understand the process a lot more. Looking forward to the DH one.
That's the whole point =) It was easier for me to understand RSA when I saw the math. I'm certainly not a mathematician, but I was able to follow with the simple example. Glad you liked it Don. DH Next week!
Excellent explanation. Thanks!
The best teacher
wow you are a great teacher...later of a few videos finally I can understand 😂
Thank you very much! I always wanted to understand it!
You're welcome 😊
One question, you used semi prime number for encryption along with public key but in practical we always work with the public key only, how does a client calculates semi prime number to be used for encryption, say a web browser encrypting using public certificate of a website ?
Great question! The "Public Key" in RSA actually consists of TWO values... the Modulus value, and the value we called "Public Key" in the lesson (in the real world this is sometimes called the "Public Exponent").
Both values are needed to do any RSA operation. =)
The numerical value of the message will never be able to be bigger than the product. How big are usually this numbers in real life usage?
RSA keys by current practice are recommended to be no less than 3072 bits. At 14:38~ i show you an example of a 1024 bit number. A 1025 bit number would be twice as big. 1026 would be four times as big. And so on. So a 3072 bit number would be 2^2048 times bigger than a 1024 bit number. Needless to say... it's a *very* big number.
But you are correct, the message being encrypted can never be bigger than this number. If needed, the number would have to be broken up into multiple parts. But a better solution is to use *Symmetric* encryption to encrypt larger pieces of data. ua-cam.com/video/o_g-M7UBqI8/v-deo.html
Thank you for answering! @@PracticalNetworking
But if someone managed to get the public key wouldn’t they can decrypt all cipher tex?
Great explanation!! 😊👍
Thank you!
very cool video, thank you for explaining with math !
If RSA needs a product term (N) to encrypt and decrypt, does it mean RSA requires to send N to both sides?
you are genius, thanks so much for your useful Videos 👍
You're welcome again, Rafay =)
Best tutorial..!!!
Thank you =)
Do every pairs of prime numbers create semi-prime number?
Wow, nice tutorial!! very clear
Thank you!