If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Feedback

What did you think of this lesson?

We hope you enjoyed this lesson. Please let us know what worked well and what could be improved in the discussion below. We will incorporate your feedback in future iterations.

Want to join the conversation?

  • mr pants teal style avatar for user jkavijfJOSHa;orifhha;orihg
    What different kinds of logic gates are there?
    (25 votes)
    Default Khan Academy avatar avatar for user
    • sneak peak green style avatar for user Drew Barker
      There is three types of gates: and gates, not gates, and or gates. If there is a "n" at the beginning of the name of a logic gate, then the output is the opposite of would it normally be. If there is a x at the beginning of the logic gate's name, then the output is flipped only if both inputs are a one. There is no xand gate because it would always output a 0. Similarly, there is no nxand gate because it would always output a 1.
      (8 votes)
  • male robot hal style avatar for user sabrist2003
    How would I create an encryption for a computer that prevents viruses?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam blue style avatar for user pJOofdcAEr
      Short answer, you can't. Cryptography is the process of data obfuscation. Antivirus software is focused on identifying and eliminating viruses by signature or by behavior at the machine code level. They are two unrelated areas of study, and cryptography is not a generalized solution for every imaginable computer related problem. Cryptography does what cryptography does.
      All modern commercially available microprocessors run, by definition, unencrypted machine code. So in order to run an encrypted piece of machine code, it would have to be decrypted first, and at that point it becomes vulnerable to attack, viral or otherwise. This a simple answer to a explain why a solution to a very old and very well understood problem still has not been solved.
      (27 votes)
  • spunky sam blue style avatar for user dvdsknz
    OR is inclusive
    XOR is exclusive
    A mnemonic for that is "ex"clusive sounds like the "x" in XOR.
    That's how I remember the difference.
    What are the ways you remember some of these techniques?
    (10 votes)
    Default Khan Academy avatar avatar for user
  • piceratops seedling style avatar for user neya
    What exactly is the point of using AND/OR/XOR as a cipher- I get the scrambling of pictures, but other than that where is it used?
    (6 votes)
    Default Khan Academy avatar avatar for user
    • leafers ultimate style avatar for user Diogo Ribeiro
      At most fundamental level, what you're trying to encrypt is a single bit of information (either a 1 or 0). Every message is converted into bits so that it can be used by a computer, so the question is: how can you encrypt a bit? The only way to do it is to apply a bitwise operation to it.
      That's why we talk about the bitwise opperations AND/OR/XOR.
      (14 votes)
  • winston baby style avatar for user David Valencia
    The articles were at a good length by going over the topic really well while not being too information heavy. would've wanted more interactive activities.
    (7 votes)
    Default Khan Academy avatar avatar for user
  • sneak peak yellow style avatar for user Amogha
    I'm only 13 so I'm only capable of understanding what cryptography is and simple ciphers/codes, but I still want to know what XOR is. Could someone explain it in simpler words? Many Thanks in Advance.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user thomaspearson990
      XOR is a logic gate that takes (in encryption) a randomly binary sequence and on a one alters your original binary string, or doesn't on a 0. This is useful because it means, due to randomness, it changes the chance of a 0 to being COMPLETELY random. However, due to AND and OR having a 75% chance one way from a random string, this still allows only scrambling that seems about half as random, ie. half the information is still deciferable. Note the point of encryption is to take a randomly generated string of binary(for computers), and take an ordered set of binary, and apply some logic and make the ordered set seem random in such a way that it is still deciferable by someone who has the random sequence. To decrypt an XOR, another layer of XOR should be applied (due to XOR being an exact opposite of itself). Also note that after an OR or AND encryption, there is no way to actually unencrypt a quarter of the stored data on average, as with AND if we encrypted with a 0 we could've either started with a 0 or 1, but still get a 0, and with OR if we encrypt using a 1 and get a 1, we could've started using a 1 or 0. The method to apply for reversing an AND is to apply an AND to the two layers you have, and note that this gives a 0 at uncertain points, whereas we OR an OR encryption and note that 1 & 1 together will result in a 1, not the uncertain 1 or 0.
      (4 votes)
  • blobby green style avatar for user Marc579
    I don't really understand the Bitwise problems with variables, mostly with all variables like, (X xor y) xor (y xor z).
    (6 votes)
    Default Khan Academy avatar avatar for user
  • piceratops tree style avatar for user Matyáš Pokorný
    Is it just me, or have others skipped vlgenere cipher because you failed at first time, and doing it 5 times is way too much time spent on one exercise?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user Anne Smeets
    Can you also discuss the PUF's? It's basically logic gates, but it is cool to show.
    (3 votes)
    Default Khan Academy avatar avatar for user
  • male robot donald style avatar for user Mbaba, Edo
    It was ok the AND, OR, and XOR were pretty easy to understand
    (3 votes)
    Default Khan Academy avatar avatar for user