« Back to Glossary Index

The XOR cipher is a symmetric encryption technique that utilizes the exclusive OR (XOR) logical operation to encrypt and decrypt data. In this method, each bit of the plaintext is combined with a corresponding bit from a key using the XOR operation. The XOR operation outputs 1 when the input bits differ and 0 when they are the same. This process results in ciphertext, which can be reverted to the original plaintext by applying the same XOR operation with the same key.

How the XOR Cipher Works:

  1. Encryption: Each bit of the plaintext is XORed with a corresponding bit from the key to produce the ciphertext.
  2. Decryption: The ciphertext is XORed with the same key to retrieve the original plaintext.

Example:

Consider a simple example where the plaintext is 1010 and the key is 1100.

  • Encryption:
    • Plaintext: 1010
    • Key: 1100
    • Ciphertext: 0110 (result of XORing corresponding bits)
  • Decryption:
    • Ciphertext: 0110
    • Key: 1100
    • Plaintext: 1010 (result of XORing corresponding bits)

« Back to Glossary Index