RSA Algorithm - How does it work? - I'll PROVE it with an Example! -- Cryptography - Practical TLS

Поділитися
Вставка
  • Опубліковано 22 гру 2024

КОМЕНТАРІ •

  • @PracticalNetworking
    @PracticalNetworking  3 роки тому +8

    📢 *Black Friday / Cyber Monday Promotion*
    👉 Practical TLS for only $50 (originally $297)
    💻 Use code *BFCM2024* --> pracnet.net/tls
    📅 Offer expires Dec 6

  • @mertcancam
    @mertcancam 3 роки тому +104

    You are an incredibly gifted instructor. Can't thank you enough!

  • @niranjanphadke
    @niranjanphadke 3 роки тому +40

    Completed my graduation physics/mathematics in 1987. Read so many books, understood concepts today with this explanation. Thanks a lot..

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому +3

      You're very welcome, Niranjan =)

    • @humayoonkhan2797
      @humayoonkhan2797 9 місяців тому +1

      I can relate to your reply. I graduated with the same subjects in 1986. This video was very helpful in clearing the concept.

    • @dongmingyao6428
      @dongmingyao6428 8 місяців тому

      same feeling

  • @pradeeshbm5558
    @pradeeshbm5558 11 місяців тому +48

    First explanation of RSA in the world without Alice and Bob

  • @TheMrNatoShow
    @TheMrNatoShow 3 роки тому +26

    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 🔑

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому +2

      That's so nice to hear =). The goal of every teacher is exactly that, making the complex seem simple. Glad I could help!

  • @alexanderkrizel6187
    @alexanderkrizel6187 Рік тому +14

    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!

  • @GregDickinson75
    @GregDickinson75 3 роки тому +6

    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.

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому

      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!

  • @WhiteZorin
    @WhiteZorin 3 роки тому +7

    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.

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому

      Glad you stuck around for the ride =). You're welcome, Bartosz!

  • @dustcore
    @dustcore 2 роки тому +9

    Never been a fan of maths but this was one of the most fun and interesting videos to watch. Thanks for sharing !

  • @user-be6wb1vd7w
    @user-be6wb1vd7w Рік тому +1

    Ive watched a lot of videos to understand rsa but this was the only one that made me understand it! Thanks for the video!

  • @PracticalNetworking
    @PracticalNetworking  3 роки тому +4

    🥳🥳 *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. =)

    • @johnakhagbemhe552
      @johnakhagbemhe552 3 роки тому +1

      Great job. I'm interested. Thank you.

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому

      @@johnakhagbemhe552 Good luck with the drawing =)

    • @johnnyq4260
      @johnnyq4260 3 роки тому +1

      Dang! Had I seen this I would have heaped (the deserved) praises on you instead of posting an emoji 🤣

    • @IIDarknightII
      @IIDarknightII 3 роки тому +1

      Nice work with the video. Do you have videos like that on AES encryption?

    • @pravinkalake995
      @pravinkalake995 3 роки тому +1

      Thanks mate! This is a top quality informative content✌

  • @sillycut1169
    @sillycut1169 2 роки тому +1

    I have just started learning more about IT and I think I might have found the best channel. Please keep posting such amazing videos.

    • @PracticalNetworking
      @PracticalNetworking  2 роки тому

      Thank you for the kind words. =) Glad to be a part of your journey.

  • @fsl001
    @fsl001 3 роки тому +4

    We need more inspiring people like you. Fantastic overview

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому +1

      Thank you, Mr. Cool! =) I have a feeling you'll like the DH video I'm releasing monday =)

  • @deany1620
    @deany1620 17 днів тому

    Best explanation I've ever seen of RSA. Outstanding job!

  • @wayneinteressierts9973
    @wayneinteressierts9973 3 роки тому +1

    Simply the best IT channel at the whole web! I‘m so much grateful for your work!!!

  • @OmarAhmed-fh2nu
    @OmarAhmed-fh2nu 12 днів тому

    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

  • @adedejiemmanuel1
    @adedejiemmanuel1 3 роки тому +1

    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.

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому

      Glad you enjoyed this one, Azza =). DH Next, I'm sure you'll enjoy that one too!

  • @MusaYmc
    @MusaYmc 2 роки тому

    Tnx for the clear explanation! Took me 15 minutes to implement a simple RSA encryption for my embedded project thanks to you.

  • @ChitChat
    @ChitChat Рік тому

    Your skills in instruction are unrivaled anywhere else and helps make us all feel a little less dumb for not understanding other instructor explanations.

  • @rschmidtzalles
    @rschmidtzalles Рік тому +1

    One of the best RSA videos that I found

  • @imranhussain8700
    @imranhussain8700 Рік тому

    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

  • @Segmentation_fault
    @Segmentation_fault 11 місяців тому +1

    Thanks a lot. I'm currently studying my cryptography course and this video gives me a better understanding of RSA.

  • @danialranjbar9805
    @danialranjbar9805 Рік тому

    I cant thank you enough for publishing these couses on youtube

  • @yerzhansalkynbayev6174
    @yerzhansalkynbayev6174 Рік тому

    Really awesome video, I used to think that the math behind RSA was super complicated, you made it look so easy! Thank you)

  • @joanbahati6260
    @joanbahati6260 2 роки тому +2

    You are a gifted instructor. Thank you so much

  • @cxl26
    @cxl26 Рік тому

    I can only reiterate what many people have already said. This is amazing contents! Thank you very much sir!

  • @vipingeorgevu3yvg904
    @vipingeorgevu3yvg904 3 роки тому +2

    Thanks for this awesome explanations. You have the gift of condensing complex topics in an easily understandable way. Keep up the good work

  • @preciousmposa1363
    @preciousmposa1363 Рік тому

    This is one of the most effective lessons I’ve encountered on RSA🎉

  • @ashkannasirzadeh1052
    @ashkannasirzadeh1052 3 місяці тому

    U talk about technology like a fascinating story, perfect explanation, thank u

  • @GalacticTheOne
    @GalacticTheOne 2 місяці тому

    This is an awesome session of understanding RSA with a working example.

  • @maestrocorporate5804
    @maestrocorporate5804 2 місяці тому

    Wow Ed makes it so clear and easy to understand.

  • @awaisraza2285
    @awaisraza2285 Рік тому

    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

  • @tr7343
    @tr7343 Рік тому

    The best explanation about RSA ever heard. Thank you so much man.😇

  • @gyangp810
    @gyangp810 3 місяці тому

    You are the best tutor I have ever seen

  • @WahranRai
    @WahranRai Рік тому +2

    7:27 Which calculator did you use ?

  • @ethanhalprin
    @ethanhalprin 2 роки тому +1

    Best explanation of RSA ever.

  • @j0rss
    @j0rss Рік тому

    this series is amazing, much needed as a fresh sysadmin. thank you!

  • @bouramadiallo4892
    @bouramadiallo4892 3 роки тому +1

    Great job the more we learn the more we will understand 👍

  • @Byassch
    @Byassch 9 місяців тому

    you just blew my mind. wow. thank you for making it simple yet complex.

  • @satishsj
    @satishsj 10 місяців тому +1

    Excellent video ! There may not be an easier way to explain the RSA algorithm !

  • @wijpke
    @wijpke Рік тому +1

    First time I have seen public key encryption with an example

  • @sreeramthokala
    @sreeramthokala Рік тому +1

    Great and simple explanation and examples with simple numbers helps to reinforce concept

  • @jairunet
    @jairunet 2 роки тому +1

    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!

  • @willk7184
    @willk7184 10 місяців тому

    What an awesome explanation. Have always wanted to understand this and your video is so concise and clear. Thanks friend.

  • @markthrasher4548
    @markthrasher4548 Рік тому +1

    Very clear explanation of RSA that is easy to follow!

  • @C0ttageChees
    @C0ttageChees Рік тому +1

    Thank you! I've wondered about this for a long time. Highly appreciate your simplification and well-executed presentation =]

  • @peterchmelar8886
    @peterchmelar8886 3 роки тому +3

    Absolutely amazing walktrough! :) Thanks for the math

  • @warcryplayer5751
    @warcryplayer5751 2 роки тому +1

    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 😋😋

    • @PracticalNetworking
      @PracticalNetworking  2 роки тому +1

      Hopefully it was a positive nostalgic moment =). Thank you for the kind words, glad you enjoyed the video. Cheers.

  • @renujain8911
    @renujain8911 Рік тому

    Another interesting video with interesting maths behind RSA algo... Simple explanation made me to thank Ed for putting this together for everyone... 🙂

  • @mikehavekin3394
    @mikehavekin3394 Рік тому

    amazing work, to take this and make it understandable on the first run through is a trye gift, thanks you.

  • @cafeden6868
    @cafeden6868 3 місяці тому

    You're such a great instructor.

  • @offensiveredteam
    @offensiveredteam Рік тому

    Ed your explanation is truly a blessing ❤❤❤

  • @JonathanLindeque
    @JonathanLindeque 2 роки тому +3

    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.

    • @PracticalNetworking
      @PracticalNetworking  2 роки тому +3

      Yea... I like that, actually. Wish I had included it in the original video. =) Thanks for the contribution, Jonathan.

  • @BabliShil
    @BabliShil 2 роки тому +1

    Thank You So much for this Amazing Explanation....May God Bless You......

  • @jug94
    @jug94 2 місяці тому

    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.

  • @VideosfromElle
    @VideosfromElle 3 роки тому +1

    At 3:24 I about gasped lol 😆 was not familiar with Semi-Prime...RSA literally jumped off the screen after that! THX

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому +2

      Yes, that and Modulo are the common ones people haven't heard of. But they aren't too complicated terms =). Glad you enjoyed it!

  • @AzzurraMoscia
    @AzzurraMoscia 9 місяців тому +1

    Amazing explanation ...really useful and clear, thank you!!!

  • @Nayab492
    @Nayab492 7 місяців тому +1

    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?

  • @sentikironde9543
    @sentikironde9543 6 місяців тому

    Amazing explanation! Simply AMAZINGLY well done!!! ... Thank you.

  • @adnaneafifi2234
    @adnaneafifi2234 2 роки тому +1

    Good to see the math behind it ! =)

  • @zxtqwwr0
    @zxtqwwr0 3 місяці тому

    Amazing explanation, so easy to understand.

  • @aabhishek4911
    @aabhishek4911 6 місяців тому +1

    How do the client and server exchange the value of N ? Seems like you cannot decrypt without N .

  • @kimosopsimion
    @kimosopsimion Рік тому +1

    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?

    • @PracticalNetworking
      @PracticalNetworking  Рік тому

      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.

  • @rajdippal51
    @rajdippal51 Рік тому

    Best explanation on RSA 🤩. Thank you so much 😇

  • @maltaparkhelp
    @maltaparkhelp Рік тому +1

    The encryption/decryption calculation makes use of the semi-prime. Does this form part of both the private and public keys in practice?

    • @PracticalNetworking
      @PracticalNetworking  Рік тому

      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)

    • @OldtimerOfSweden
      @OldtimerOfSweden Рік тому

      And the exponent, E, is almost always 65537. So the unique part, which makes D unique, is actually the semi-prime.

  • @razeef123
    @razeef123 Рік тому

    Thank you so much. Now only I understand the RSA!!!

  • @alicaljungberg3742
    @alicaljungberg3742 8 місяців тому +1

    Perfect explanation. Thank you.

  • @nadimakhtar97
    @nadimakhtar97 3 роки тому +2

    Great Video again 😄 Love the way you explain 🤟

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому

      Thanks Nadim!

    • @nadimakhtar97
      @nadimakhtar97 3 роки тому +1

      @@PracticalNetworking one more question, where will you declare the result.

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому

      @@nadimakhtar97 Here, on this channel, in the comments. I'll reply to whomever wins.

  • @arunsankpal4219
    @arunsankpal4219 3 роки тому +1

    Thank you sir for this video much need right now for me , preparing for interview

  • @KashiNatureVibes
    @KashiNatureVibes 10 днів тому

    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 ?

  • @robertroy1878
    @robertroy1878 Рік тому

    Wow. If I only had you as a professor.

  • @dustcore
    @dustcore 6 місяців тому

    Still enjoy watching this 2 years on 👍🏾

  • @datvuong7420
    @datvuong7420 Рік тому

    29 and 41 work ; 29 and 149 also work ; can one public key correspond to two private keys?

  • @honeykamboj7508
    @honeykamboj7508 8 місяців тому

    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??

  • @adriennecrosby4105
    @adriennecrosby4105 9 місяців тому +1

    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.

    • @PracticalNetworking
      @PracticalNetworking  9 місяців тому

      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/

  • @theuser1240
    @theuser1240 Рік тому +1

    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!

    • @simplifiedprogramming
      @simplifiedprogramming Рік тому

      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.

  • @hayanamer1652
    @hayanamer1652 2 роки тому +1

    Amazing explanation. Many thanks.

  • @mikemccartneyable
    @mikemccartneyable 3 роки тому +1

    That was a pretty amazing tutorial, thank you for sharing

  • @phil5293
    @phil5293 2 роки тому +1

    You are the best instructor, teacher ever. What is your name dude?

    • @PracticalNetworking
      @PracticalNetworking  2 роки тому

      Hi Phil. Thanks for the kind words =). My name is Ed =). This is me: practicalnetworking.net

  • @TheRapidram
    @TheRapidram Рік тому

    Excellent video. Thanks very much for explaining it.

  • @pasindusrl
    @pasindusrl 2 роки тому +1

    Very good explanation. Thanks man.

  • @anoopthomasn1
    @anoopthomasn1 7 місяців тому

    Thank you so much for the detailed explanation..

  • @nakulkumar9363
    @nakulkumar9363 Рік тому

    Can't stop clapping, this was so impressive I might just try to pursue whatever this is as a career

  • @markdisanzo3796
    @markdisanzo3796 Рік тому

    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?

  • @Vivian-ve1qt
    @Vivian-ve1qt Рік тому

    A very clear explanation. Thank you so much for that. :)

  • @Don-Carillo
    @Don-Carillo 3 роки тому +1

    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.

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому +1

      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!

  • @meirgold
    @meirgold Рік тому

    Excellent explanation. Thanks!

  • @walidshoura
    @walidshoura Рік тому

    The best teacher

  • @RagazzaInk
    @RagazzaInk 5 місяців тому

    wow you are a great teacher...later of a few videos finally I can understand 😂

  • @kolex023
    @kolex023 2 роки тому +1

    Thank you very much! I always wanted to understand it!

  • @gauravbhatt13
    @gauravbhatt13 3 роки тому +3

    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 ?

    • @PracticalNetworking
      @PracticalNetworking  3 роки тому +2

      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. =)

  • @dumbelfo
    @dumbelfo Рік тому +1

    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?

    • @PracticalNetworking
      @PracticalNetworking  Рік тому

      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

    • @dumbelfo
      @dumbelfo Рік тому

      Thank you for answering! @@PracticalNetworking

  • @kananahmed
    @kananahmed 5 місяців тому

    But if someone managed to get the public key wouldn’t they can decrypt all cipher tex?

  • @maxmaster9908
    @maxmaster9908 3 роки тому +1

    Great explanation!! 😊👍

  • @wildmanjeff42
    @wildmanjeff42 2 місяці тому

    very cool video, thank you for explaining with math !

  • @ntquyminh
    @ntquyminh 8 місяців тому

    If RSA needs a product term (N) to encrypt and decrypt, does it mean RSA requires to send N to both sides?

  • @rafay1708
    @rafay1708 3 роки тому +1

    you are genius, thanks so much for your useful Videos 👍

  • @manjunathkp7315
    @manjunathkp7315 2 роки тому +1

    Best tutorial..!!!

  • @pajeetsingh
    @pajeetsingh Місяць тому

    Do every pairs of prime numbers create semi-prime number?

  • @IIDarknightII
    @IIDarknightII 3 роки тому +1

    Wow, nice tutorial!! very clear