RSA algorithm step by step example

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

КОМЕНТАРІ • 152

  • @jessycagonzalez2666
    @jessycagonzalez2666 2 роки тому +39

    Finally. A good explanation on this topic with no skipped steps nor assumption about the viewers' previous knowledge. Amazing professor!

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

      Minus the use of excel to complete mod and the explanation of figuring out mod.

  • @brandonm5295
    @brandonm5295 3 роки тому +27

    I've watched and looked at so much for someone to finally break it down for a smooth brain like myself. Thanks for actually breaking things down into simple steps, with a simple example.

  • @eliaswachira5381
    @eliaswachira5381 3 роки тому +57

    This guy is super easy to understand and teaches clearly with no skipped steps. Thanks Shad. If there was no covid and you lived close by I'd take you to lunch

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

      Euler Totient ...... why every thing name after Euler in Math arena ..... 😝

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

      @Elias , By the way, if you really have lunch with Professor, make sure you pay cash, no credit card. You know that he keep both the public and private key 😂😂😂

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

      @@gagadaddy8713 stop talking please

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

      @@vengeance3102 WTF you are doing here ....

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

    THANK YOU!!....went to 5 other sources and they were crap! You are a life saver!

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

    The best tutorial on this encryption method. Thank you

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

    this is the way to teach !!!!!!!!!! lovely system of visuals ,clear speech ,clear reppresentation etc etc this is paradise after watching loads of other videos that are messy, jumbled up and only fit as a reminder for people that already know the stuff!

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

    This video is so underrated, but the best on this topic I've seen. And I've seen A LOT. Thank you so much for this.

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

    Sir, my hat off to you. Nor my book or my professor was able to explain this with such simplicity!

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

    Awesone explanation, Thanks so much! I'm not sure what I would've done without this tutorial

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

    Thanks for your video Professor Sluiter! I'am a brazilian student, and yours videos helpe me study!!

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

    You are such a genius creature on the planet earth Prof Sluiter. Hats off!

  • @An.Individual
    @An.Individual 3 роки тому +6

    Nice video.
    FYI Rivest, Sharmir & Adelman only patented RSA, they were not the first to discover it

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

    teacher thank's very much for having explained them carefully and well-deatiled, everything was clear ! , break a leg with your videos !

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

    Thank you for the thorough explanation of RSA. Very helpful.

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

    How come these smart people not have millions of views. Thank you so much , very clear an precise explaination

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

    thank you! helping me study for my cryptography final

  • @lmaoty
    @lmaoty 4 роки тому +5

    Very simple to understand! Keep up the great job!

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

    This one so far is the best explanation on RSA I have come across. Thank you, Prof!

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

    Hands down the best video and explanation I’ve seen thus far! Thank you!!!! 🥲

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

    great teacher, now I can solve my assignment after watching your video

  • @卢坤-d7s
    @卢坤-d7s Рік тому

    Thank you very much. You help me solve the issue bothering me for a long time

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

    Best explanation on the internet 🎉

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

    I simply loved the explanation, this was great. Your way of explaining the algo was quite smooth and smile. Thank you.

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

    Great job explaining this!!! I would take a class under this professor anytime.

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

    Step by Step makes sense!!

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

    What a clear presentation of RSA. THANKS so much.

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

    Very informative and useful. Also explained in simple terms. Thank you very much Sir.

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

    Brilliant, so easy to understand. Amazing. Thank you so much!

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

    It's very easy to understand, thank you very much for your work!

  • @natisnotanerd
    @natisnotanerd 4 місяці тому

    I love you Professor Sluiter

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

    Great explanation, thanks a lot!

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

    Brilliant explanation !!

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

    Illuminating! Thank you

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

    best video till now

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

    Thank you so much. I'm taking a class for this same topic and you break it down so easily.

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

    Your walkthrough in excell was very helpful. Thank you for the effort!

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

    Amazing! Thank you very much

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

    Professional as usual! Thanks!

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

    really helpful man thank you

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

    THANK YOU SO MUCH YOU ARE A LIFE SAVER

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

    Very good explanation, thanks!

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

    Thank you sir! Comprehensible lecture!

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

    wonderful explanation, thanks a ton.

  • @CO-wd3pc
    @CO-wd3pc 2 роки тому

    Best teacher 🙌

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

    thanks for teaching, very clear now.

  • @charliemelga7445
    @charliemelga7445 2 роки тому +5

    Thanks very much for posting very helpful , I have a few questions please as there are a few things about the video I do not quite grasp.
    Can you please explain the follows: In Column 'A' of the spreadsheet the rule is 'must be a coprime of 6 and 14' when I look up the definition of coprime it says "Co-prime numbers are the numbers whose common factor is only 1"
    You rules out the number 2 and 4,
    I can see why you rule out 2 because 6 / 2 = 3 and 14 / 2 = 7 (so their only factor is not 1).
    However taking the 4, 6 /4 = 1.5 and 14 /4 = 3.5 (in other words not pure integers, and I though the result had to be a pure integer i.e. not remainder)? or do you always remove even numbers before starting the maths?
    Can you please explain/clarify the above for me.
    One a related note, I did not realise the private / public keys are actually 2 numbers (e.g. two numbers each key) working together. Given a public key do not know of a script (preferably using PoweShell) where I can split the representation of a public key (e.g. byte array) into the two distant values to see that they are ?
    Thank you very much again for posting :)

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

      I was stuck on this too and had to do some googling. When he mentioned the rule that the numbers must be a coprime of 6 AND 14, he meant that 2,3,4,5 has to be coprime with BOTH 6 and 14, or they must share a greatest common factor of only 1.
      In the case of 4, it will never have a greatest common factor of only 1 because 2 is a factor of 4. It is not asking if 4 is a factor of 6 and 14, which is where I think you were confused about.
      In the case of 3, its only factor is 1 and itself, but 3 is a factor of 6, which is ruled out.
      5 is the only coprime of both 6 and 14, where they all share a greatest common factor of only 1.
      For your second question, it is extremely hard to find the private key based on the public key because you would need to find two large prime numbers just like he mentioned in the beginning of the video. Modern computers today are not capable of finding those primes but maybe someday when we reach quantum computing.
      Hope this helped.

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

    Great lecture, thanks!

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

    Thank you so much, now everythig become clear)

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

    So as far as I understand there can be more than 1 private keys d that work the exact same way to decrypt a message.Isn't that a vulnerability?

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

    Thanks for thr nice explanation. One of the best and easy to understand

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

    Fantastic!

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

    Great Work Shad!!

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

    I don't get one thing, the decrypt number "d" can be 5, 11 and 17. And 5 is the same as the encryption key.
    What stops an attacker from using 5 instead of 11 to decrypt the message, since all of these 3 values can decrypt it?

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

      I have the same question, using the public key(5,14) can also decrypt the letter "D" out to "B", looking forward to an answer too.

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

    good explanation, however from your example you could have chosen multiple keys. This means that for each public key there are multiple private keys?

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

    Great stuff Professor!

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

    confused during the explanation of the decryption where does the 32 mod 14 come from?

  • @marianopatino-paul5062
    @marianopatino-paul5062 2 роки тому

    Great video

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

    A great video.

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

    So I get that we are calling message "B" as 2, but what's the typical way of converting a longer message to a numeric value ? If I wanted the send the message "Hi" how would I get an "m" to feed into the algorithm

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

    Great explanation

  • @daboyz6106
    @daboyz6106 11 місяців тому

    Really good.

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

    Amazing... keep it up

  • @Astro-Markus
    @Astro-Markus Рік тому

    I understand what's happening here, however nobody encrypts anything just to decrypt it again afterwards. You want to send the encrypted message to someone who can decrypt it. And you certainly don't send them your private key. And the receiver has their own private key, which is most probably based on different prime numbers. So, how does that work together with the public key?

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

    In the real world, don't you need to make sure that N is large enough to cover the symbol range you wish to encrypt?
    E.g. for alpha text, 1.. 26 --> T >= 27. And then you need two primes whose multiple is >= 27, say (3,11), (5,7). Of course it'll be (Yuge prime, Bigly prime), but I'm just asking about the "min" value for p, q.
    Would 0.. 25 be allowed? It would handle the number of symbols, but I'm not sure if 0 would break any of the math.

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

    Great video - Could some one explain - at 8.08 he mentions you can't use 4 because it is even, leaving us with 5. In my head though the factors of 6 and 14 are 1,2,7,14 and 1,2,3,6. Why not even?

    • @Jamie-ef9dl
      @Jamie-ef9dl 3 роки тому +6

      Bit late but the requirement is they need to be Coprime, so they cannot share factors, as 4 has factors 1,2,4 they all share a factor of 2 which is why

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

      @@Jamie-ef9dl Much appreciated.

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

    encypting o with (5,14) give a, and decrypting a with (11,14) gives a.
    how to get o instead of a after decryption?

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

    for finding e, whyd you choose 14?? and how is 4 coprime for 6 and 14???

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

    i am still lost on how to find the e and d. at the part where you choose a co-prime, and the entire process for d.

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

    This was so easy to understand. Can you do one for elliptical curves primarily for Bitcoin?

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

      Thank you. Not planning on the elliptical curves. However, can you suggest a resource?

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

    Nice video. Must e and d be integers? Are there special rules that these two numbers need to follow?
    In Excel you said that e < T and e must be coprime with T and N. But you didn't say that in the beginning.

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

      This is for entertainment. Not a msth course.

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

    Nice video dude

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

    but when the message is encrypted using the public key and once we have the encrypted message, one can always reverse engineer to breakdown the message. This method of encryption is only useful when the public key generates different encryption text even after giving it the same input message.

  • @otooleger
    @otooleger 4 роки тому +1

    very interesting. I wonder how many 'secret' documents from the 1990's are now unsecure?

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

      Probably most of them by now.

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

    why does "de (modN) =1" - what's the basis of this?

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

    Amazing

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

    For I = 2 to (amount - 1): if (( amount mod I) = 0) then print I :next i

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

    Very well explained sir, but if you use the encoding as A=1 , it will not get encrypted since 1^e mod N = 1 ... so i guess just using normal ascii code is a better way of doing things?

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

      it IS encrypted, it just happens to be encrypted to the same value but that is unknown to the public, next letters will be encoded to something different

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

    Can any one please reply me..?
    I've got d value as 0 , what to do if we get as such... Please reply faster no time... 😭

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

    bilale anlatır gibi anlatmış. helal olsun!

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

    Hi, question. How would you encrypted a message that is a word or even a sentence e.g. "hello"?

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

    I presume this video explains RSA simple way but this method crypts letters always into same number, which makes it valuable to letter frequency decryption (extremely easy to solve). How is it sorted?

  • @najeebbenawa
    @najeebbenawa 4 роки тому

    1. for the part of choosing e and d, we got the 6 is T and the 14 is N. Is this correct?
    2. how was 5 coprime with 6 and 14? Can you elaborate this 2, 3, 4 removal process and reasons?

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

      1. N=14 and T=6, that is correct, yes
      2. Two numbers are co prime if they have no positive integer that can divide both, except for 1.
      - we remove 2 because the factors of 2 are: 1, 2 , the factors of 6 are: 1, 2, 3 and the factors of 14 are: 1, 2, 7, 14. We can see that 2 and 6 are not co prime, since the have two common factors (1 and 2). For the same reason 2 and 14 are not co prime.
      - we remove 3 because the factors of 3 are: 1, 3. We can see that 3 and 6 are not co prime, since the have two common factors (1 and 3). Even though 3 is co prime with 14, we need a number that is co prime with both 6 and 14.
      - we remove 4 because the factors of 4 are: 1, 2, 4. We can see that 4 and 6 are co prime, since the only common factor is 1 and the same thing goes for 14. But 4 is an even number and if we choose even numbers there is a possibility that (e x d) mod T will not be 1. (the same logic could be applied to 2)
      - we are left with 5 and we keep it, because 5 has no common factors with either 6 or 14, except 1, so 5 and 6 are co prime and 5 and 14 are co prime.
      I hope this cleared things out for you!

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

      Thanks, i was also this question in my mind. Now it clear to me

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

    Thanks!

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

      You bet! Are you studying computer science?

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

    Can anyone explain why the decrypt step works or where to find that information? I understand the steps but what rules in modular arithmetic lead to the original data being the result of the equation.

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

    Im lost how on how 5 is a number co prime with 6 and 14?

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

    Great content sir,
    but let me try coding the letter m by its code ASCII=109
    Coding RSA gives 109^5(mod 14) = 9
    Decoding RSA gives 9^11(mod 14) = 11
    We know that 109 (mod 14) = 11
    Decoding gives multiple solutions, so we cannot retreive only original number that is 109
    Could you clarify ?
    Regards

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

      Hey i might be late but you cant encrypt where n < message

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

      @@gd44481 in my experience, when implementing any hash function, the mod value must be > than the length of the array holding the data.

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

      @@ryklin1 encypting o with (5,14) give a, and decrypting a with (11,14) gives a.
      how to get o instead of a after decryption?

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

    Hi, do the primes you encrypt with have to be much larger than the values you are encrypting? I am trying to encrypt the number 77 with your cipher:
    m = 77
    77^5 mod14 = 7 (encrypting)
    C = 7
    7^11 mod14 = 7 (decrypting)
    M = 7

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

      hello felix I feel your pain!! I don't know for sure, however this should always work. My theory is that the larger the number you used the more accurate that your calculator or whatever you are using has to be before rounding.

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

      Hello, m can not be bigger than n

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

    thanks mn

  • @Kevin-kk2rx
    @Kevin-kk2rx 3 роки тому +1

    I tried some different messages using the keys you used here and found any message that exceeds n(14 in this case) will not decrypt correctly. Is this an error on my part or is this a normal limitation of rsa?

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

      Thats a limitation

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

    buy how does an computer decides which two huge prime numbers to chose? How does he know they are prime?

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

    yoo does someone know how would u do it with actual text? I've read that you must convert it into numbers and in the video he says that u must use ASCII but how? I would appreciate if u had some material about how to do it without the B=2 thing ( min 11:30 ) .

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

      There are countless text to ascii converters on the internet. But rsa can only encrypt up to the size of the key, so you would have to generate huge primes to encrypt any meaningful message.
      (What you can do is encrypt the text with AES and then encrypt the AES key with rsa)

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

      Also, you dont have to use ASCII.
      If you really want to encrypt with only rsa then convert every letter of the text to ascii and encrypt each one and maybe store them in an array or something.

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

    Can you explain why decrypting RSA without knowing the privately held prime factor is difficult?

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

      Without that prime factor you can not decrypt. Find that factor is not at all simple, there isn't a simple and efficient way of doing that. While it may not be apparent when working with small numbers it becomes very difficult with numbers that are hundreds digits long. There is a section in the video starting from 15:37 which is related to that. For example a 232 decimal digits number was factored in 2009 and an "only" 8 digits longer (240 digits) were factored in 2019. Adding 8 digits took another 10 years to solve. Now, the most recent RSA numbers have hundreds more digits. Unless something revolutionary happens (e.g. success of quantum computers) I think we are safe.

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

    Is it a problem the decrypted “2” is not exactly integer?

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

      32 mod 4 is exactly 2. In the video what you see is a an approximation since the calculator can not be that precise.
      Another way of calculating that is that 299,593 x 14 = 4,194,302 which is exactly 2 less than the number in question (4,194,304).

  • @deafmute2501
    @deafmute2501 11 днів тому

    If I had some magical device that found the other prime number of RSA-2048, I wouldn't necessarily put it out there.

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

    Does anyone know how to get the d variable as fast as possible in python?

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

    tankes pro

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

    where does 14 came from ??????

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

    why dislike?

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

    I think there is a mistake in your example. (ua-cam.com/video/j2NBya6ADSY/v-deo.html) When I send an encrypted message (encrypted with his public key) to a friend, he doesn't need my public key to decrypt it. Because he can only decrypt it with his private key. So there is not any relation between my public key and the message which I send to him. What do you think about it?

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

      I think you are right. If I send a message to you I would need your public key so I can encrypt the message and you will need your own private key to decrypt that.

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

      You’re right, he mixed up examples in his explanation. He was referring to a cryptographic signature. The signature process is a way of proving the message came from you.
      To sign a message, you encrypt it with your private key. That encrypted message can be decrypted by your public key, which everyone should have. The point of that encryption isn't to hide the contents, it's to prove that it was written by you. If the message gets decrypted properly with your public key, then it must've come from you because only you (should) have the private key it was encrypted with.
      Getting back to this mixup. When you send someone a message, you want to encrypt it with their public key but you ALSO want to sign it with your private key, so your friend knows it really came from you and not an imposter.
      That's why your friend would need their private key and your public key. Their private key would be used to decrypt and your public key would be used to authenticate the encrypted signature you included.

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

      @@MichaelApproved for digital signature is not about the encryption of the whole document, is about obtaining a hash (a short string of the document) and that is signature and is obtained with the use of the private key (the sender uses his private key to create the digital signature hash). Then the receiver use sender's public key to verify that the hash is autentic, to confirm the signature was created with the real private key.

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

    where the 14 came from ? minute 7.58