Math Problem Statement
Exercise 5.5 (Entropies in the affine cipher) Compute H(K|C) and H(K|P,C) for the Affine cipher when used to encrypt a single letter from the English alphabet. Assume that keys and plaintexts are uniformly chosen.
Solution
To compute and for the Affine cipher, we need to review the concepts of conditional entropy in the context of cryptography, particularly for the Affine cipher. The Affine cipher encryption function is given by:
where:
- is the plaintext (a letter from the alphabet).
- is the ciphertext (also a letter from the alphabet).
- and are the components of the key .
- must be coprime with 26 (the number of letters in the alphabet).
Entropy Definitions
-
Entropy of a random variable: For a random variable , the entropy is given by: where is the probability that takes the value .
-
Conditional entropy: The conditional entropy is the entropy of given and represents the remaining uncertainty about after is known. It is given by:
Step-by-Step Computation
1. Computing (Conditional Entropy of the Key Given the Ciphertext)
- Let be the key, where is chosen from the set of integers coprime with 26, and is chosen from the set .
- There are 12 possible values for (as only 12 integers between 1 and 25 are coprime with 26) and 26 possible values for , giving a total of possible keys.
When a ciphertext is known, the key is not fully determined, as multiple keys can map different plaintexts to the same ciphertext. This is because the Affine cipher is not a one-to-one function for keys and ciphertexts. Specifically, for each ciphertext, there are multiple possible key combinations that could have produced it.
Thus, the uncertainty about the key remains even when the ciphertext is known, and this conditional entropy is non-zero.
Given that keys are uniformly distributed, and because there are 312 possible keys and 26 ciphertexts, we can approximate:
This accounts for the uncertainty about the multiplier in the key when the ciphertext is known.
2. Computing (Conditional Entropy of the Key Given the Plaintext and Ciphertext)
If both the plaintext and ciphertext are known, the key becomes fully determined. Specifically, given both and , we can solve the Affine cipher equation to uniquely determine and , the components of the key . Therefore, knowing both the plaintext and the ciphertext eliminates all uncertainty about the key.
Thus:
Summary
Would you like more details or have any questions?
Here are 5 related questions for further exploration:
- How does the structure of the Affine cipher compare to other classical ciphers like the Caesar cipher?
- How would the entropies change if the size of the alphabet was different (e.g., a larger or smaller set)?
- What is the role of coprimality in ensuring the Affine cipher’s reversibility?
- How would you compute , the entropy of the key given only the plaintext?
- How does the uniform distribution assumption affect the entropies in the Affine cipher?
Tip: In cryptography, understanding the relationship between plaintext, ciphertext, and the key is essential for assessing the security of the cipher. The more information a cipher leaks, the less secure it is.
Ask a new question for Free
By Image
Drop file here or Click Here to upload
Math Problem Analysis
Mathematical Concepts
Cryptography
Conditional Entropy
Affine Cipher
Probability Theory
Formulas
C = (aP + b) mod 26
H(X) = - ∑ P(X=x) log2 P(X=x)
H(X|Y) = - ∑ P(X=x, Y=y) log2 P(X=x | Y=y)
H(K|C) = log2 12
Theorems
Conditional Entropy Theorem
Suitable Grade Level
Undergraduate Level (Cryptography or Information Theory Course)
Related Recommendation
Proving H(K|C) >= H(P|C) in Cryptography: Understanding Entropy and Mutual Information
Proving H(K|C) >= H(P|C) in Cryptosystems with Entropy
Probability Calculation in Shift Cipher for Ciphertext B
Solution for Information Theory Problem 12: Entropy, Symbol Duration, Productivity, and Redundancy
Affine Cipher: Encryption and Decryption with Modular Arithmetic