How RSA Encryption Works

Поділитися
Вставка
  • Опубліковано 28 чер 2024
  • ₿💰💵💲Help Support the Channel by Donating Crypto💲💵💰₿
    Monero
    45F2bNHVcRzXVBsvZ5giyvKGAgm6LFhMsjUUVPTEtdgJJ5SNyxzSNUmFSBR5qCCWLpjiUjYMkmZoX9b3cChNjvxR7kvh436
    Bitcoin
    3MMKHXPQrGHEsmdHaAGD59FWhKFGeUsAxV
    Ethereum
    0xeA4DA3F9BAb091Eb86921CA6E41712438f4E5079
    Litecoin
    MBfrxLJMuw26hbVi2MjCVDFkkExz8rYvUF
    Dash
    Xh9PXPEy5RoLJgFDGYCDjrbXdjshMaYerz
    Zcash
    t1aWtU5SBpxuUWBSwDKy4gTkT2T1ZwtFvrr
    Chainlink
    0x0f7f21D267d2C9dbae17fd8c20012eFEA3678F14
    Bitcoin Cash
    qz2st00dtu9e79zrq5wshsgaxsjw299n7c69th8ryp
    Etherum Classic
    0xeA641e59913960f578ad39A6B4d02051A5556BfC
    USD Coin
    0x0B045f743A693b225630862a3464B52fefE79FdB
    Subscribe to my UA-cam channel goo.gl/9U10Wz
    and be sure to click that notification bell so you know when new videos are released.
  • Наука та технологія

КОМЕНТАРІ • 142

  • @larry_the
    @larry_the 3 роки тому +67

    2:31 Luke Smith before he became Luke Smooth

  • @scrollzpalace1760
    @scrollzpalace1760 3 роки тому +28

    I have a paper due this week about aes, rsa, and blowfish and you’ve been clutch bro

    • @webbugt
      @webbugt 3 роки тому +5

      Just make sure to properly mark citations and sources! :)

  • @NicholasHenkey
    @NicholasHenkey 3 роки тому +81

    You got a positive shout out from Luke Smith today

  • @LiborTinka
    @LiborTinka 3 роки тому +37

    If you want full understanding of the RSA cryptosystem (to the point of being able to program it), I advice reading "Introduction to Algorithms" (Cormen, Leiserson, Rivest, Stein) - the book also explains many related algorithms, like the Pollard Rho Method (generation of large, high-probability prime numbers).

  • @luwu5396
    @luwu5396 3 роки тому +22

    5:04 You said the size of your RSA public key is "248 bits, or 256 bytes". I think you meant 2048 bits, 2048 bits / 8 bits per byte = 256 bytes.

  • @N.S.A.
    @N.S.A. 3 роки тому +159

    Please stop.

    • @andrew___3233
      @andrew___3233 Рік тому +8

      LoL, NSA angry on this.

    • @the_wizard_exe
      @the_wizard_exe Рік тому +7

      Allow snowden explain it powerly , please !

    • @privateassman8839
      @privateassman8839 7 місяців тому +4

      I lost my banking info. Can you pwease get it back fow me? 🥺

  • @mskiptr
    @mskiptr 3 роки тому +17

    It's important to remember that you still have to be sure you got the right public key!
    Maybe a video on roots of trust (for websites, secure boot, …) and their alternatives (safety number in Signal, networks of trust, etc.)?

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

    Spot on.
    You’d encrypt outgoing messages with the recipient’s public key
    You’d encrypt with your private key for signature purposes. I’m not aware of any other reasons.
    The whole idea with both encryption and hashing in general is that they’re easy to perform in one direction and exceedingly difficult in the other.

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

    Excellent video, thank you so much! Like so many others, I've used certs and digital signatures for years but never taken the time to understand what's happening and this video helped me understand it better.

  • @fawzanfawzi9993
    @fawzanfawzi9993 3 роки тому +48

    Honestly, this is much more understandable than AES.

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

      Yes, but the encryption / decryption is slower. Usually this is used to hand off AES keys

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

      Both are easily understandable when simplified. The math of RSA, when including all the steps to make is secure, not just textbook RSA, gets pretty complicated. The math to break these ciphers ever more so.

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

    I like to think of the public key as a Lockable padlock, those kind in lockers that you can push in the shackle and it locks, but then you need the key to unlock it. thus the private key is the key, the padlock is that public one that anyone can use to lock their parcel in a cage with, and send it to you to open it

  • @matejzatko2085
    @matejzatko2085 3 роки тому +11

    I would appreciate more visual aid in these videos. In my opinion it would make the videos more understandable and it would be easier to follow what you're talking about. Btw thanks for the educational content 👍

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

      yeah i enjoyed the video and wanted to share it with my classmates, but i knew they'd get bored or smtng :/

  • @LuxuriantCarrot
    @LuxuriantCarrot 3 роки тому +29

    7:30 when the rsa key is sus 😳

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

      your public key kinda sus 🤔😳

  • @aspen.coloradx
    @aspen.coloradx 3 роки тому +8

    Will you do a video about SHA256 too?

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

    Yup bro a little demostration on terminal would also make this more understandable

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

    While AES is somewhat robust against quantum computers, RSA would be totally broken by it.

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

    Thanks. Apriciate your work. Support from Italy

  • @YuriiLebid-op1xv
    @YuriiLebid-op1xv 2 роки тому

    Finally I understand it!!! Great Thanks!

  • @LuxuriantCarrot
    @LuxuriantCarrot 3 роки тому +19

    3:30 I think you got it the other way around. You encrypt with your public key, and decrypt with your private key.

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

      What he means is signating, or how it‘s called in English. Due to the difficulty of getting the private key by its public key and the fact that only you have acccess to it, every file that is encrypted with your private key can be decrypted by your public key, so people can make sure that you sent that.
      Edit: He said it in the video at 6:50

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

      @@yrws6756 wait so encrypting with a public key allows it to be dexrypted with the private key, and the reverse is also true?

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

      @@char8169 yes, technically either key could be used as the public key, or vice versa. Which ever key is used to encrypt only the other key can decrypt.

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

      Most of the time, the public key is used for encryption yes. But if you want your message to be read by everyone, you'd encrypt it with your private key and everyone else would have your public key to decrypt it in order to see it.

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

      @@Faithhh071 Which is what we do when we want people to know a message definitely came from us, and not from someone pretending to be us, since if it can be decrypted by our public key, then it was definitely encrypted with our private key. That's what a digital signature is.

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

    LMAO, literally watch your videos for fun. I never thought id see one of your videos when studying for classes.

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

    Now normally what is used is *diffie hellman key exange* / *eliptic curve* to get a key, and with that key we use AES to encrypt the communications. RSA is used for certificates

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

      Even for signing certificates elliptic curves are much better. They're much less prone to mistakes and require much shorter keys to get the same level of security.

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

      ​​@@deidara_8598 theories in encryption groups have been around for a while that the NSA has cracked/backdoored elliptic curves. They pushed elliptic curves hard for the longest time and eventually people got suspicious.

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

    I feel like one of my teachers will use this video in the future

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

    love from india bro 🇮🇳☮️

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

    PGP (GPG) next please !! 😆

  • @jacobblomquist5288
    @jacobblomquist5288 3 роки тому +5

    Nice. You should do elliptic curve next!

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

      Or the diffie helman key exchange

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

    Thanks for explaining this easy!

  • @censoredterminalautism4073
    @censoredterminalautism4073 3 роки тому +13

    These videos make the CIA very upset.

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

    I love your videos dude.

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

    i like your "Works" series

  • @micmacha
    @micmacha Рік тому +3

    Factoring primes is tough, but I think the greatest security the RSA algorithm provides isn't that. It's the incredible dullness of all known explanations of how it encrypts things.

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

    thanx, i hope you do a video about SIT encryption for IOT it would be very helpful

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

    This sounds like the PGP encryption... is PGP a kind of RSA or a different algorithm that also happens to have public and private keys?

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

      No PGP is the software that combines asymmetric and symmetric encryption.
      He explained the functionality of PGP when he explained RSA's use case at ~5:00

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

    @ cca 5:00 I believe you meant 2048 bits and not 248 bits (cuz then you said it's 256 bytes and then it doesn't add up)

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

    I like the reference to "Mean Girls"

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

    Awesome! 2 likes for the video, a dislike for not including the lecture in the description.
    - You total is 1 like, sir, have a nice day

  • @user-gh6sn3wd7v
    @user-gh6sn3wd7v 3 роки тому +1

    Very informative thanks

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

    Bro do you even calculate the area under elliptical curve?

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

    4:55 I did not know there was a limit to the amount of data that RSA can encrypt. Why? Source? I thought the problem was if you encrypted text with RSA then traditional language analysis could be used to figure out the message. Since the letters ‘E,’ T’ and spaces would always have the same corresponding cypher text letter, then a smart person could eventually figure out the pattern and deduce the message - without cracking the RSA keys. Whereas an AES key has no recognizable pattern since it looks like a random list of bits.
    Also, RSA encryption is significantly slower than AES. So it’s better to RSA encrypt the short AES key and then encrypt the message using the faster AES algorithm with the encrypted AES key.

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

      This is why RSA is usually used in conjuction with a *padding scheme*. According to Wikipedia - RSA (cryptosystem), "This padding ensures that [the message] does not fall into the range of insecure plaintexts, and that a given message, once padded, will encrypt to one of a large number of different possible ciphertexts."
      And yes, the key length determines the largest message RSA can encrypt. This is because "the modulus" is a limiting factor in the sense that multiple plaintexts can correspond to the same ciphertext. For exame, if the modulus is 91, both plaintexts 5 and 96 will result in the same ciphertext. It would be impossible to uniquely decrypt! Thats why we limit the message to be less than the modulus. The solution is to either break the message in chunks, or (better) use a padding scheme.

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

      @@glitchy_weasel That makes sense, thank you. I know it’s not an issue since in practice it is only used to encrypt a symmetric key, but I was curious to know why it couldn’t be used in that manner.

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

    The casual P=NP on the chalk board

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

    Je definitely recommence the video by (UA-cam) Art of the Problem named ‘Public Key cryptography: RSA Encryption Algorithm’
    Definitely boils it down to the bare concept while keeping a balance between specifics and simplicity.

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

    thank u sir i have understood :3

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

    i always thought rsa stood for rosallosynthetic saedric almanation process

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

    mental outlaw is the best and will change the world
    watch the ads to the end or u want digital garden monopolies!

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

    So, the private and public keys are interchangeable (math-wise) before you declare that one as private and one as public - correct?

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

      I dont think so, you can get the public key from the private key, but if the relationship between them was symmetrical, anyone with your public key could just treat it as a private key and its' "public" key would be your original private key

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

      Actually, the keys in RSA are not the prime numbers per-se. But rather the keys are obtained after crunching some numbers and the keys are the "modular multiplicative inverse" of one another.
      Due to reasons I don't completly understand yet, most implementations choose either 3 or 65537 to be the "public exponent" and then generate a "private exponent". For example, in the minute 9:15 you can see that the Exponent is indeed 65537. Chances are that if you check the certificate of any website, it will use the same.
      While mathematically, any key can be choosen to be the private and public, it would be dumb to choose the one with the exponent 65537 as the private because everyone knows it.

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

      @@glitchy_weasel Oh! Sounds like you know a lot about the math-side of it! I had to use the public/private keys provided in Java when I did my blockchain assignment in class, but didn't really know how the math worked.
      Any good tutorials for learning the higher-level math of it?

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

      @@SCTproductionsJ5 I’ve found all the proofs detailed on Google various sources, just type it

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

    Not sure, i thought private was to decrypt, and public to encrypt. So you can encrypt using private as well?

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

    can I get a video on PGP next please?

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

    The relationship between private and public keys remains a mystery me.

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

    Hi , if somethink is crypted with rsa its mean can is have crypto ? I have some old hard driver from 2014 and at roming where is crypto file is show rsa and 3 file system with letter and numbers

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

    if the attacker got the alice public key, means attacker also can use it private key to decrypt ?

  • @Nuh_uh.ur_gay
    @Nuh_uh.ur_gay 3 роки тому +8

    Do you get monetized for these vids?

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

      prob not

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

      Obviously yes... he's well above the monetization threshold, there are ads on the videos, he doesn't violate copyright, and he isn't particular edgy (at least explicitly).

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

      @@apostleofazathoth7696
      I mean it's absolutely fair game.
      As long as there isn't a 3 Minute 'word from the sponsor of this video' intro every video I am very all right with mid roll ads that get blocked for me anyways.

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

      @@apostleofazathoth7696 Wasn't UA-cam going to start putting ads on videos even with monetization turned off?

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

      @@waaaaaaah5135 I heard about it being on copyright-violating stuff and also enabling them by default|on older videos which you could manually change later.

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

    Very good video.

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

    thanks for this video

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

    Great explanation

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

    thanks

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

    Nice

  • @user-fp7fs9xl2t
    @user-fp7fs9xl2t Місяць тому

    Thanks Mental Outlaw ...

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

    woah

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

    How can enable encryption in Archer Control Panel

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

    an example would have been so useful

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

    wow im early

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

    Now I understand

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

    diffie heilmann is so damn cool

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

    😁👍🏼

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

    0:30 anyone else tried to scroll up?

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

    Hey, have you heard about Plan 9? You might wanna check it out.

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

      @@WizardNumberNext It's pretty old, beautiful and outdated.

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

      From doc.cat-v.org/plan_9/humour/: A Professor of Computer Science gave a paper on how he uses Linux to teach his undergraduates about operating systems. Someone in the audience asked ‘why use Linux rather than Plan 9?’ and the professor answered: ‘Plan 9 looks like it was written by experts; Linux looks like something my students could aspire to write’.

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

    next gpg

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

    hai

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

    7:29 SUS? 😳

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

    3:25
    You have your logic reversed here in your explanation. You should have said that the public key encrypts and he private key decrypts.

  • @dr.derekrobinson1920
    @dr.derekrobinson1920 3 роки тому +5

    You can encrypt my AES

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

    Should be noted: DO NOT USE RSA. ESPECIALLY DO NOT ROLL YOUR OWN RSA IMPLEMENTATION. A large portion of modern crypto vulnerablities today are the result of programmers with no formal background in number theory using their own RSA because its math is deceptively simple to implement. The fact is that RSA is a minefield of mistakes waiting to happen be it not padding your ciphertext, using a too small public exponent, choosing primes that are too close or using primes that aren't securely generated, sending the same or similar messages encrypted with different keys, using the same prime for two different keys, the list goes on.
    For asymetric encryption, it is _strongly_ adviced that you use Elliptic curves, in particular Curve25519. The parameters of which have been carefully chosen by experienced cryptographers who know what they're doing.

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

      My school uses rsa encryption to stop people from using vpns how do i get by it ?

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

      @@nexde6853 It's very difficult to answer this question without further details.
      It sounds pretty strange what you're describing, generally VPNs would be blocked by having IP-blacklists of VPN providers and blocked ports used by VPN tools (for example blocking port 51820 for Wireguard).
      Encryption can't really be used to block VPNs.

  • @johnwitt
    @johnwitt 28 днів тому

    5:00 did you mean 2048 and not 248? You casual.

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

    tl;dw cryptography ia hard

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

    ayy hi

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

    yeah yeah but still having the key they can still use it to decrypt it, by calculating the key, yeah i know, compute power, sure, goverment has the compute power, universities, and this is still really insecure, public and private keys my ass.

  • @user-ui4fn6fj3p
    @user-ui4fn6fj3p 3 роки тому

    around 3:25 u said that people can use your public key to decrypt messages encrypted with your private key. this is not the case!

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

      It seems RSA is pretty symmetric in that regard - you could use either from the pair and it only make a difference when you share one with somebody:
      stackoverflow.com/a/1189651
      I also took a quick look at Wikipedia, for the particular equations that RSA uses and both keys consists of that product of two primes (n), together with numbers e and d (for encryption&decryption respectively).
      The most basic feature of these two numbers is that if you multiply them (mod n), you get one.
      And since d*e=e*d, they will work either way.

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

      Digital signature and SSH authentication works this way. You'd encrypt something with your private key (usually located at your workstation) and if the public key (on the target server) can decrypt it, access will be granted.

    • @user-ui4fn6fj3p
      @user-ui4fn6fj3p 3 роки тому

      @@mskiptr close. if you encrypt, or "sign", a message with the private key, and send that hash along with the message, you can use the public key on the message to get the same hash and therefore verify identity. you cannot, however, decrypt the hash to get the message using the public key. it's a one way function.

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

      @@user-ui4fn6fj3p Yeah, but isn't that outside the RSA itself? I mean, the most obvious (and reasonable) use case is to 'sign' hashes and 'encrypt' keys, but ofc. you could get some short text through it directly.
      I am not sure if any tooling supports doing such a thing - openSSL seems to provide some low-level control, but I am not really experienced with it and didn't get it to work yet. It may very well just be that widespread formats and standards can't handle such usage.

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

    3rd

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

    cool I'm early

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

    RSA is on the way OUT! Watch THIS video ---> ua-cam.com/video/hHNvefPfH-g/v-deo.html

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

    Adi shamir by his face looks jewish.

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

    Talking too much , boring and not informative