Animated Explanation of the one-time pad

Sdílet
Vložit
  • čas přidán 28. 07. 2024

Komentáře • 38

  • @breathandrelax2
    @breathandrelax2 Před 3 lety +19

    whoa! after searching for hours finally you made it crystal clear. thank you buddy. you the man

  • @kyokokirigiri166
    @kyokokirigiri166 Před rokem +1

    you are amazing in teaching simple and straight to the point and making it funny at the same time. thank you for your time!

  • @greatonreviews
    @greatonreviews Před 2 lety +2

    Amazing , super clear and precise! Thank you! :D

  • @MrBitviper
    @MrBitviper Před 2 lety +1

    thanks for the clear explanation. much appreciated

  • @dilshadurrahman4248
    @dilshadurrahman4248 Před 2 lety +1

    Nice explanation of OTP. Thanks.

  • @NyorexDC
    @NyorexDC Před 3 lety +2

    Dude I love this, thanks

  • @azuboof
    @azuboof Před 8 měsíci

    beautiful animations

  • @lucarauchenberger628
    @lucarauchenberger628 Před 3 lety +1

    very well explained

  • @funny-re1vf
    @funny-re1vf Před 3 lety

    great video ..thank you so much

  • @civedm
    @civedm Před 3 lety +8

    I'm pretty sure the original idea of the one-time-pad didn't involve ACSII and binary. The system was such that it could be easily done on a piece of paper by hand.

    • @canadiancoding
      @canadiancoding  Před 3 lety +2

      It may not have used ASCII specifically (numbers may have been different), but it would've worked exactly the same. The ASCII version, and any other character coded system can be done on paper (I had to do that for this video actually).

    • @leif_____8579
      @leif_____8579 Před 2 lety

      OTP was mainly used by Secret services. Agents were given a sheet of numbers (The equivalent to the key here) with which they could decrypt secret messages.

  • @maomxesoax2471
    @maomxesoax2471 Před 3 lety +3

    ENCRYPT: (msgcharvalue + otpcharvalue) - 1 DECRYPT: (encryptcharvalue - otpcharvalue) + 1 If a result is more than the character set length or is less than zero then mod it by character set length.

  • @handsomeman-pm9vy
    @handsomeman-pm9vy Před rokem

    It is also the final operation in every Stream Cipher.

  • @yojumba
    @yojumba Před 3 lety

    Thx for the great explanation!

  • @jack.p
    @jack.p Před 2 dny

    So if there was an agent in the field, they might be given a OTP in person before leaving, then if and when a message needs to be sent, they could just broadcast it publicly in complete confidence?

    • @canadiancoding
      @canadiancoding  Před dnem

      Yes, so old wartime schemes you would leave with a physical ciphertext, and using that ciphertext you can just broadcast out in public over radio. Often different ciphertexts were given to people of different ranks so that messages could only be read by specific people in the field depending on the operation.

  • @LLNB2196
    @LLNB2196 Před 2 lety

    Damn, I love your humor hahahah

  • @mattd6085
    @mattd6085 Před 2 měsíci

    What binary translation are you using to get your numbers? If your ASCII strings are, for example, 51 for the plain text first letter and 101 for the pad first letter, then the binary conversion will be of a differing length? You can't do XOR with differing string lengths of binary.

    • @canadiancoding
      @canadiancoding  Před 2 měsíci

      This is actually a good point. I should have mentioned it during the video. If you watch the animation from 3:55 onward you will see every number is left-padded (add 0's to the left) to 8 bits. So every number is 1 byte, and if it can be stored in less bytes then it's just less efficient. This is because ASCII is a fixed-length encoding, whereas something like Unicode makes this more complicated. Hope that makes sense

  • @JuanGerardoHernandez
    @JuanGerardoHernandez Před 2 lety +2

    How Bob get the pad form Alice?

    • @canadiancoding
      @canadiancoding  Před 2 lety

      There are essentially an infinite number of ways to do this. These could include any form of network interaction like sending messages back and forth via WIFI, all the way to printing the details out and doing it by hand would work. That section of the protocol allows for a ton of leniency to implement however works best for you.

  • @ninmarwarda5154
    @ninmarwarda5154 Před 2 lety

    But if Eve has the pad and ciphertext then she can easily decrypt it, right? And it is usually the case that the pad and ciphertext are public, isn't it?

    • @canadiancoding
      @canadiancoding  Před 2 lety

      The pad in this example is typically the thing that is kept secret or is somehow obfuscated. This means the content itself can be distributed publicly without worry, and the only thing you need to keep safe is the pad. Likewise it means you can use the same pad for multiple pieces of content (VERY NOT IDEAL security wise) which means you only have to keep 1 thing private and everything else after that can just be distributed publically.
      Alternatively it can be distributed with some sort of encryption that then has a handshake to allow the decryption key to be distributed. For example you might distribute an encrypted pad over a public channel, but it is locked behind a 16 digit password that was transferred using something like the Diffie-Hellman key exchange (github.com/Descent098/Diffie-Hellman), or even just setup a secure connection with something like SSL (www.ssl.com/faqs/faq-what-is-ssl/) using a key exchange to distribute the pad privately.

  • @purple3036
    @purple3036 Před rokem

    how the pad is exchanged?

    • @canadiancoding
      @canadiancoding  Před rokem

      There isn't any specific way to do this, ideally this is a step you would do "in-private", since if you do it "in-public" this part would need to be secured somehow (no specifics given in the OTP protocl). If eve is able to get ahold of the pad while in transfer then the whole system is no longer secure. One option is to do public-key exchange and then encrypt the pad with a key when you send it. Something like diffie-hellman can do this, which I created a repo to explain here: github.com/descent098/diffie-hellman
      Thanks for watching!

  • @BucolicLife
    @BucolicLife Před 13 dny

    I read on Wikipedia that it is the only encryption mechanism that is not breakable no matter what quantum computer together with any mathematical decryption algorithms is used. Is that correct? If so, then is this the ultimate encryption system?

    • @Descent098
      @Descent098 Před 9 dny

      The version I explained in my video is not quantum secure afaik. I think you could make it EFFECTIVELY quantum secure if your note is long enough, but the protocol itself is not secure against quantum attacks. There are versions of the one-time pad that could be, but they're more complicated.
      I think what you're referring to is when people call the one time pad a "perfectly secret" scheme. All this means is that the ciphertext we use doesn't leak any information, meaning there are no side channel attacks. This is all a fancy way to say that you can't get information AT ALL about the content you're trying to encrypt, from how you encrypted it. Other methods will use the source text to generate their encryption, and so they are not "perfect secret" schemes.
      I can't cite sources in a youtube comment but if you google "perfect secrecy" there is a video on khan academy, and one on wolfram U that will explain the concept well.
      For post-quantum security there's a good channel called Chalk Talk here on youtube that cover quantum secured approaches like lattice-based cryptography.

    • @canadiancoding
      @canadiancoding  Před 9 dny

      The version I explained in my video is not quantum secure afaik. I think you could make it EFFECTIVELY quantum secure if your note is long enough, but the protocol itself is not secure against quantum attacks. There are versions of the one-time pad that could be, but they're more complicated.
      I think what you're referring to is when people call the one time pad a "perfectly secret" scheme. All this means is that the ciphertext we use doesn't leak any information, meaning there are no side channel attacks. This is all a fancy way to say that you can't get information AT ALL about the content you're trying to encrypt, from how you encrypted it. Other methods will use the source text to generate their encryption, and so they are not "perfect secret" schemes.
      I can't cite sources in a youtube comment but if you google "perfect secrecy" there is a video on khan academy, and one on wolfram U that will explain the concept well.
      For post-quantum security there's a good channel called Chalk Talk here on youtube that cover quantum secured approaches like lattice-based cryptography.

  • @canadiancoding
    @canadiancoding  Před dnem

    Since this video is getting more popular, I will give people some other cryptography topics, and links that have come up in the comments:
    - History of OTP
    - It was used heavily before computers in wartime where people would be physically given a sheet of paper for the ciphertext, and then messages would be sent out over public radio frequencies to soldiers to get their orders
    - Crib Dragging
    - This is a method that allows you to break the one time pad if you know some of the contents that are in the text
    - Public Key cryptography; This is how all your connections on the internet are secured
    - Diffie Hellman is the most popular of these schemes
    - I have an explainer for this on my github at github.com/descent098/diffie-hellman
    - Post Quantum Cryptography
    - Lattice-based encryption
    - Chalk Talk is a good channel on youtube for info about this
    - Encodings
    - What we did with the binary numbers to letters is called an encoding, there are a bunch of popular ones
    - UTF-8; The most commonly used encoding for text these days

  • @war-c0mmander
    @war-c0mmander Před 2 lety

    👍

  • @HenryCasillas
    @HenryCasillas Před 2 lety

    ☮️

  • @DeleriousOdyssey
    @DeleriousOdyssey Před 2 lety +1

    Why is this so hard for me to understand? Lol

  • @wheelieblind
    @wheelieblind Před 2 lety

    Next time use unicode lol

    • @canadiancoding
      @canadiancoding  Před 2 lety +2

      For a video like this Unicode is unwieldy, this is meant to be an intro not a how-to necessarily. The primary purpose of this video was for a course I took where the prof wanted a teaching utility to show people about the protocol. ASCII is just simple because it's a small enough collection to do by hand while being expressive enough to be useful. In the real world the character encodings themselves get incredibly annoying to deal with (especially with bloody emoji's), and Unicode would be better especially for languages other than English. Thanks for watching!

  • @c.j.1089
    @c.j.1089 Před 2 lety +1

    this overcomplicates the one time pad immensely.