In encryption, a substitution cipher replaces units of plaintext with ciphertext according to a regular system. The recipient of the ciphertext can decipher it by performing an inverse substitution. The unit can be anything from a single letter, letters or a mixture of both. Although the plaintext units themselves are altered, they remain in the same sequence in the ciphertext. (This contrasts with a transposition cipher where the units are left unchanged, but their order is rearranged.)
A simple substitution cipher operates on single letters. Using the example below, we can turn the word BADGE into WQRUT in ciphertext:
|A||B||C||D||E||F||G||H||I||J||. . .|
|Q||W||E||R||T||Y||U||I||O||P||. . .|
The disadvantage of this method is that with any message of reasonable length, fifty letters or more, frequency analysis can be used to deduce the meaning of the most common symbols, allowing a cryptanalyst to build partial words and progressively break the message.
Now, a one-time pad is similar to a substitution cipher, but the plaintext letters are combined not substituted, and it has been proven to be mathematically unbreakable. The recipient of the ciphertext requires a copy of the one-time pad to reverse the process. There are many different ways to apply one-time pads. Here's an example using letters for the one-time pad key:
- The key has to be as long as the plaintext, thus leaking some information about the message.
- The key has to be genuinely random, which is hard to achieve for large keys.
- The key can only be used once and must be kept entirely secret from all except the sender and receiver, creating a distribution problem.
Dig Deeper on Disk and file encryption tools
Related Q&A from Michael Cobb
Explore the differences between symmetric vs. asymmetric encryption algorithms, including common uses and examples of both, as well as their pros and... Continue Reading
Pirated software is still a major concern nowadays. Uncover how to prevent software piracy and protect your organization's intellectual property. Continue Reading
Shellcode is a set of instructions that executes a command in software to take control of or exploit a compromised machine. Read up on the malware ... Continue Reading