How important is entropy in cryptography?
Today, let’s discuss why entropy is so important in cryptography, using the Caesar Cipher and One Time Pad Cipher for comparison.
The Caesar Cipher works by shifting the letters of the alphabet by a predetermined number, known as the ‘key’. For instance, a shift of 3 would change ‘A’ to ‘D’, ‘B’ to ‘E’, and so on.
Interestingly, instead of using a single number as a key, we can use a repeating sequence of numbers for a higher complexity. Each number in the sequence shifts a different character in the plaintext. For example, a shift sequence of 10, 15, 20 would shift the 1st letter of the text by 10 positions in the alphabet, the 2nd by 15, the 3rd by 20, the 4th again by 10, the 5th by 15, and so forth.
Despite this modification, the Caesar Cipher and it’s modifications can be cracked with brute force or frequency analysis. Specifically, the English alphabet offers only 25 possible characters and is relatively vulnerable. However, by randomizing the key for each letter in the text, we arrive at the unbreakable One Time Pad cipher.
The One Time Pad (OTP) Cipher is considered unbreakable as it uses a unique secret key, as long as the message itself. This key, entirely random, is discarded after a single use. Consequently, there are no patterns for a would-be code breaker to find and exploit, because any message of the same length could be a potential fit. That’s what makes it so secure.
As illustrated, proper randomization (good entropy) of the key can transform a simple cipher into a perfect one.