Today let’s discuss (almost) the best cryptography technique in the world. It is called One Time Pad Cipher. To understand why it is so good let’s understand how it works.
Key here is the key :)! It needs to be perfectly random and the same length as the plain text. If you will XOR plain text with such a key you will get ciphertext. Perfectly random ciphertext, same as the key. To decipher it you just need to XOR it again. The truth table shows that after such an operation you will get the same output as the plain text.
So thanks to its randomness this cipher is uncrackable. The XOR function is very easy to implement and efficient. So why don’t we use that everywhere? That’s because of 3 issues:
1st you need to generate a truly random sequence and that’s not an easy task
2nd you need to somehow share the key between RX and TX site
3rd you need to have the same amount of random data as the plain text- that’s not efficient.
To sum up One Time Pad is ideal in terms of security but (almost) impractical. I said almost because sometimes when you require high security and low throughput it could be used but generally, you can’t use it.